15bd8deadSopenharmony_ciXXX - incomplete (needs number, glx protocol, enumerant values) 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ciName 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ci SGIX_depth_pass_instrument 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ciName Strings 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ci GL_SGIX_depth_pass_instrument 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ciVersion 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ci Last Modified Date: 10/21/1998 145bd8deadSopenharmony_ci $Date: 1998/10/21 19:08:52 $ $Revision: 1.4 $ 155bd8deadSopenharmony_ci 165bd8deadSopenharmony_ciNumber 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ci 205 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ciDependencies 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci SGIX_instruments is required 235bd8deadSopenharmony_ci SGIX_multisample affects the definition of this extension. 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciOverview 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci This extension defines an instrument that uses the API defined in 285bd8deadSopenharmony_ci SGIX_instruments. The instrument specified by this extension is a 295bd8deadSopenharmony_ci counter of the number of fragments which passed the Z test during 305bd8deadSopenharmony_ci rasterization. The maximum value of the counter is an 315bd8deadSopenharmony_ci implementation-dependent constant. 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci Some systems may maintain counters on different parts of the 345bd8deadSopenharmony_ci system. For example, a system with a frame buffer distributed 355bd8deadSopenharmony_ci across multiple chips may maintain a count of the fragments which 365bd8deadSopenharmony_ci passed the depth test on each individual chip. In this extension, 375bd8deadSopenharmony_ci a queriable constant is defined that indicates the number of 385bd8deadSopenharmony_ci responses to expect when a measurement is taken. This 395bd8deadSopenharmony_ci mechanism allows GL implementations to be as efficient as possible. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ciIssues 425bd8deadSopenharmony_ci 435bd8deadSopenharmony_ci * Should we count fragments drawn when the depth test was 445bd8deadSopenharmony_ci disabled? 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci A: Doesn't seem to be a strong reason to do this one way or 475bd8deadSopenharmony_ci the other -- let's treat disabled depth test the same as a 485bd8deadSopenharmony_ci depth func of ALWAYS. 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci * Should we guarantee that if other counters are enabled when the 515bd8deadSopenharmony_ci query is issued, the depth pass responses are placed 525bd8deadSopenharmony_ci successively in the buffer? This might make interpreting the 535bd8deadSopenharmony_ci buffer easier but would complicate and slightly slow the 545bd8deadSopenharmony_ci OpenGL implementation. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci A: They should be successive. The GL burden shouldn't be that 575bd8deadSopenharmony_ci great since the buffer can be reordered during the 585bd8deadSopenharmony_ci PollInstrumentsSGIX command. This way we can probably 595bd8deadSopenharmony_ci avoid moving the contents of the entire buffer around and 605bd8deadSopenharmony_ci also keep the resource allocation burden in the 615bd8deadSopenharmony_ci application. 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci * Having each counter response appear as an independent 645bd8deadSopenharmony_ci instrument is awkward and wastes space in the buffer. Could 655bd8deadSopenharmony_ci we have GL combine them?? 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci A: No. It will be natural for some hardware implementations 685bd8deadSopenharmony_ci to have multiple instruments returned in a non-guaranteed 695bd8deadSopenharmony_ci order using a DMA. In this case the implementation will 705bd8deadSopenharmony_ci need a way to differentiate the responses -- ie, a header. 715bd8deadSopenharmony_ci By putting the header for each instrument in the 725bd8deadSopenharmony_ci application's buffer, we allow the DMA destination to be 735bd8deadSopenharmony_ci the user's buffer. Combining the responses would 745bd8deadSopenharmony_ci complicate allocation since space would be required for 755bd8deadSopenharmony_ci them and would be slower since it would require more data 765bd8deadSopenharmony_ci movement. 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci * Should the counter value be considered state? 795bd8deadSopenharmony_ci SGIX_ir_instrument1 doesn't list its counters as state. 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci A: Seems like SGIX_ir_instrument1 may be wrong -- this seems 825bd8deadSopenharmony_ci like it should be state. Note that histogram and minmax 835bd8deadSopenharmony_ci contents are state. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci * In theory should we add something to the GLX protocol? 865bd8deadSopenharmony_ci SGIX_instruments doesn't establish a framework yet so it's 875bd8deadSopenharmony_ci kind of a moot point. 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ciNew Tokens 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable and IsEnabled: 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_SGIX 0x8310 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 965bd8deadSopenharmony_ci GetFloatv, and GetDoublev: 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 995bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ci None 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization) 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci None 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 1105bd8deadSopenharmony_ciand the Frame Buffer) 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci Added to subsection 4.1.5 (Depth buffer test) at the end of the 1135bd8deadSopenharmony_ci paragraph which begins "If the depth buffer test fails...": 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci If DEPTH_PASS_INSTRUMENT_SGIX is enabled and instruments have been 1165bd8deadSopenharmony_ci started via a call to StartInstrumentSGIX, a counter or counters 1175bd8deadSopenharmony_ci of the number of fragments which have passed the depth test or 1185bd8deadSopenharmony_ci which have been drawn when the depth test is disabled is 1195bd8deadSopenharmony_ci maintained. The number of counters can be queried using the token 1205bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX. For each fragment which 1215bd8deadSopenharmony_ci passes the depth test or is drawn with depth testing disabled, one 1225bd8deadSopenharmony_ci counter is incremented by one. If MULTISAMPLE_SGIS is enabled, 1235bd8deadSopenharmony_ci the counter is incremented by one for each fragment containing at 1245bd8deadSopenharmony_ci least one sample for which the depth test passed. If the 1255bd8deadSopenharmony_ci increment would have caused the counter to go beyond is maximum 1265bd8deadSopenharmony_ci representable value, the count is clamped to the maximum. The 1275bd8deadSopenharmony_ci maximum value of the counters may be queried using 1285bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_MAX_SGIX. The counter values are unsigned, 1295bd8deadSopenharmony_ci so DEPTH_PASS_INSTRUMENT_MAX_SGIX may be as high as the maximum 1305bd8deadSopenharmony_ci value of an unsigned integer. 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions) 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci Add to the end of section 5.X entitled Instruments: 1355bd8deadSopenharmony_ci 1365bd8deadSopenharmony_ci The instrument DEPTH_PASS_INSTRUMENT_SGIX returns for each 1375bd8deadSopenharmony_ci measurement a system-dependent constant number of responses to the 1385bd8deadSopenharmony_ci buffer. The constant may be queried using the Get with an 1395bd8deadSopenharmony_ci argument of DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX. Each response is 1405bd8deadSopenharmony_ci formatted as though it came from an independent instrument. If 1415bd8deadSopenharmony_ci more than one instrument is enabled, the responses from the depth 1425bd8deadSopenharmony_ci pass instrument will be placed successively (as opposed to 1435bd8deadSopenharmony_ci possibly being interrupted by responses from other instruments). 1445bd8deadSopenharmony_ci 1455bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_SGIX responses are formatted as follows 1465bd8deadSopenharmony_ci (starting at the first word): 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_SGIX 1495bd8deadSopenharmony_ci Number of int's in the response (4) 1505bd8deadSopenharmony_ci Counter value 1515bd8deadSopenharmony_ci Marker value 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci The counter value is padded to the size of an unsigned int if 1545bd8deadSopenharmony_ci necessary by zero-filling the most significant bits. 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci Assuming that none of the counters overflowed, the total number of 1575bd8deadSopenharmony_ci fragments that passed the depth test while the instrument was 1585bd8deadSopenharmony_ci enabled is equal to the sum of all the counter values. 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci Although different responses come from different hardware 1615bd8deadSopenharmony_ci counters, they should be considered identical by the software and 1625bd8deadSopenharmony_ci no guarantee is made about how the responses for each counter are 1635bd8deadSopenharmony_ci ordered within a single query response. For example, a hardware 1645bd8deadSopenharmony_ci implementation may maintain a counter for each quadrant of the 1655bd8deadSopenharmony_ci screen, but which response in the buffer came from which counter 1665bd8deadSopenharmony_ci is not exposed to the application. 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests) 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci None 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ciAdditions to the GLX Specification 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci XXX 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ciErrors 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci None 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ciNew State 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attribute 1835bd8deadSopenharmony_ci --------- ----------- ---- ------------- --------- 1845bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_SGIX ReadInstrumentsSGIX 1*xZ+ 0 - 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ciNew Implementation Dependent State 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci Get Value Get Command Type Minimum Value 1895bd8deadSopenharmony_ci --------- ----------- ---- ------------- 1905bd8deadSopenharmony_ci DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX GetIntegerv Z+ 1 191