15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    AMD_query_buffer_object
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_AMD_query_buffer_object
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Daniel Rakos (daniel.rakos 'at' amd.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Daniel Rakos, AMD
165bd8deadSopenharmony_ci    Graham Sellers, AMD
175bd8deadSopenharmony_ci    Christophe Riccio, AMD
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciStatus
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Shipping in Catalyst 12.6
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ciVersion
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    Last Modified Date:         03/07/2016
265bd8deadSopenharmony_ci    Author Revision:            6
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciNumber
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    420
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciDependencies
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    OpenGL 1.5 is required.
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.2 (core) specification.
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ciOverview
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    Statistics about the operation of the OpenGL pipeline, such as the number
415bd8deadSopenharmony_ci    of samples that passed the depth test, the elapsed time between two events
425bd8deadSopenharmony_ci    or the number of vertices written to a transform feedback buffer may
435bd8deadSopenharmony_ci    be retrieved from the GL through query objects. The current value of a
445bd8deadSopenharmony_ci    query object may be retrieved by the application through the OpenGL API.
455bd8deadSopenharmony_ci    Should the result returned by the API be required for use in a shader,
465bd8deadSopenharmony_ci    it must be passed back to the GL via a program uniform or some other
475bd8deadSopenharmony_ci    mechanism. This requires a round-trip from the GPU to the CPU and back.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    This extension introduces a mechanism whereby the current value of a query
505bd8deadSopenharmony_ci    result may be retrieved into a buffer object instead of client memory.
515bd8deadSopenharmony_ci    This allows the query result to be made available to a shader without a
525bd8deadSopenharmony_ci    round-trip to the CPU for example by subsequently using the buffer object
535bd8deadSopenharmony_ci    as a uniform buffer, texture buffer or other data store visible to the
545bd8deadSopenharmony_ci    shader. This functionality may also be used to place the results of
555bd8deadSopenharmony_ci    many query objects into a single, large buffer and then map or otherwise
565bd8deadSopenharmony_ci    read back the entire buffer at a later point in time, avoiding a per-query
575bd8deadSopenharmony_ci    CPU-GPU synchronization event.
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    The result of any query object type supported by the GL implementation
605bd8deadSopenharmony_ci    may be retrieved into a buffer object. The implementation will determine
615bd8deadSopenharmony_ci    the most efficient method of copying the query result to the buffer.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciNew Procedures and Functions
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    None.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Tokens
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetQueryObjectiv, GetQueryObjectuiv,
705bd8deadSopenharmony_ci    GetQueryObjecti64v and GetQueryObjectui64v:
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ci        QUERY_RESULT_NO_WAIT_AMD                        0x9194
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    Accepted by the <target> parameters of BindBuffer, BufferData,
755bd8deadSopenharmony_ci    BufferSubData, MapBuffer, UnmapBuffer, MapBufferRange, GetBufferSubData,
765bd8deadSopenharmony_ci    GetBufferParameteriv
775bd8deadSopenharmony_ci    and GetBufferPointerv:
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci        QUERY_BUFFER_AMD                                0x9192
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
825bd8deadSopenharmony_ci    and GetDoublev:
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci        QUERY_BUFFER_BINDING_AMD                        0x9193
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.2 (core) Specification (OpenGL Operation)
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    Modify Section 2.9, Buffer Objects
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci    Add to Table 2.8: Buffer object binding targets (p. 43)
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ci    +---------------------+--------------------------+-------------------------+
935bd8deadSopenharmony_ci    | Target name         | Purpose                  | Described in section(s) |
945bd8deadSopenharmony_ci    +---------------------+--------------------------+-------------------------+
955bd8deadSopenharmony_ci    | QUERY_BUFFER_AMD    | Query result buffer      | 6.1.7                   |
965bd8deadSopenharmony_ci    +---------------------+--------------------------+-------------------------+
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 3.2 (core) Specification (Rasterization)
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    None.
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 3.2 (core) Specification (Per-Fragment Operations and the Frame Buffer)
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    None.
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 3.2 (core) Specification (Special Functions)
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    None.
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 3.2 (core) Specification (State and State Requests)
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci  Modify Section 6.1.7, Asynchronous Queries
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ci  Add new paragraph before the third paragraph on p. 358
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci        Initially, zero is bound for the QUERY_BUFFER_AMD, indicating that
1175bd8deadSopenharmony_ci    <params> is a pointer into client memory. However, if a non-zero buffer
1185bd8deadSopenharmony_ci    object is bound as the current query result buffer, then <params> is
1195bd8deadSopenharmony_ci    treated as an offset into the designated buffer object.
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci  Replace last sentence of the third paragraph on p. 358
1225bd8deadSopenharmony_ci  beginning with "The state of a query object can be queried with ..."
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    pname must be QUERY_RESULT, QUERY_RESULT_NO_WAIT_AMD
1255bd8deadSopenharmony_ci    or QUERY_RESULT_AVAILABLE.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci  Add new paragraph before the last paragraph on p. 358
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci        If <pname> is QUERY_RESULT_NO_WAIT_AMD, then the query object's
1305bd8deadSopenharmony_ci    result value is returned as a single integer in <params> if the result
1315bd8deadSopenharmony_ci    is available at the time of the state query. If the result is not
1325bd8deadSopenharmony_ci    available then the destination memory location is not overwritten.
1335bd8deadSopenharmony_ci
1345bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    None.
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ciGLX Protocol
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    None.
1415bd8deadSopenharmony_ci
1425bd8deadSopenharmony_ciErrors
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    INVALID_OPERATION is generated by GetQueryObjectiv, GetQueryObjectuiv,
1455bd8deadSopenharmony_ci    GetQueryObjecti64v, or GetQueryObjectui64v if the command would cause data
1465bd8deadSopenharmony_ci    to be written beyond the bounds of the buffer currently currently bound
1475bd8deadSopenharmony_ci    to the QUERY_BUFFER_AMD target.
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ciNew State
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci    Append to Table 6.41, "Query Object State"
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    +----------------------------+-------+-------------------+---------------+-------------------------------------------+-------+
1545bd8deadSopenharmony_ci    | Get Value                  | Type  | Get Command       | Initial Value | Description                               | Sec.  |
1555bd8deadSopenharmony_ci    +----------------------------+-------+-------------------+---------------+-------------------------------------------+-------+
1565bd8deadSopenharmony_ci    | QUERY_BUFFER_BINDING_AMD   | Z+    | GetIntegeriv      | 0             | Query result buffer binding.              | 6.1.7 |
1575bd8deadSopenharmony_ci    +----------------------------+-------+-------------------+---------------+-------------------------------------------+-------+
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ciNew Implementation Dependent State
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    None.
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ciUsage Examples
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci    Convenient macro definition for specifying buffer offsets:
1665bd8deadSopenharmony_ci
1675bd8deadSopenharmony_ci        #define BUFFER_OFFSET(i)    ((void*)NULL + (i))
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    Example 1: Using occlusion query result in shader
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci        // Create a buffer object for the query result
1725bd8deadSopenharmony_ci        glGenBuffers(1, &queryBuffer);
1735bd8deadSopenharmony_ci        glBindBuffer(GL_QUERY_BUFFER_AMD, queryBuffer);
1745bd8deadSopenharmony_ci        glBufferData(GL_QUERY_BUFFER_AMD, sizeof(GLuint),
1755bd8deadSopenharmony_ci                     NULL, GL_DYNAMIC_COPY);
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci        // Perform occlusion query
1785bd8deadSopenharmony_ci        glBeginQuery(GL_SAMPLES_PASSED, queryId)
1795bd8deadSopenharmony_ci        ...
1805bd8deadSopenharmony_ci        glEndQuery(GL_SAMPLES_PASSED);
1815bd8deadSopenharmony_ci
1825bd8deadSopenharmony_ci        // Get query results to buffer object
1835bd8deadSopenharmony_ci        glBindBuffer(GL_QUERY_BUFFER_AMD, queryBuffer);
1845bd8deadSopenharmony_ci        glGetQueryObjectuiv(queryId, GL_QUERY_RESULT, BUFFER_OFFSET(0));
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci        // Bind query result buffer as uniform buffer
1875bd8deadSopenharmony_ci        glBindBufferBase(GL_UNIFORM_BUFFER, 0, queryBuffer);
1885bd8deadSopenharmony_ci        ...
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci        --- Shader ---
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci        ...
1935bd8deadSopenharmony_ci        uniform queryResult {
1945bd8deadSopenharmony_ci            uint samplesPassed;
1955bd8deadSopenharmony_ci        };
1965bd8deadSopenharmony_ci        ...
1975bd8deadSopenharmony_ci        void main() {
1985bd8deadSopenharmony_ci            ...
1995bd8deadSopenharmony_ci            if (samplesPassed > threshold) {
2005bd8deadSopenharmony_ci                // complex processing
2015bd8deadSopenharmony_ci                ...
2025bd8deadSopenharmony_ci            } else {
2035bd8deadSopenharmony_ci                // simplified processing
2045bd8deadSopenharmony_ci                ...
2055bd8deadSopenharmony_ci            }
2065bd8deadSopenharmony_ci            ...
2075bd8deadSopenharmony_ci        }
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    Example 2: Using occlusion query result in shader only if result is available
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci        // Create a buffer object for the query result
2125bd8deadSopenharmony_ci        glGenBuffers(1, &queryBuffer);
2135bd8deadSopenharmony_ci        glBindBuffer(GL_QUERY_BUFFER_AMD, queryBuffer);
2145bd8deadSopenharmony_ci        glBufferData(GL_QUERY_BUFFER_AMD, 2 * sizeof(GLuint),
2155bd8deadSopenharmony_ci                     NULL, GL_DYNAMIC_COPY);
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci        // Perform occlusion query
2185bd8deadSopenharmony_ci        glBeginQuery(GL_SAMPLES_PASSED, queryId)
2195bd8deadSopenharmony_ci        ...
2205bd8deadSopenharmony_ci        glEndQuery(GL_SAMPLES_PASSED);
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci        // Get query availability and result (if available) to buffer object
2235bd8deadSopenharmony_ci        glBindBuffer(GL_QUERY_BUFFER_AMD, queryBuffer);
2245bd8deadSopenharmony_ci        glGetQueryObjectuiv(queryId, GL_QUERY_RESULT_AVAILABLE, BUFFER_OFFSET(0));
2255bd8deadSopenharmony_ci        glGetQueryObjectuiv(queryId, GL_QUERY_RESULT_NO_WAIT_AMD, BUFFER_OFFSET(4));
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci        // Bind query result buffer as uniform buffer
2285bd8deadSopenharmony_ci        glBindBufferBase(GL_UNIFORM_BUFFER, 0, queryBuffer);
2295bd8deadSopenharmony_ci        ...
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci        --- Shader ---
2325bd8deadSopenharmony_ci        
2335bd8deadSopenharmony_ci        ...
2345bd8deadSopenharmony_ci        uniform queryResult {
2355bd8deadSopenharmony_ci            uint resultAvailable;
2365bd8deadSopenharmony_ci            uint samplesPassed;
2375bd8deadSopenharmony_ci        };
2385bd8deadSopenharmony_ci        ...
2395bd8deadSopenharmony_ci        void main() {
2405bd8deadSopenharmony_ci            ...
2415bd8deadSopenharmony_ci            if (resultAvailable) {
2425bd8deadSopenharmony_ci                if (samplesPassed > threshold) {
2435bd8deadSopenharmony_ci                    // complex processing
2445bd8deadSopenharmony_ci                    ...
2455bd8deadSopenharmony_ci                } else {
2465bd8deadSopenharmony_ci                    // simplified processing
2475bd8deadSopenharmony_ci                    ...
2485bd8deadSopenharmony_ci                }
2495bd8deadSopenharmony_ci            } else {
2505bd8deadSopenharmony_ci                // default processing if no query result is available
2515bd8deadSopenharmony_ci                ...
2525bd8deadSopenharmony_ci            }
2535bd8deadSopenharmony_ci            ...
2545bd8deadSopenharmony_ci        }
2555bd8deadSopenharmony_ci        
2565bd8deadSopenharmony_ci    Example 3: Using a default value and QUERY_RESULT_NO_WAIT_AMD
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci        // Create a buffer object for the query result        
2595bd8deadSopenharmony_ci        // Store a default value in the buffer that will be used
2605bd8deadSopenharmony_ci        // if the query results are not available
2615bd8deadSopenharmony_ci        glGenBuffers(1, &queryBuffer);
2625bd8deadSopenharmony_ci        glBindBuffer(GL_QUERY_BUFFER_AMD, queryBuffer);
2635bd8deadSopenharmony_ci        GLuint defaultValue = 42;
2645bd8deadSopenharmony_ci        glBufferData(GL_QUERY_BUFFER_AMD, sizeof(GLuint),
2655bd8deadSopenharmony_ci                     &defaultValue, GL_DYNAMIC_COPY);
2665bd8deadSopenharmony_ci        
2675bd8deadSopenharmony_ci        // Perform occlusion query
2685bd8deadSopenharmony_ci        glBeginQuery(GL_SAMPLES_PASSED, queryId)
2695bd8deadSopenharmony_ci        ...
2705bd8deadSopenharmony_ci        glEndQuery(GL_SAMPLES_PASSED);
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci        // Get query results to buffer object with no wait
2735bd8deadSopenharmony_ci        // Default value remains untouched if results are not available
2745bd8deadSopenharmony_ci        glBindBuffer(GL_QUERY_BUFFER_AMD, queryBuffer);
2755bd8deadSopenharmony_ci        glGetQueryObjectuiv(queryId, GL_QUERY_RESULT_NO_WAIT_AMD, BUFFER_OFFSET(0));
2765bd8deadSopenharmony_ci        ...
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    Example 4: Using transform feedback query result to fill indirect draw buffer
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci        // Create a buffer object for the indirect draw command        
2815bd8deadSopenharmony_ci        glGenBuffers(1, &drawIndirectBuffer);
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci        // Initialize draw command
2845bd8deadSopenharmony_ci        DrawArraysIndirectCommand cmd = { ... };
2855bd8deadSopenharmony_ci        glBindBuffer(GL_DRAW_INDIRECT_BUFFER, drawIndirectBuffer);
2865bd8deadSopenharmony_ci        glBufferData(GL_DRAW_INDIRECT_BUFFER, sizeof(DrawArraysIndirectCommand),
2875bd8deadSopenharmony_ci                     &cmd, GL_DYNAMIC_COPY);
2885bd8deadSopenharmony_ci        
2895bd8deadSopenharmony_ci        // Perform transform feedback query
2905bd8deadSopenharmony_ci        glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, queryId)
2915bd8deadSopenharmony_ci        ...
2925bd8deadSopenharmony_ci        glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci        // Write query result to the primCount field of the indirect draw command
2955bd8deadSopenharmony_ci        glBindBuffer(GL_QUERY_BUFFER_AMD, drawIndirectBuffer);
2965bd8deadSopenharmony_ci        glGetQueryObjectuiv(queryId, GL_QUERY_RESULT,
2975bd8deadSopenharmony_ci                            BUFFER_OFFSET(offsetof(DrawArraysIndirectCommand, primCount)));
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci        // Execute the indirect draw command
3005bd8deadSopenharmony_ci        glDrawArraysIndirect(GL_TRIANGLES, BUFFER_OFFSET(0));
3015bd8deadSopenharmony_ci        ...
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ciIssues
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    1) What is QUERY_RESULT_NO_WAIT_AMD useful for?
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ci    RESOLVED: The application may decide that it does not want to wait for the
3085bd8deadSopenharmony_ci    result of the query object if it's not available at the time. This is not
3095bd8deadSopenharmony_ci    a problem without this extension as the application can always query the
3105bd8deadSopenharmony_ci    availability using QUERY_RESULT_AVAILABLE and decide to actually get the
3115bd8deadSopenharmony_ci    results using QUERY_RESULT only if the result is available. However, when
3125bd8deadSopenharmony_ci    using query buffers, QUERY_RESULT_AVAILABLE and QUERY_RESULT alone cannot
3135bd8deadSopenharmony_ci    provide the same flexibility for shader based decision making as the
3145bd8deadSopenharmony_ci    results are either always available (if QUERY_RESULT was used) or never.
3155bd8deadSopenharmony_ci    QUERY_RESULT_NO_WAIT_AMD provides a way to query the result only if it's
3165bd8deadSopenharmony_ci    available. Combined with QUERY_RESULT_AVAILABLE, the shader can decide
3175bd8deadSopenharmony_ci    to use the result or not based on the availability (see usage example 2).
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci    2) Should QUERY_RESULT_NO_WAIT_AMD be accepted by GetQueryObjectiv,
3205bd8deadSopenharmony_ci    GetQueryObjectuiv, GetQueryObjecti64v and GetQueryObjectui64v in case
3215bd8deadSopenharmony_ci    there is no buffer bound to QUERY_BUFFER_AMD?
3225bd8deadSopenharmony_ci
3235bd8deadSopenharmony_ci    RESOLVED: YES, for completeness.
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci    3) Is there any guarantee that GetQueryObject* will not wait for the
3265bd8deadSopenharmony_ci    query results to become available if <pname> is QUERY_RESULT_NO_WAIT_AMD?
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci    RESOLVED: There is no need to have such guarantee. An implementation may
3295bd8deadSopenharmony_ci    choose to wait for the results even in case of QUERY_RESULT_NO_WAIT_AMD,
3305bd8deadSopenharmony_ci    however, that may incur a potential performance hit in case the application
3315bd8deadSopenharmony_ci    expects it to not wait.
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ci    4) Should the INVALID_OPERATION error be generated if a GetQueryObject*
3345bd8deadSopenharmony_ci    command would access data outside the rage of the bound query buffer?
3355bd8deadSopenharmony_ci
3365bd8deadSopenharmony_ci    RESOLVED: YES. This requires considering the value of <params> and the
3375bd8deadSopenharmony_ci    size of the type of the written value to determine the maximum addressed
3385bd8deadSopenharmony_ci    byte for the state query command.
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ci    Note: This follows the precedence of the language introduced by
3415bd8deadSopenharmony_ci    ARB_pixel_buffer_object.
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci    5) Should we support 64 bit versions of the state query commands
3445bd8deadSopenharmony_ci    (GetQueryObjecti64v and GetQueryObjectui64v)?
3455bd8deadSopenharmony_ci
3465bd8deadSopenharmony_ci    RESOLVED: YES, both for completeness and to support timer queries. In this
3475bd8deadSopenharmony_ci    case a 64 bit integer value is written to the buffer.
3485bd8deadSopenharmony_ci
3495bd8deadSopenharmony_ci    6) Should the extension support all query types supported by the current
3505bd8deadSopenharmony_ci    GL implementation?
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci    RESOLVED: YES. There is not much value in providing additional capability
3535bd8deadSopenharmony_ci    queries that would allow the application to find out which query object
3545bd8deadSopenharmony_ci    types are supported. Also, the GL implementation can always choose to
3555bd8deadSopenharmony_ci    implement the functionality in software for query types that cannot be
3565bd8deadSopenharmony_ci    supported in hardware.
3575bd8deadSopenharmony_ci
3585bd8deadSopenharmony_ci    7) Is there any precedence that the pointer parameter of a glGet* command
3595bd8deadSopenharmony_ci    is treated as an offset into a bound buffer object?
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    RESOLVED: YES, glGetTexImage accepts an offset into the pixel pack buffer
3625bd8deadSopenharmony_ci    in case a pixel pack buffer is bound. As pixel buffer objects are part of
3635bd8deadSopenharmony_ci    the core specification since version 2.1, no precedence is introduced by
3645bd8deadSopenharmony_ci    this extension.
3655bd8deadSopenharmony_ci    
3665bd8deadSopenharmony_ci    8) What should be written to the query buffer when QUERY_RESULT_NO_WAIT_AMD
3675bd8deadSopenharmony_ci    is used but the results are not available?
3685bd8deadSopenharmony_ci    
3695bd8deadSopenharmony_ci    DISCUSSION: Leaving the written value undefined is an option, however
3705bd8deadSopenharmony_ci    in many cases the application can benefit from having a default value in
3715bd8deadSopenharmony_ci    the query buffer if the results are not available. The following options
3725bd8deadSopenharmony_ci    were considered to support such use cases:
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci        a. Write a predefined fixed value to the buffer.
3755bd8deadSopenharmony_ci        b. Write a user specified value to the buffer.
3765bd8deadSopenharmony_ci        c. Don't write anything to the buffer, leave the current value
3775bd8deadSopenharmony_ci           untouched.
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci    The problem with option a. is that it may be difficult to select such
3805bd8deadSopenharmony_ci    a predefined value that would not potentially conflict with a valid
3815bd8deadSopenharmony_ci    value. Option b. could be fine, however it requires new API to specify
3825bd8deadSopenharmony_ci    this default value. Thus, option c. is considered to most preferable.
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci    RESOLVED: Nothing, the current value in the specified offset of the
3855bd8deadSopenharmony_ci    query buffer is leaved untouched.
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci
3885bd8deadSopenharmony_ciRevision History
3895bd8deadSopenharmony_ci
3905bd8deadSopenharmony_ci    Rev.    Date      Author    Changes
3915bd8deadSopenharmony_ci    ----  --------    --------  ---------------------------------------------
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ci      6   03/07/2016  drakos    Fixed typo in example #4
3945bd8deadSopenharmony_ci      5   06/01/2012  gsellers  Minor cleanup. Shipped and ready for posting.
3955bd8deadSopenharmony_ci      4   03/21/2012  drakos    Removed undefined behavior when using
3965bd8deadSopenharmony_ci                                QUERY_RESULT_NO_WAIT and added issue #8
3975bd8deadSopenharmony_ci                                based on Graham's comments
3985bd8deadSopenharmony_ci      3   03/12/2012  drakos    Assigned enums
3995bd8deadSopenharmony_ci      2   03/07/2012  drakos    Clarified issues #4 and #5
4005bd8deadSopenharmony_ci                                Added issue #7 based on Christophe's comments
4015bd8deadSopenharmony_ci      1   02/28/2012  drakos    Initial revision
402