15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_occlusion_query_boolean
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_occlusion_query_boolean
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    All those who have contributed to the definition of occlusion
125bd8deadSopenharmony_ci    query functionality in the OpenGL ARB and OpenGL ES workgroups,
135bd8deadSopenharmony_ci    upon which this extension spec is entirely dependent.
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ciContact
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ci    Benj Lipchak, Apple (lipchak 'at' apple.com)
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciStatus
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Complete
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciVersion
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    Date: July 22, 2011
265bd8deadSopenharmony_ci    Revision: 2
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciNumber
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    OpenGL ES Extension #100
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciDependencies
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    Written based on the wording of the OpenGL ES 2.0.25 Full Specification
355bd8deadSopenharmony_ci    (November 2, 2010).
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ciOverview
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    This extension defines a mechanism whereby an application can
405bd8deadSopenharmony_ci    query whether any pixels (or, more precisely, samples) are drawn
415bd8deadSopenharmony_ci    by a primitive or group of primitives.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    The primary purpose of such a query (hereafter referred to as an
445bd8deadSopenharmony_ci    "occlusion query") is to determine the visibility of an object.
455bd8deadSopenharmony_ci    Typically, the application will render the major occluders in the
465bd8deadSopenharmony_ci    scene, then perform an occlusion query for each detail object in
475bd8deadSopenharmony_ci    the scene. On subsequent frames, the previous results of the
485bd8deadSopenharmony_ci    occlusion queries can be used to decide whether to draw an object
495bd8deadSopenharmony_ci    or not.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciNew Procedures and Functions
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    void GenQueriesEXT(sizei n, uint *ids);
545bd8deadSopenharmony_ci    void DeleteQueriesEXT(sizei n, const uint *ids);
555bd8deadSopenharmony_ci    boolean IsQueryEXT(uint id);
565bd8deadSopenharmony_ci    void BeginQueryEXT(enum target, uint id);
575bd8deadSopenharmony_ci    void EndQueryEXT(enum target);
585bd8deadSopenharmony_ci    void GetQueryivEXT(enum target, enum pname, int *params);
595bd8deadSopenharmony_ci    void GetQueryObjectuivEXT(uint id, enum pname, uint *params);
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ciNew Tokens
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    Accepted by the <target> parameter of BeginQueryEXT, EndQueryEXT,
645bd8deadSopenharmony_ci    and GetQueryivEXT:
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci        ANY_SAMPLES_PASSED_EXT                         0x8C2F
675bd8deadSopenharmony_ci        ANY_SAMPLES_PASSED_CONSERVATIVE_EXT            0x8D6A
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetQueryivEXT:
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci        CURRENT_QUERY_EXT                              0x8865
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetQueryObjectivEXT and
745bd8deadSopenharmony_ci    GetQueryObjectuivEXT:
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci        QUERY_RESULT_EXT                               0x8866
775bd8deadSopenharmony_ci        QUERY_RESULT_AVAILABLE_EXT                     0x8867
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL ES Operation)
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    Add a new section "Asynchronous Queries" between sections 2.12 and 2.13
825bd8deadSopenharmony_ci    and renumber subsequent sections:
835bd8deadSopenharmony_ci    
845bd8deadSopenharmony_ci    "2.13 Asynchronous Queries
855bd8deadSopenharmony_ci    
865bd8deadSopenharmony_ci    Asynchronous queries provide a mechanism to return information about the 
875bd8deadSopenharmony_ci    processing of a sequence of GL commands. There is one query type 
885bd8deadSopenharmony_ci    supported by the GL. Occlusion queries (see section 4.1.6) set a boolean 
895bd8deadSopenharmony_ci    to true when any fragments or samples pass the depth test.
905bd8deadSopenharmony_ci    
915bd8deadSopenharmony_ci    The results of asynchronous queries are not returned by the GL immediately
925bd8deadSopenharmony_ci    after the completion of the last command in the set; subsequent commands 
935bd8deadSopenharmony_ci    can be processed while the query results are not complete. When available,
945bd8deadSopenharmony_ci    the query results are stored in an associated query object. The commands 
955bd8deadSopenharmony_ci    described in section 6.1.6 provide mechanisms to determine when query 
965bd8deadSopenharmony_ci    results are available and return the actual results of the query. The 
975bd8deadSopenharmony_ci    name space for query objects is the unsigned integers, with zero reserved 
985bd8deadSopenharmony_ci    by the GL.
995bd8deadSopenharmony_ci    
1005bd8deadSopenharmony_ci    Each type of query supported by the GL has an active query object name. If 
1015bd8deadSopenharmony_ci    the active query object name for a query type is non-zero, the GL is 
1025bd8deadSopenharmony_ci    currently tracking the information corresponding to that query type and the
1035bd8deadSopenharmony_ci    query results will be written into the corresponding query object. If the 
1045bd8deadSopenharmony_ci    active query object for a query type name is zero, no such information is 
1055bd8deadSopenharmony_ci    being tracked.
1065bd8deadSopenharmony_ci    
1075bd8deadSopenharmony_ci    A query object is created and made active by calling 
1085bd8deadSopenharmony_ci    
1095bd8deadSopenharmony_ci        void BeginQueryEXT(enum target, uint id);
1105bd8deadSopenharmony_ci        
1115bd8deadSopenharmony_ci    <target> indicates the type of query to be performed; valid values of 
1125bd8deadSopenharmony_ci    <target> are defined in subsequent sections. If the query object name <id> 
1135bd8deadSopenharmony_ci    has not been created, the name is marked as used and associated with a new 
1145bd8deadSopenharmony_ci    query object of the type specified by <target>. Otherwise <id> must be the 
1155bd8deadSopenharmony_ci    name of an existing query object of that type.
1165bd8deadSopenharmony_ci    
1175bd8deadSopenharmony_ci    BeginQueryEXT fails and an INVALID_OPERATION error is generated if <id> 
1185bd8deadSopenharmony_ci    is not a name returned from a previous call to GenQueriesEXT, or if such 
1195bd8deadSopenharmony_ci    a name has since been deleted with DeleteQueriesEXT.
1205bd8deadSopenharmony_ci    
1215bd8deadSopenharmony_ci    BeginQueryEXT sets the active query object name for the query type given 
1225bd8deadSopenharmony_ci    by <target> to <id>. If BeginQueryEXT is called with an <id> of zero, if 
1235bd8deadSopenharmony_ci    the active query object name for <target> is non-zero (for the targets 
1245bd8deadSopenharmony_ci    ANY_SAMPLES_PASSED_EXT and ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, if the 
1255bd8deadSopenharmony_ci    active query for either target is non-zero), if <id> is the name of an 
1265bd8deadSopenharmony_ci    existing query object whose type does not match <target>, or if <id> is the
1275bd8deadSopenharmony_ci    active query object name for any query type, the error INVALID_OPERATION is
1285bd8deadSopenharmony_ci    generated.
1295bd8deadSopenharmony_ci    
1305bd8deadSopenharmony_ci    The command 
1315bd8deadSopenharmony_ci    
1325bd8deadSopenharmony_ci        void EndQueryEXT(enum target);
1335bd8deadSopenharmony_ci        
1345bd8deadSopenharmony_ci    marks the end of the sequence of commands to be tracked for the query type 
1355bd8deadSopenharmony_ci    given by <target>. The active query object for <target> is updated to 
1365bd8deadSopenharmony_ci    indicate that query results are not available, and the active query object 
1375bd8deadSopenharmony_ci    name for <target> is reset to zero. When the commands issued prior to 
1385bd8deadSopenharmony_ci    EndQueryEXT have completed and a final query result is available, the 
1395bd8deadSopenharmony_ci    query object active when EndQueryEXT is called is updated by the GL. The 
1405bd8deadSopenharmony_ci    query object is updated to indicate that the query results are available 
1415bd8deadSopenharmony_ci    and to contain the query result. If the active query object name for 
1425bd8deadSopenharmony_ci    <target> is zero when EndQueryEXT is called, the error INVALID_OPERATION 
1435bd8deadSopenharmony_ci    is generated.
1445bd8deadSopenharmony_ci    
1455bd8deadSopenharmony_ci    The command
1465bd8deadSopenharmony_ci    
1475bd8deadSopenharmony_ci        void GenQueriesEXT(sizei n, uint *ids);
1485bd8deadSopenharmony_ci        
1495bd8deadSopenharmony_ci    returns <n> previously unused query object names in <ids>. These names are 
1505bd8deadSopenharmony_ci    marked as used, for the purposes of GenQueriesEXT only, but no object is 
1515bd8deadSopenharmony_ci    associated with them until the first time they are used by BeginQueryEXT.
1525bd8deadSopenharmony_ci    
1535bd8deadSopenharmony_ci    Query objects are deleted by calling
1545bd8deadSopenharmony_ci    
1555bd8deadSopenharmony_ci        void DeleteQueriesEXT(sizei n, const uint *ids);
1565bd8deadSopenharmony_ci        
1575bd8deadSopenharmony_ci    <ids> contains <n> names of query objects to be deleted. After a query 
1585bd8deadSopenharmony_ci    object is deleted, its name is again unused. Unused names in <ids> are 
1595bd8deadSopenharmony_ci    silently ignored, as is the value zero. If an active query object is 
1605bd8deadSopenharmony_ci    deleted its name immediately becomes unused, but the underlying object is 
1615bd8deadSopenharmony_ci    not deleted until it is no longer active (see section C.1).
1625bd8deadSopenharmony_ci    
1635bd8deadSopenharmony_ci    Query objects contain two pieces of state: a single bit indicating whether 
1645bd8deadSopenharmony_ci    a query result is available, and an integer containing the query result 
1655bd8deadSopenharmony_ci    value. The number of bits used to represent the query result is 
1665bd8deadSopenharmony_ci    implementation-dependent and may vary by query object type. In the initial 
1675bd8deadSopenharmony_ci    state of a query object, the result is available and its value is zero.
1685bd8deadSopenharmony_ci    
1695bd8deadSopenharmony_ci    The necessary state for each query type is an unsigned integer holding the 
1705bd8deadSopenharmony_ci    active query object name (zero if no query object is active), and any state
1715bd8deadSopenharmony_ci    necessary to keep the current results of an asynchronous query in progress.
1725bd8deadSopenharmony_ci    Only a single type of occlusion query can be active at one time, so the 
1735bd8deadSopenharmony_ci    required state for occlusion queries is shared."
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci    None
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment
1805bd8deadSopenharmony_ciOperations and the Frame Buffer)
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci    Add a new section "Occlusion Queries" between sections 4.1.5 and
1835bd8deadSopenharmony_ci    4.1.6 and renumber subsequent sections:
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    "4.1.6  Occlusion Queries
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci    Occlusion queries use query objects to track the number of fragments or 
1885bd8deadSopenharmony_ci    samples that pass the depth test. An occlusion query can be started and 
1895bd8deadSopenharmony_ci    finished by calling BeginQueryEXT and EndQueryEXT, respectively, with a 
1905bd8deadSopenharmony_ci    target of ANY_SAMPLES_PASSED_EXT or ANY_SAMPLES_PASSED_CONSERVATIVE_EXT.
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    When an occlusion query is started with the target 
1935bd8deadSopenharmony_ci    ANY_SAMPLES_PASSED_EXT, the samples-boolean state maintained by the GL is
1945bd8deadSopenharmony_ci    set to FALSE. While that occlusion query is active, the samples-boolean 
1955bd8deadSopenharmony_ci    state is set to TRUE if any fragment or sample passes the depth test. When 
1965bd8deadSopenharmony_ci    the occlusion query finishes, the samples-boolean state of FALSE or TRUE is
1975bd8deadSopenharmony_ci    written to the corresponding query object as the query result value, and 
1985bd8deadSopenharmony_ci    the query result for that object is marked as available. If the target of 
1995bd8deadSopenharmony_ci    the query is ANY_SAMPLES_PASSED_CONSERVATIVE_EXT, an implementation may 
2005bd8deadSopenharmony_ci    choose to use a less precise version of the test which can additionally set
2015bd8deadSopenharmony_ci    the samples-boolean state to TRUE in some other implementation dependent 
2025bd8deadSopenharmony_ci    cases."
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL ES 2.0 Specification (Special Functions)
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci    None
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL ES 2.0 Specification (State and
2095bd8deadSopenharmony_ciState Requests)
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    Add a new section "Asynchronous Queries" between sections 6.1.5 and
2125bd8deadSopenharmony_ci    6.1.6 and renumber subsequent sections:
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    "6.1.6  Asynchronous Queries
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci    The command
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci      boolean IsQueryEXT(uint id);
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    returns TRUE if <id> is the name of a query object.  If <id> is zero,
2215bd8deadSopenharmony_ci    or if <id> is a non-zero value that is not the name of a query
2225bd8deadSopenharmony_ci    object, IsQueryEXT returns FALSE.
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    Information about a query target can be queried with the command
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci      void GetQueryivEXT(enum target, enum pname, int *params);
2275bd8deadSopenharmony_ci
2285bd8deadSopenharmony_ci    <target> identifies the query target, and must be one of 
2295bd8deadSopenharmony_ci    ANY_SAMPLES_PASSED_EXT or ANY_SAMPLES_PASSED_CONSERVATIVE_EXT.
2305bd8deadSopenharmony_ci    
2315bd8deadSopenharmony_ci    <pname> must be CURRENT_QUERY_EXT. The name of the currently active
2325bd8deadSopenharmony_ci    query for <target>, or zero if no query is active, will be placed in
2335bd8deadSopenharmony_ci    <params>.
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    The state of a query object can be queried with the command
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci      void GetQueryObjectuivEXT(uint id, enum pname, uint *params);
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    If <id> is not the name of a query object, or if the query object
2405bd8deadSopenharmony_ci    named by <id> is currently active, then an INVALID_OPERATION error is
2415bd8deadSopenharmony_ci    generated. <pname> must be QUERY_RESULT_EXT or QUERY_RESULT_AVAILABLE_EXT.
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci    If <pname> is QUERY_RESULT_EXT, then the query object's result value
2445bd8deadSopenharmony_ci    is returned as a single integer in <params>. If the value is so large in 
2455bd8deadSopenharmony_ci    magnitude that it cannot be represented with the requested type, then the 
2465bd8deadSopenharmony_ci    nearest value representable using the requested type is returned.
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    There may be an indeterminate delay before the above query returns. If 
2495bd8deadSopenharmony_ci    <pname> is QUERY_RESULT_AVAILABLE_EXT, FALSE is returned if such a delay 
2505bd8deadSopenharmony_ci    would be required; otherwise TRUE is returned. It must always be true that 
2515bd8deadSopenharmony_ci    if any query object returns a result available of TRUE, all queries of the 
2525bd8deadSopenharmony_ci    same type issued prior to that query must also return TRUE.
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci    Querying the state for any given query object forces that occlusion query 
2555bd8deadSopenharmony_ci    to complete within a finite amount of time. Repeatedly querying the 
2565bd8deadSopenharmony_ci    QUERY_RESULT_AVAILABLE_EXT state for any given query object is guaranteed
2575bd8deadSopenharmony_ci    to return true eventually. Note that multiple queries to the same occlusion
2585bd8deadSopenharmony_ci    object may result in a significant performance loss. For better performance
2595bd8deadSopenharmony_ci    it is recommended to wait N frames before querying this state. N is 
2605bd8deadSopenharmony_ci    implementation dependent but is generally between one and three.
2615bd8deadSopenharmony_ci    
2625bd8deadSopenharmony_ci    If multiple queries are issued using the same object name prior to calling 
2635bd8deadSopenharmony_ci    GetQueryObjectuivEXT, the result and availability information returned 
2645bd8deadSopenharmony_ci    will always be from the last query issued. The results from any queries 
2655bd8deadSopenharmony_ci    before the last one will be lost if they are not retrieved before starting 
2665bd8deadSopenharmony_ci    a new query on the same <target> and <id>."
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ciAdditions to Appendix C of the OpenGL ES 2.0 Specification (Shared Object and 
2695bd8deadSopenharmony_ciMultiple Contexts)
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci    Change the first sentence of the first paragraph of section C.1.2 to read:
2725bd8deadSopenharmony_ci    
2735bd8deadSopenharmony_ci    "When a buffer, texture, renderbuffer, or query is deleted, ..."
2745bd8deadSopenharmony_ci 
2755bd8deadSopenharmony_ci    Add the following sentence to the end of section C.1.2:
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci    "A query object is in use so long as it is the active query object for a 
2785bd8deadSopenharmony_ci    query type and index, as described in section 2.13."
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ciErrors
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if BeginQueryEXT is called
2835bd8deadSopenharmony_ci    where <id> is not a name returned from a previous call to GenQueriesEXT,
2845bd8deadSopenharmony_ci    or if such a name has since been deleted with DeleteQueriesEXT.
2855bd8deadSopenharmony_ci    
2865bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if BeginQueryEXT is called
2875bd8deadSopenharmony_ci    where <id> is zero.
2885bd8deadSopenharmony_ci    
2895bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if BeginQueryEXT is called
2905bd8deadSopenharmony_ci    where <id> is the name of an existing query object whose type does not 
2915bd8deadSopenharmony_ci    match <target>.
2925bd8deadSopenharmony_ci    
2935bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if BeginQueryEXT is called
2945bd8deadSopenharmony_ci    where <id> is the active query object name for any query type.
2955bd8deadSopenharmony_ci    
2965bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if BeginQueryEXT is called
2975bd8deadSopenharmony_ci    when the active query object name for either ANY_SAMPLES_PASSED_EXT or
2985bd8deadSopenharmony_ci    ANY_SAMPLES_PASSED_CONSERVATIVE_EXT is non-zero.
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if EndQueryEXT is called
3015bd8deadSopenharmony_ci    when the active query object name for <target> is zero.
3025bd8deadSopenharmony_ci    
3035bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if GetQueryObjectuivEXT is 
3045bd8deadSopenharmony_ci    called where <id> is not the name of a query object.
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if GetQueryObjectuivEXT is 
3075bd8deadSopenharmony_ci    called where <id> is the name of a currently active query object.
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if GenQueriesEXT is called where
3105bd8deadSopenharmony_ci    <n> is negative.
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if DeleteQueriesEXT is called
3135bd8deadSopenharmony_ci    where <n> is negative.
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if BeginQueryEXT, EndQueryEXT,
3165bd8deadSopenharmony_ci    or GetQueryivEXT is called where <target> is not
3175bd8deadSopenharmony_ci    ANY_SAMPLES_PASSED_EXT or ANY_SAMPLES_PASSED_CONSERVATIVE_EXT.
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if GetQueryivEXT is called where
3205bd8deadSopenharmony_ci    <pname> is not CURRENT_QUERY_EXT.
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if GetQueryObjectuivEXT is called 
3235bd8deadSopenharmony_ci    where <pname> is not QUERY_RESULT_EXT or QUERY_RESULT_AVAILABLE_EXT.
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ciNew State
3265bd8deadSopenharmony_ci
3275bd8deadSopenharmony_ci(table 6.18, p. 233)
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci                                                            Int'l
3305bd8deadSopenharmony_ci    Get Value                   Type  Get Command           Value  Description             Sec
3315bd8deadSopenharmony_ci    --------------------------  ----  --------------------  -----  ----------------------  -----
3325bd8deadSopenharmony_ci    -                           B     -                     FALSE  query active            4.1.6
3335bd8deadSopenharmony_ci    CURRENT_QUERY_EXT           Z+    GetQueryivEXT         0      active query ID         4.1.6
3345bd8deadSopenharmony_ci    QUERY_RESULT_EXT            B     GetQueryObjectuivEXT  FALSE  samples-passed          4.1.6
3355bd8deadSopenharmony_ci    QUERY_RESULT_AVAILABLE_EXT  B     GetQueryObjectuivEXT  FALSE  query result available  4.1.6
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ciIssues
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci    (1)  What should the enum be called?
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci        RESOLVED: The enum should be called ANY_SAMPLES_PASSED as in
3425bd8deadSopenharmony_ci        ARB_occlusion_query2 to retain compatibility between the two
3435bd8deadSopenharmony_ci        extensions.
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci    (2)  Can application-provided names be used as query object names?
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci        ARB_occlusion_query allows application-provided names, but this
3485bd8deadSopenharmony_ci        was later removed in core OpenGL.
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ci        RESOLVED: No, we will follow core OpenGL on this.
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci    (3)  Should calling GenQueries or DeleteQueries when a query is
3535bd8deadSopenharmony_ci         active produce an error?
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci        This behavior is in ARB_occlusion_query but was
3565bd8deadSopenharmony_ci        removed in OpenGL 3.0.
3575bd8deadSopenharmony_ci
3585bd8deadSopenharmony_ci        RESOLVED: Not an error.  Calling DeleteQueries marks the name
3595bd8deadSopenharmony_ci        as no longer used, but the object is not deleted until it is no 
3605bd8deadSopenharmony_ci        longer in use (i.e. no longer active).
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci    (4)  What is the interaction with multisample?
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ci        RESOLVED: The query result is set to true if at least one
3655bd8deadSopenharmony_ci        sample passes the depth test.
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci    (5)  Exactly what stage in the pipeline are we counting samples at?
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci        RESOLVED: We are counting immediately after _both_ the depth and
3705bd8deadSopenharmony_ci        stencil tests, i.e., samples that pass both.  Note that the depth
3715bd8deadSopenharmony_ci        test comes after the stencil test, so to say that it is the
3725bd8deadSopenharmony_ci        number that pass the depth test is sufficient; though it is often
3735bd8deadSopenharmony_ci        conceptually helpful to think of the depth and stencil tests as
3745bd8deadSopenharmony_ci        being combined, because the depth test's result impacts the
3755bd8deadSopenharmony_ci        stencil operation used.
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    (6)  Is it guaranteed that occlusion queries return in order?
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci        RESOLVED: Yes.
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci        If occlusion test X occurred before occlusion query Y, and the driver 
3825bd8deadSopenharmony_ci        informs the app that occlusion query Y is done, the app can infer that 
3835bd8deadSopenharmony_ci        occlusion query X is also done.
3845bd8deadSopenharmony_ci
3855bd8deadSopenharmony_ci    (7) Will polling a query for QUERY_RESULT_AVAILABLE without a Flush
3865bd8deadSopenharmony_ci        possibly cause an infinite loop?
3875bd8deadSopenharmony_ci
3885bd8deadSopenharmony_ci        RESOLVED: No.
3895bd8deadSopenharmony_ci
3905bd8deadSopenharmony_ci    (8) Should there be a "target" parameter to BeginQuery?
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci        RESOLVED: Yes.  This distinguishes the boolean queries
3935bd8deadSopenharmony_ci        defined by this extension (and ARB_occlusion_query2) from
3945bd8deadSopenharmony_ci        the counter queries defined by ARB_occlusion_query.
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci    (9) Are query objects shareable between multiple contexts?
3975bd8deadSopenharmony_ci
3985bd8deadSopenharmony_ci        RESOLVED: No.  Query objects are lightweight and we normally share 
3995bd8deadSopenharmony_ci        large data across contexts.  Also, being able to share query objects
4005bd8deadSopenharmony_ci        across contexts is not particularly useful.  In order to do the async 
4015bd8deadSopenharmony_ci        query across contexts, a query on one context would have to be finished 
4025bd8deadSopenharmony_ci        before the other context could query it.  
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci    (10) Should there be a limit on how many queries can be outstanding?
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ci        RESOLVED: No. If an implementation has an internal limit, it can
4075bd8deadSopenharmony_ci        flush the pipeline when it runs out.
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    (11) Can an implementation sometimes return a conservative result,
4105bd8deadSopenharmony_ci         i.e. return true even though no samples were drawn?
4115bd8deadSopenharmony_ci
4125bd8deadSopenharmony_ci        RESOLVED: Yes, but only when explicitly enabled by the
4135bd8deadSopenharmony_ci        application.
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci        Allowing such results with no restrictions effectively makes
4165bd8deadSopenharmony_ci        the functionality of the extension optional, which decreases
4175bd8deadSopenharmony_ci        its value. Precise restrictions are presumably hard to
4185bd8deadSopenharmony_ci        specify.
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci        One situation where this restriction could be relevant is if
4215bd8deadSopenharmony_ci        an implementation performs a conservative early depth test at
4225bd8deadSopenharmony_ci        a lower precision and wants to base the occlusion query result
4235bd8deadSopenharmony_ci        on that whenever the early depth test can be used.
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci    (12) Should the restrictions in issue 11 be explicitly enabled
4265bd8deadSopenharmony_ci         by the application in order to be in effect?
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci        RESOLVED: Yes.
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ci        The restrictions could be enabled by a hint call or by using
4315bd8deadSopenharmony_ci        a different enum in the BeginQuery call.
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci        This would enable the application to choose whether it wants a
4345bd8deadSopenharmony_ci        precise (but possibly slow) version or an approximate (but
4355bd8deadSopenharmony_ci        possibly faster) version.
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ci    (13) Can the restrictions in issue 18 be applied nondeterministically?
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci        An implementation might benefit from taking the decision of
4405bd8deadSopenharmony_ci        whether to apply a particular restriction on a case by case
4415bd8deadSopenharmony_ci        basis. Some of these decisions could depend on
4425bd8deadSopenharmony_ci        nondeterministic effects such as memory bus timing.
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci        RESOLVED: No. This would violate the GL repeatability
4455bd8deadSopenharmony_ci        principle.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    (14) How does an application request that the result is allowed to
4485bd8deadSopenharmony_ci         be conservative (as defined in issue 11)?
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci        RESOLVED: It is specified as a separate query target,
4515bd8deadSopenharmony_ci        ANY_SAMPLES_PASSED_CONSERVATIVE.
4525bd8deadSopenharmony_ci
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ciRevision History
4555bd8deadSopenharmony_ci
4565bd8deadSopenharmony_ci   Date: 5/03/2011
4575bd8deadSopenharmony_ci   Revision: 1 (Benj Lipchak)
4585bd8deadSopenharmony_ci      - Initial draft based on XXX_occlusion_query_boolean
4595bd8deadSopenharmony_ci
4605bd8deadSopenharmony_ci   Date: 7/22/2011
4615bd8deadSopenharmony_ci   Revision: 2 (Benj Lipchak)
4625bd8deadSopenharmony_ci      - Rename from APPLE to EXT
463