15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_occlusion_query
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_occlusion_query
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Matt Craighead, NVIDIA Corporation (mcraighead 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNotice
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Copyright NVIDIA Corporation, 2001, 2002.
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciIP Status
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    NVIDIA Proprietary.
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciStatus
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Shipping (version 1.0)
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciVersion
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    NVIDIA Date: February 6, 2002 (version 1.0)
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ciNumber
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci    261
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciDependencies
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Written based on the wording of the OpenGL 1.3 specification.
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    Requires support for the HP_occlusion_test extension.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciOverview
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    The HP_occlusion_test extension defines a mechanism whereby an
425bd8deadSopenharmony_ci    application can query the visibility of an object, where "visible"
435bd8deadSopenharmony_ci    means that at least one pixel passes the depth and stencil tests.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    The HP extension has two major shortcomings.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    - It returns the result as a simple GL_TRUE/GL_FALSE result, when in
485bd8deadSopenharmony_ci      fact it is often useful to know exactly how many pixels passed.
495bd8deadSopenharmony_ci    - It provides only a simple "stop-and-wait" model for using multiple
505bd8deadSopenharmony_ci      queries.  The application begins an occlusion test and ends it;
515bd8deadSopenharmony_ci      then, at some later point, it asks for the result, at which point
525bd8deadSopenharmony_ci      the driver must stop and wait until the result from the previous
535bd8deadSopenharmony_ci      test is back before the application can even begin the next one.
545bd8deadSopenharmony_ci      This is a very simple model, but its performance is mediocre when
555bd8deadSopenharmony_ci      an application wishes to perform many queries, and it eliminates
565bd8deadSopenharmony_ci      most of the opportunites for parallelism between the CPU and GPU.
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci    This extension solves both of those problems.  It returns as its
595bd8deadSopenharmony_ci    result the number of pixels that pass, and it provides an interface
605bd8deadSopenharmony_ci    conceptually similar to that of NV_fence that allows applications to
615bd8deadSopenharmony_ci    issue many occlusion queries before asking for the result of any one.
625bd8deadSopenharmony_ci    As a result, they can overlap the time it takes for the occlusion
635bd8deadSopenharmony_ci    query results to be returned with other, more useful work, such as
645bd8deadSopenharmony_ci    rendering other parts of the scene or performing other computations
655bd8deadSopenharmony_ci    on the CPU.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    There are many situations where a pixel count, rather than a boolean
685bd8deadSopenharmony_ci    result, is useful.
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    - If the visibility test is an object bounding box being used to
715bd8deadSopenharmony_ci      decide whether to skip the object, sometimes it can be acceptable,
725bd8deadSopenharmony_ci      and beneficial to performance, to skip an object if less than some
735bd8deadSopenharmony_ci      threshold number of pixels could be visible.
745bd8deadSopenharmony_ci    - Knowing the number of pixels visible in the bounding box may also
755bd8deadSopenharmony_ci      help decide what level of detail a model should be drawn with.  If
765bd8deadSopenharmony_ci      only a few pixels are visible, a low-detail model may be
775bd8deadSopenharmony_ci      acceptable.  In general, this allows level-of-detail mechanisms to
785bd8deadSopenharmony_ci      be slightly less ad hoc.
795bd8deadSopenharmony_ci    - "Depth peeling" techniques, such as order-independent transparency,
805bd8deadSopenharmony_ci      would typically like to know when to stop rendering more layers; it
815bd8deadSopenharmony_ci      is difficult to come up with a way to determine a priori how many
825bd8deadSopenharmony_ci      layers to use.  A boolean count allows applications to stop when
835bd8deadSopenharmony_ci      more layers will not affect the image at all, but this will likely
845bd8deadSopenharmony_ci      be unacceptable for performance, with minimal gains to image
855bd8deadSopenharmony_ci      quality.  Instead, it makes more sense to stop rendering when the
865bd8deadSopenharmony_ci      number of pixels goes below a threshold; this should provide better
875bd8deadSopenharmony_ci      results than any of these other algorithms.
885bd8deadSopenharmony_ci    - Occlusion queries can be used as a replacement for glReadPixels of
895bd8deadSopenharmony_ci      the depth buffer to determine whether, say, a light source is
905bd8deadSopenharmony_ci      visible for the purposes of a lens flare effect or a halo to
915bd8deadSopenharmony_ci      simulate glare.  Pixel counts allow you to compute the percentage
925bd8deadSopenharmony_ci      of the light source that is visible, and the brightness of these
935bd8deadSopenharmony_ci      effects can be modulated accordingly.
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ciIssues
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci    *   Should we use an object-based interface?
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci        RESOLVED: Yes, this makes the interface much simpler, and it is
1005bd8deadSopenharmony_ci        friendly for indirect rendering.
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    *   Should we offer an entry point analogous to glTestFenceNV?
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci        RESOLVED: No, it is sufficient to have glGetOcclusionQueryivNV
1055bd8deadSopenharmony_ci        provide a query for whether the occlusion query result is back
1065bd8deadSopenharmony_ci        yet.  Whereas it is interesting to poll fence objects, it is
1075bd8deadSopenharmony_ci        relatively less interesting to poll occlusion queries.
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci    *   Is glGetOcclusionQueryuivNV necessary?
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci        RESOLVED: Yes, it makes using a 32-bit pixel count less painful.
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    *   Should there be a limit on how many queries can be outstanding?
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci        RESOLVED: No.  This would make the extension much more
1165bd8deadSopenharmony_ci        difficult to spec and use.  Allowing this does not add any
1175bd8deadSopenharmony_ci        significant implementation burden; and even if drivers have some
1185bd8deadSopenharmony_ci        internal limit on the number of outstanding queries, it is not
1195bd8deadSopenharmony_ci        expected that applications will need to know this to achieve
1205bd8deadSopenharmony_ci        optimal or near-optimal performance.
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci    *   What happens if glBeginOcclusionQueryNV is called when an
1235bd8deadSopenharmony_ci        occlusion query is already outstanding for a different object?
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci        RESOLVED: This is a GL_INVALID_OPERATION error.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    *   What happens if HP_occlusion_test and NV_occlusion_query usage is
1285bd8deadSopenharmony_ci        overlapped?
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci        RESOLVED: The two can be overlapped safely.  Counting is enabled
1315bd8deadSopenharmony_ci        if we are _either_ inside a glBeginOcclusionQueryNV or if
1325bd8deadSopenharmony_ci        if GL_OCCLUSION_TEST_HP is enabled.  The alternative (producing
1335bd8deadSopenharmony_ci        an error) does not work -- it would require that glPopAttrib be
1345bd8deadSopenharmony_ci        capable of producing an error, which would be rather problematic.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci        Note that glBeginOcclusionQueryNV, not glEndOcclusionQueryNV,
1375bd8deadSopenharmony_ci        resets the pixel counter and occlusion test result.  This can
1385bd8deadSopenharmony_ci        avoid certain types of strange behavior where an occlusion
1395bd8deadSopenharmony_ci        query's pixel count does not always correspond to the pixels
1405bd8deadSopenharmony_ci        rendered during the occlusion query.  The spec would make sense
1415bd8deadSopenharmony_ci        the other way, but the behavior would be strange.
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    *   Does EndOcclusionQuery need to take any parameters?
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci        RESOLVED: No.  Giving it, for example, an "id" parameter would
1465bd8deadSopenharmony_ci        be redundant -- adding complexity for no benefit.  Only one query
1475bd8deadSopenharmony_ci        can be active at a time.
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    *   How many bits should we require the pixel counter to be, at
1505bd8deadSopenharmony_ci        minimum?
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci        RESOLVED: 24.  24 is enough to handle 8.7 full overdraws of a
1535bd8deadSopenharmony_ci        1600x1200 window.  That seems quite sufficient.
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    *   What should we do about overflows?
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ci        RESOLVED: Overflows leave the pixel count undefined.  Saturating
1585bd8deadSopenharmony_ci        is recommended but not required.
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci        The ideal behavior really is to saturate.  This ensures that you
1615bd8deadSopenharmony_ci        always get a "large" result when you render many pixels.  It also
1625bd8deadSopenharmony_ci        ensures that apps which want a boolean test can do one on their
1635bd8deadSopenharmony_ci        own, and not worry about the rare case where the result ends up
1645bd8deadSopenharmony_ci        exactly at zero from wrapping.
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci        That being said, with 24 bits of pixel count required, it's not
1675bd8deadSopenharmony_ci        clear that this really matters.  It's better to be a bit
1685bd8deadSopenharmony_ci        permissive here.  In addition, even if saturation was required,
1695bd8deadSopenharmony_ci        the goal of having strictly defined behavior is still not really
1705bd8deadSopenharmony_ci        met.
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci        Applications don't (or at least shouldn't) check for some _exact_
1735bd8deadSopenharmony_ci        number of bits.  Imagine if a multitextured app had been written
1745bd8deadSopenharmony_ci        that required that the number of texture units supported be
1755bd8deadSopenharmony_ci        _exactly_ two!  Implementors of OpenGL would be greatly annoyed
1765bd8deadSopenharmony_ci        to find that the app did not run on, say, three-texture or four-
1775bd8deadSopenharmony_ci        texture hardware.
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci        So, we expect apps here to always be doing a "greater than or
1805bd8deadSopenharmony_ci        equal to" check.  An app might check for, say, at least 28 bits.
1815bd8deadSopenharmony_ci        This doesn't ensure defined behavior -- it only ensures that once
1825bd8deadSopenharmony_ci        an overflow occurs (which may happen at any power of two), that
1835bd8deadSopenharmony_ci        overflow will be handled with saturation.  This behavior still
1845bd8deadSopenharmony_ci        remains sufficiently unpredictable that the reasons for defining
1855bd8deadSopenharmony_ci        behavior in even rarely-used cases (preventing compatibility
1865bd8deadSopenharmony_ci        problems, for example) are unsatisfied.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci        All that having been said, saturation is still explicitly
1895bd8deadSopenharmony_ci        recommended in the spec language.
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    *   What is the interaction with multisample, which was not defined
1925bd8deadSopenharmony_ci        in the original spec?
1935bd8deadSopenharmony_ci
1945bd8deadSopenharmony_ci        RESOLVED: The pixel count is the number of samples that pass, not
1955bd8deadSopenharmony_ci        the number of pixels.  This is true even if GL_MULTISAMPLE is
1965bd8deadSopenharmony_ci        disabled but GL_SAMPLE_BUFFERS is 1.  Note that the depth/stencil
1975bd8deadSopenharmony_ci        test optimization whereby implementations may choose to depth
1985bd8deadSopenharmony_ci        test at only one of the samples when GL_MULTISAMPLE is disabled
1995bd8deadSopenharmony_ci        does not cause this to become ill-specified, because we are
2005bd8deadSopenharmony_ci        counting the number of samples that are still alive _after_ the
2015bd8deadSopenharmony_ci        depth test stage.  The mechanism used to decide whether to kill
2025bd8deadSopenharmony_ci        or keep those samples is not relevant.
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci    *   Exactly what stage are we counting at?  The original spec said
2055bd8deadSopenharmony_ci        depth test; what does stencil test do?
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci        RESOLVED: We are counting immediately after _both_ the depth and
2085bd8deadSopenharmony_ci        stencil tests, i.e., pixels that pass both.  This was the
2095bd8deadSopenharmony_ci        original spec's intent.  Note that the depth test comes after the
2105bd8deadSopenharmony_ci        stencil test, so to say that it is the number that pass the depth
2115bd8deadSopenharmony_ci        test is reasonable; though it is often helpful to think of the
2125bd8deadSopenharmony_ci        depth and stencil tests as being combined, because the depth test
2135bd8deadSopenharmony_ci        result impacts the stencil operation used.
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    *   Is it guaranteed that occlusion queries return in order?
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci        RESOLVED: Yes.  It makes sense to do this.  If occlusion test X
2185bd8deadSopenharmony_ci        occurred before occlusion query Y, and the driver informs the app
2195bd8deadSopenharmony_ci        that occlusion query Y is done, the app can infer that occlusion
2205bd8deadSopenharmony_ci        query X is also done.  For applications that do poll, this allows
2215bd8deadSopenharmony_ci        them to do so with less effort.
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci    *   Will polling an occlusion query without a glFlush possibly cause
2245bd8deadSopenharmony_ci        an infinite loop?
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci        RESOLVED: Yes, this is a risk.  If you ask for the result,
2275bd8deadSopenharmony_ci        however, any flush required will be done automatically.  It is
2285bd8deadSopenharmony_ci        only when you are polling that this is a problem because there is
2295bd8deadSopenharmony_ci        no guarantee that a flush has occured in the time since
2305bd8deadSopenharmony_ci        glEndOcclusionQueryNV, and the spec is written to say that the
2315bd8deadSopenharmony_ci        result is only "available" if the value could be returned
2325bd8deadSopenharmony_ci        _instantaneously_.
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci        This is different from NV_fence, where FinishFenceNV can cause an
2355bd8deadSopenharmony_ci        app hang, and where TestFenceNV was also not guaranteed to ever
2365bd8deadSopenharmony_ci        finish.
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci        There need not be any spec language to describe this behavior
2395bd8deadSopenharmony_ci        because it is implied by what is already said.
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci        In short, if you use GL_PIXEL_COUNT_AVAILABLE_NV, you _must_ use
2425bd8deadSopenharmony_ci        glFlush, or your app may hang.
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    *   The HP_occlusion_test specs did not contain the spec edits that
2455bd8deadSopenharmony_ci        explain the exact way the extension works.  Should this spec fill
2465bd8deadSopenharmony_ci        in those details?
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci        RESOLVED: Yes.  These two extensions are intertwined in so many
2495bd8deadSopenharmony_ci        important ways that doing so is not optional.
2505bd8deadSopenharmony_ci
2515bd8deadSopenharmony_ci    *   Should there be a "target" parameter to BeginOcclusionQuery?
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci        RESOLVED: No.  We're not trying to solve the problem of "query
2545bd8deadSopenharmony_ci        anything" here.
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci    *   What might an application that uses this extension look like?
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci        Here is some rough sample code:
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci        GLuint occlusionQueries[N];
2615bd8deadSopenharmony_ci        GLuint pixelCount;
2625bd8deadSopenharmony_ci
2635bd8deadSopenharmony_ci        glGenOcclusionQueriesNV(N, occlusionQueries);
2645bd8deadSopenharmony_ci        ...
2655bd8deadSopenharmony_ci        // before this point, render major occluders
2665bd8deadSopenharmony_ci        glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
2675bd8deadSopenharmony_ci        glDepthMask(GL_FALSE);
2685bd8deadSopenharmony_ci        // also disable texturing and any fancy shading features
2695bd8deadSopenharmony_ci        for (i = 0; i < N; i++) {
2705bd8deadSopenharmony_ci            glBeginOcclusionQueryNV(occlusionQueries[i]);
2715bd8deadSopenharmony_ci            // render bounding box for object i
2725bd8deadSopenharmony_ci            glEndOcclusionQueryNV();
2735bd8deadSopenharmony_ci        }
2745bd8deadSopenharmony_ci        // at this point, if possible, go and do some other computation
2755bd8deadSopenharmony_ci        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
2765bd8deadSopenharmony_ci        glDepthMask(GL_TRUE);
2775bd8deadSopenharmony_ci        // reenable other state
2785bd8deadSopenharmony_ci        for (i = 0; i < N; i++) {
2795bd8deadSopenharmony_ci            glGetOcclusionQueryuivNV(occlusionQueries[i], GL_PIXEL_COUNT_NV,
2805bd8deadSopenharmony_ci                                     &pixelCount);
2815bd8deadSopenharmony_ci            if (pixelCount > 0) {
2825bd8deadSopenharmony_ci                // render object i
2835bd8deadSopenharmony_ci            }
2845bd8deadSopenharmony_ci        }
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci    *   Is this extension useful for saving geometry, fill rate, or both?
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci        It is expected that it will be most useful for saving geometry
2895bd8deadSopenharmony_ci        work, because for the cost of rendering a bounding box you can
2905bd8deadSopenharmony_ci        save rendering a normal object.
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ci        It is possible for this extension to help in fill-limited
2935bd8deadSopenharmony_ci        situations, but using it may also hurt performance in such
2945bd8deadSopenharmony_ci        situations, because rendering the pixels of a bounding box is
2955bd8deadSopenharmony_ci        hardly free.  In most situations a bounding box will probably
2965bd8deadSopenharmony_ci        have more pixels than the original object.
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci        One exception is that for objects rendered with multiple passes,
2995bd8deadSopenharmony_ci        the first pass can be wrapped with an occlusion query almost for
3005bd8deadSopenharmony_ci        free.  That is, render the first pass for all objects in the
3015bd8deadSopenharmony_ci        scene, and get the number of pixels rendered on each object.  If
3025bd8deadSopenharmony_ci        zero pixels were rendered for an object, you can skip subsequent
3035bd8deadSopenharmony_ci        rendering passes.  This trick can be very useful in many cases.
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    *   What can be said about guaranteeing correctness when using
3065bd8deadSopenharmony_ci        occlusion queries, especially as it relates to invariance?
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci        Invariance is critical to guarantee the correctness of occlusion
3095bd8deadSopenharmony_ci        queries.  If occlusion queries go through a different code path
3105bd8deadSopenharmony_ci        than standard rendering, the pixels rendered may be different.
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci        However, the invariance issues are difficult at best to solve.
3135bd8deadSopenharmony_ci        Because of the vagaries of floating-point precision, it is
3145bd8deadSopenharmony_ci        difficult to guarantee that rendering a bounding box will render
3155bd8deadSopenharmony_ci        at least as many pixels with equal or smaller Z values than the
3165bd8deadSopenharmony_ci        object itself would have rendered.
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci        Likewise, many other aspects of rendering state tend to be
3195bd8deadSopenharmony_ci        different when performing an occlusion query.  Color and depth
3205bd8deadSopenharmony_ci        writes are typically disabled, as are texturing, vertex programs,
3215bd8deadSopenharmony_ci        and any fancy per-pixel math.  So unless all these features have
3225bd8deadSopenharmony_ci        guarantees of invariance themselves (unlikely at best), requiring
3235bd8deadSopenharmony_ci        invariance for NV_occlusion_query would be futile.
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci        For what it's worth, NVIDIA's implementation is fully invariant
3265bd8deadSopenharmony_ci        with respect to whether an occlusion query is active; that is, it
3275bd8deadSopenharmony_ci        does not affect the operation of any other stage of the pipeline.
3285bd8deadSopenharmony_ci        (When occlusion queries are being emulated on hardware that does
3295bd8deadSopenharmony_ci        not support them, via the emulation registry keys, using an
3305bd8deadSopenharmony_ci        occlusion query produces a software rasteriation fallback, and in
3315bd8deadSopenharmony_ci        such cases invariance cannot be guaranteed.)
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ci        Another problem that can threaten correctness is near and far
3345bd8deadSopenharmony_ci        clipping.  If the bounding box penetrates the near clip plane,
3355bd8deadSopenharmony_ci        for example, it may be clipped away, reducing the number of
3365bd8deadSopenharmony_ci        pixels counted, when in fact the original object may have stayed
3375bd8deadSopenharmony_ci        entirely beyond the near clip plane.  Whenever you design an
3385bd8deadSopenharmony_ci        algorithm using occlusion queries, it is best to be careful about
3395bd8deadSopenharmony_ci        the near and far clip planes.
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci    *   How can frame-to-frame coherency help applications using this
3425bd8deadSopenharmony_ci        extension get even higher performance?
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci        Usually, if an object is visible one frame, it will be visible
3455bd8deadSopenharmony_ci        the next frame, and if it is not visible, it will not be visible
3465bd8deadSopenharmony_ci        the next frame.
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci        Of course, for most applications, "usually" isn't good enough.
3495bd8deadSopenharmony_ci        It is undesirable, but acceptable, to render an object that
3505bd8deadSopenharmony_ci        wasn't visible, because that only costs performance.  It is
3515bd8deadSopenharmony_ci        generally unacceptable to not render an object that was visible.
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci        The simplest approach is that visible objects should be checked
3545bd8deadSopenharmony_ci        every N frames (where, say, N=5) to see if they have become
3555bd8deadSopenharmony_ci        occluded, while objects that were occluded last frame must be
3565bd8deadSopenharmony_ci        rechecked again in the current frame to guarantee that they are
3575bd8deadSopenharmony_ci        still occluded.  This will reduce the number of wasteful
3585bd8deadSopenharmony_ci        occlusion queries by a factor of almost N.
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci        It may also pay to do a raycast on the CPU in order to try to
3615bd8deadSopenharmony_ci        prove that an object is visible.  After all, occlusion queries
3625bd8deadSopenharmony_ci        are only one of many items in your bag of tricks to decide
3635bd8deadSopenharmony_ci        whether objects are visible or invisible.  They are not an excuse
3645bd8deadSopenharmony_ci        to skip frustum culling, or precomputing visibility using portals
3655bd8deadSopenharmony_ci        for static environments, or other standard visibility techniques.
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci        In general, though, taking advantage of frame-to-frame coherency
3685bd8deadSopenharmony_ci        in your occlusion query code is absolutely essential to getting
3695bd8deadSopenharmony_ci        the best possible performance.
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ciNew Procedures and Functions
3725bd8deadSopenharmony_ci
3735bd8deadSopenharmony_ci    void GenOcclusionQueriesNV(sizei n, uint *ids);
3745bd8deadSopenharmony_ci    void DeleteOcclusionQueriesNV(sizei n, const uint *ids);
3755bd8deadSopenharmony_ci    boolean IsOcclusionQueryNV(uint id);
3765bd8deadSopenharmony_ci    void BeginOcclusionQueryNV(uint id);
3775bd8deadSopenharmony_ci    void EndOcclusionQueryNV(void);
3785bd8deadSopenharmony_ci    void GetOcclusionQueryivNV(uint id, enum pname, int *params);
3795bd8deadSopenharmony_ci    void GetOcclusionQueryuivNV(uint id, enum pname, uint *params);
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ciNew Tokens
3825bd8deadSopenharmony_ci
3835bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
3845bd8deadSopenharmony_ci    and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
3855bd8deadSopenharmony_ci    and GetDoublev:
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci        OCCLUSION_TEST_HP                              0x8165
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
3905bd8deadSopenharmony_ci    GetFloatv, and GetDoublev:
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci        OCCLUSION_TEST_RESULT_HP                       0x8166
3935bd8deadSopenharmony_ci        PIXEL_COUNTER_BITS_NV                          0x8864
3945bd8deadSopenharmony_ci        CURRENT_OCCLUSION_QUERY_ID_NV                  0x8865
3955bd8deadSopenharmony_ci
3965bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetOcclusionQueryivNV and
3975bd8deadSopenharmony_ci    GetOcclusionQueryuivNV:
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ci        PIXEL_COUNT_NV                                 0x8866
4005bd8deadSopenharmony_ci        PIXEL_COUNT_AVAILABLE_NV                       0x8867
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.3 Specification (OpenGL Operation)
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci    None.
4055bd8deadSopenharmony_ci
4065bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.3 Specification (Rasterization)
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci    None.
4095bd8deadSopenharmony_ci
4105bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.3 Specification (Per-Fragment
4115bd8deadSopenharmony_ciOperations and the Frame Buffer)
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci    Add a new section "Occlusion Tests and Queries" between sections
4145bd8deadSopenharmony_ci    4.1.6 and 4.1.7:
4155bd8deadSopenharmony_ci
4165bd8deadSopenharmony_ci    "4.1.6A  Occlusion Tests and Queries
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    Occlusion testing keeps track of whether any pixels have passed the
4195bd8deadSopenharmony_ci    depth test.  Such testing is enabled or disabled with the generic
4205bd8deadSopenharmony_ci    Enable and Disable commands using the symbolic constant
4215bd8deadSopenharmony_ci    OCCLUSION_TEST_HP.  The occlusion test result is initially FALSE.
4225bd8deadSopenharmony_ci
4235bd8deadSopenharmony_ci    Occlusion queries can be used to track the exact number of fragments
4245bd8deadSopenharmony_ci    that pass the depth test.  Occlusion queries are associated with
4255bd8deadSopenharmony_ci    occlusion query objects.  The command
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ci      void GenOcclusionQueriesNV(sizei n, uint *ids);
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ci    returns n previously unused occlusion query names in ids.  These
4305bd8deadSopenharmony_ci    names are marked as used, but no object is associated with them until
4315bd8deadSopenharmony_ci    the first time BeginOcclusionQueryNV is called on them.  Occlusion
4325bd8deadSopenharmony_ci    queries contain one piece of state, a pixel count result.  This pixel
4335bd8deadSopenharmony_ci    count result is initialized to zero when the object is created.
4345bd8deadSopenharmony_ci
4355bd8deadSopenharmony_ci    Occlusion queries are deleted by calling
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ci      void DeleteOcclusionQueriesNV(sizei n, const uint *ids);
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci    ids contains n names of occlusion queries to be deleted.  After an
4405bd8deadSopenharmony_ci    occlusion query is deleted, its name is again unused.  Unused names
4415bd8deadSopenharmony_ci    in ids are silently ignored.
4425bd8deadSopenharmony_ci
4435bd8deadSopenharmony_ci    An occlusion query can be started and finished by calling
4445bd8deadSopenharmony_ci
4455bd8deadSopenharmony_ci      void BeginOcclusionQueryNV(uint id);
4465bd8deadSopenharmony_ci      void EndOcclusionQueryNV(void);
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ci    If BeginOcclusionQueryNV is called with an unused id, that id is
4495bd8deadSopenharmony_ci    marked as used and associated with a new occlusion query object.  If
4505bd8deadSopenharmony_ci    it is called while another occlusion query is active, an
4515bd8deadSopenharmony_ci    INVALID_OPERATION error is generated.  If EndOcclusionQueryNV is
4525bd8deadSopenharmony_ci    called while no occlusion query is active, an INVALID_OPERATION error
4535bd8deadSopenharmony_ci    is generated.  Calling either GenOCclusionQueriesNV or
4545bd8deadSopenharmony_ci    DeleteOcclusionQueriesNV while an occlusion query is active causes an
4555bd8deadSopenharmony_ci    INVALID_OPERATION error to be generated.
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ci    When EndOcclusionQueryNV is called, the current pixel counter is
4585bd8deadSopenharmony_ci    copied into the active occlusion query object's pixel count result.
4595bd8deadSopenharmony_ci    BeginOcclusionQueryNV resets the pixel counter to zero and the
4605bd8deadSopenharmony_ci    occlusion test result to FALSE.
4615bd8deadSopenharmony_ci
4625bd8deadSopenharmony_ci    Whenever a fragment reaches this stage and OCCLUSION_TEST_HP is
4635bd8deadSopenharmony_ci    enabled or an occlusion query is active, the occlusion test result is
4645bd8deadSopenharmony_ci    set to TRUE and the pixel counter is incremented.  If the value of
4655bd8deadSopenharmony_ci    SAMPLE_BUFFERS is 1, then the pixel counter is incremented by the
4665bd8deadSopenharmony_ci    number of samples whose coverage bit is set; otherwise, it is always
4675bd8deadSopenharmony_ci    incremented by one.  If it the pixel counter overflows, i.e., exceeds
4685bd8deadSopenharmony_ci    the value 2^PIXEL_COUNTER_BITS_NV-1, its value becomes undefined.
4695bd8deadSopenharmony_ci    It is recommended, but not required, that implementations handle this
4705bd8deadSopenharmony_ci    overflow case by saturating at 2^PIXEL_COUNTER_BITS_NV-1 and
4715bd8deadSopenharmony_ci    incrementing no further.
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ci    The necessary state is a single bit indicating whether the occlusion
4745bd8deadSopenharmony_ci    test is enabled, a single bit indicating whether an occlusion query
4755bd8deadSopenharmony_ci    is active, the identifier of the currently active occlusion query, a
4765bd8deadSopenharmony_ci    counter of no smaller than 24 bits keeping track of the pixel count,
4775bd8deadSopenharmony_ci    and a single bit indicating the occlusion test result."
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.3 Specification (Special Functions)
4805bd8deadSopenharmony_ci
4815bd8deadSopenharmony_ci    Add to the end of Section 5.4 "Display Lists":
4825bd8deadSopenharmony_ci
4835bd8deadSopenharmony_ci    "DeleteOcclusionQueriesNV, GenOcclusionQueriesNV, IsOcclusionQueryNV,
4845bd8deadSopenharmony_ci    GetOcclusionQueryivNV, and GetOcclusionQueryuivNV are not complied
4855bd8deadSopenharmony_ci    into display lists but are executed immediately."
4865bd8deadSopenharmony_ci
4875bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.3 Specification (State and
4885bd8deadSopenharmony_ciState Requests)
4895bd8deadSopenharmony_ci
4905bd8deadSopenharmony_ci    Add a new section 6.1.13 "Occlusion Test and Occlusion Queries":
4915bd8deadSopenharmony_ci
4925bd8deadSopenharmony_ci    "The occlusion test result can be queried using GetBooleanv,
4935bd8deadSopenharmony_ci    GetIntegerv, GetFloatv, or GetDoublev with a <pname> of
4945bd8deadSopenharmony_ci    OCCLUSION_TEST_RESULT_HP.  Whenever such a query is performed, the
4955bd8deadSopenharmony_ci    occlusion test result is reset to FALSE and the pixel counter is
4965bd8deadSopenharmony_ci    reset to zero as a side effect.
4975bd8deadSopenharmony_ci
4985bd8deadSopenharmony_ci    Which occlusion query is active can be queried using GetBooleanv,
4995bd8deadSopenharmony_ci    GetIntegerv, GetFloatv, or GetDoublev with a <pname> of
5005bd8deadSopenharmony_ci    CURRENT_OCCLUSION_QUERY_ID_NV.  This query returns the name of the
5015bd8deadSopenharmony_ci    currently active occlusion query if one is active, and zero
5025bd8deadSopenharmony_ci    otherwise.
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ci    The state of an occlusion query can be queried with the commands
5055bd8deadSopenharmony_ci
5065bd8deadSopenharmony_ci      void GetOcclusionQueryivNV(uint id, enum pname, int *params);
5075bd8deadSopenharmony_ci      void GetOcclusionQueryuivNV(uint id, enum pname, uint *params);
5085bd8deadSopenharmony_ci
5095bd8deadSopenharmony_ci    If the occlusion query object named by id is currently active, then
5105bd8deadSopenharmony_ci    an INVALID_OPERATION error is generated.
5115bd8deadSopenharmony_ci
5125bd8deadSopenharmony_ci    If <pname> is PIXEL_COUNT_NV, then the occlusion query's pixel count
5135bd8deadSopenharmony_ci    result is placed in params.
5145bd8deadSopenharmony_ci
5155bd8deadSopenharmony_ci    Often, occlusion query results will be returned asychronously with
5165bd8deadSopenharmony_ci    respect to the host processor's operation.  As a result, sometimes,
5175bd8deadSopenharmony_ci    if a pixel count is queried, the host must wait until the result is
5185bd8deadSopenharmony_ci    back.  If <pname> is PIXEL_COUNT_AVAILABLE_NV, the value placed in
5195bd8deadSopenharmony_ci    params indicates whether or not such a wait would occur if the pixel
5205bd8deadSopenharmony_ci    count for that occlusion query were to be queried presently.  A
5215bd8deadSopenharmony_ci    result of TRUE means no wait would be required; a result of FALSE
5225bd8deadSopenharmony_ci    means that some wait would occur.  The length of this wait is
5235bd8deadSopenharmony_ci    potentially unbounded.  It must always be true that if the result for
5245bd8deadSopenharmony_ci    one occlusion query is available, the result for all previous
5255bd8deadSopenharmony_ci    occlusion queries must also be available at that point in time."
5265bd8deadSopenharmony_ci
5275bd8deadSopenharmony_ciGLX Protocol
5285bd8deadSopenharmony_ci
5295bd8deadSopenharmony_ci    Seven new GL commands are added.
5305bd8deadSopenharmony_ci
5315bd8deadSopenharmony_ci    The following two rendering commands are sent to the server as part
5325bd8deadSopenharmony_ci    of a glXRender request:
5335bd8deadSopenharmony_ci
5345bd8deadSopenharmony_ci        BeginOcclusionQueryNV
5355bd8deadSopenharmony_ci            2           8               rendering command length
5365bd8deadSopenharmony_ci            2           ????            rendering command opcode
5375bd8deadSopenharmony_ci            4           CARD32          id
5385bd8deadSopenharmony_ci
5395bd8deadSopenharmony_ci        EndOcclusionQueryNV
5405bd8deadSopenharmony_ci            2           4               rendering command length
5415bd8deadSopenharmony_ci            2           ????            rendering command opcode
5425bd8deadSopenharmony_ci
5435bd8deadSopenharmony_ci    The remaining fivecommands are non-rendering commands.  These
5445bd8deadSopenharmony_ci    commands are sent separately (i.e., not as part of a glXRender or
5455bd8deadSopenharmony_ci    glXRenderLarge request), using the glXVendorPrivateWithReply
5465bd8deadSopenharmony_ci    request:
5475bd8deadSopenharmony_ci
5485bd8deadSopenharmony_ci        DeleteOcclusionQueriesNV
5495bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
5505bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
5515bd8deadSopenharmony_ci            2           4+n             request length
5525bd8deadSopenharmony_ci            4           ????            vendor specific opcode
5535bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
5545bd8deadSopenharmony_ci            4           INT32           n
5555bd8deadSopenharmony_ci            n*4         LISTofCARD32    ids
5565bd8deadSopenharmony_ci
5575bd8deadSopenharmony_ci        GenOcclusionQueriesNV
5585bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
5595bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
5605bd8deadSopenharmony_ci            2           4               request length
5615bd8deadSopenharmony_ci            4           ????            vendor specific opcode
5625bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
5635bd8deadSopenharmony_ci            4           INT32           n
5645bd8deadSopenharmony_ci          =>
5655bd8deadSopenharmony_ci            1           1               reply
5665bd8deadSopenharmony_ci            1                           unused
5675bd8deadSopenharmony_ci            2           CARD16          sequence number
5685bd8deadSopenharmony_ci            4           n               reply length
5695bd8deadSopenharmony_ci            24                          unused
5705bd8deadSopenharmony_ci            n*4         LISTofCARD322   queries
5715bd8deadSopenharmony_ci
5725bd8deadSopenharmony_ci        IsOcclusionQueryNV
5735bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
5745bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
5755bd8deadSopenharmony_ci            2           4               request length
5765bd8deadSopenharmony_ci            4           ????            vendor specific opcode
5775bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
5785bd8deadSopenharmony_ci            4           CARD32          id
5795bd8deadSopenharmony_ci          =>
5805bd8deadSopenharmony_ci            1           1               reply
5815bd8deadSopenharmony_ci            1                           unused
5825bd8deadSopenharmony_ci            2           CARD16          sequence number
5835bd8deadSopenharmony_ci            4           0               reply length
5845bd8deadSopenharmony_ci            4           BOOL32          return value
5855bd8deadSopenharmony_ci            20                          unused
5865bd8deadSopenharmony_ci            1           1               reply
5875bd8deadSopenharmony_ci
5885bd8deadSopenharmony_ci        GetOcclusionQueryivNV
5895bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
5905bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
5915bd8deadSopenharmony_ci            2           5               request length
5925bd8deadSopenharmony_ci            4           ????            vendor specific opcode
5935bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
5945bd8deadSopenharmony_ci            4           CARD32          id
5955bd8deadSopenharmony_ci            4           ENUM            pname
5965bd8deadSopenharmony_ci          =>
5975bd8deadSopenharmony_ci            1           1               reply
5985bd8deadSopenharmony_ci            1                           unused
5995bd8deadSopenharmony_ci            2           CARD16          sequence number
6005bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n)
6015bd8deadSopenharmony_ci            4                           unused
6025bd8deadSopenharmony_ci            4           CARD32          n
6035bd8deadSopenharmony_ci
6045bd8deadSopenharmony_ci            if (n=1) this follows:
6055bd8deadSopenharmony_ci
6065bd8deadSopenharmony_ci            4           INT32           params
6075bd8deadSopenharmony_ci            12                          unused
6085bd8deadSopenharmony_ci
6095bd8deadSopenharmony_ci            otherwise this follows:
6105bd8deadSopenharmony_ci
6115bd8deadSopenharmony_ci            16                          unused
6125bd8deadSopenharmony_ci            n*4         LISTofINT32     params
6135bd8deadSopenharmony_ci
6145bd8deadSopenharmony_ci        GetOcclusionQueryuivNV
6155bd8deadSopenharmony_ci            1           CARD8           opcode (X assigned)
6165bd8deadSopenharmony_ci            1           17              GLX opcode (glXVendorPrivateWithReply)
6175bd8deadSopenharmony_ci            2           5               request length
6185bd8deadSopenharmony_ci            4           ????            vendor specific opcode
6195bd8deadSopenharmony_ci            4           GLX_CONTEXT_TAG context tag
6205bd8deadSopenharmony_ci            4           CARD32          id
6215bd8deadSopenharmony_ci            4           ENUM            pname
6225bd8deadSopenharmony_ci          =>
6235bd8deadSopenharmony_ci            1           1               reply
6245bd8deadSopenharmony_ci            1                           unused
6255bd8deadSopenharmony_ci            2           CARD16          sequence number
6265bd8deadSopenharmony_ci            4           m               reply length, m=(n==1?0:n)
6275bd8deadSopenharmony_ci            4                           unused
6285bd8deadSopenharmony_ci            4           CARD32          n
6295bd8deadSopenharmony_ci
6305bd8deadSopenharmony_ci            if (n=1) this follows:
6315bd8deadSopenharmony_ci
6325bd8deadSopenharmony_ci            4           CARD32          params
6335bd8deadSopenharmony_ci            12                          unused
6345bd8deadSopenharmony_ci
6355bd8deadSopenharmony_ci            otherwise this follows:
6365bd8deadSopenharmony_ci
6375bd8deadSopenharmony_ci            16                          unused
6385bd8deadSopenharmony_ci            n*4         LISTofCARD32    params
6395bd8deadSopenharmony_ci
6405bd8deadSopenharmony_ciErrors
6415bd8deadSopenharmony_ci
6425bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if GenOcclusionQueriesNV is
6435bd8deadSopenharmony_ci    called where n is negative.
6445bd8deadSopenharmony_ci
6455bd8deadSopenharmony_ci    The error INVALID_VALUE is generated if DeleteOcclusionQueriesNV is
6465bd8deadSopenharmony_ci    called where n is negative.
6475bd8deadSopenharmony_ci
6485bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if GenOcclusionQueriesNV or
6495bd8deadSopenharmony_ci    DeleteOcclusionQueriesNV is called when an occlusion query is active.
6505bd8deadSopenharmony_ci
6515bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if BeginOcclusionQueryNV is
6525bd8deadSopenharmony_ci    called when an occlusion query is already active.
6535bd8deadSopenharmony_ci
6545bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if EndOcclusionQueryNV is
6555bd8deadSopenharmony_ci    called when an occlusion query is not active.
6565bd8deadSopenharmony_ci
6575bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if GetOcclusionQueryivNV or
6585bd8deadSopenharmony_ci    GetOcclusionQueryuivNV is called where id is not the name of an
6595bd8deadSopenharmony_ci    occlusion query.
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if GetOcclusionQueryivNV or
6625bd8deadSopenharmony_ci    GetOcclusionQueryuivNV is called where id is the name of the
6635bd8deadSopenharmony_ci    currently active occlusion query.
6645bd8deadSopenharmony_ci
6655bd8deadSopenharmony_ci    The error INVALID_ENUM is generated if GetOcclusionQueryivNV or
6665bd8deadSopenharmony_ci    GetOcclusionQueryuivNV is called where pname is not either
6675bd8deadSopenharmony_ci    PIXEL_COUNT_NV or PIXEL_COUNT_AVAILABLE_NV.
6685bd8deadSopenharmony_ci
6695bd8deadSopenharmony_ci    The error INVALID_OPERATION is generated if any of the commands
6705bd8deadSopenharmony_ci    defined in this extension is executed between the execution of Begin
6715bd8deadSopenharmony_ci    and the corresponding execution of End.
6725bd8deadSopenharmony_ci
6735bd8deadSopenharmony_ciNew State
6745bd8deadSopenharmony_ci
6755bd8deadSopenharmony_ci(table 6.18, p. 226)
6765bd8deadSopenharmony_ci
6775bd8deadSopenharmony_ci    Get Value                      Type    Get Command     Initial Value   Description              Sec     Attribute
6785bd8deadSopenharmony_ci    ---------                      ----    -----------     -------------   -----------              ------  ---------
6795bd8deadSopenharmony_ci    OCCLUSION_TEST_HP              B       IsEnabled       FALSE           occlusion test enable    4.1.6A  enable
6805bd8deadSopenharmony_ci    OCCLUSION_TEST_RESULT_HP       B       GetBooleanv     FALSE           occlusion test result    4.1.6A  -
6815bd8deadSopenharmony_ci    -                              B       GetBooleanv     FALSE           occlusion query active   4.1.6A  -
6825bd8deadSopenharmony_ci    CURRENT_OCCLUSION_QUERY_ID_NV  Z+      GetIntegerv     0               occlusion query ID       4.1.6A  -
6835bd8deadSopenharmony_ci    -                              Z+      -               0               pixel counter            4.1.6A  -
6845bd8deadSopenharmony_ci
6855bd8deadSopenharmony_ciNew Implementation Dependent State
6865bd8deadSopenharmony_ci
6875bd8deadSopenharmony_ci(table 6.29, p. 237) Add the following entry:
6885bd8deadSopenharmony_ci
6895bd8deadSopenharmony_ci    Get Value                    Type    Get Command   Minimum Value   Description         Sec     Attribute
6905bd8deadSopenharmony_ci    --------------------------   ----    -----------   -------------   ----------------    ------  --------------
6915bd8deadSopenharmony_ci    PIXEL_COUNTER_BITS_NV        Z+      GetIntegerv   24              Number of bits in   6.1.13  -
6925bd8deadSopenharmony_ci                                                                       pixel counters
6935bd8deadSopenharmony_ci
6945bd8deadSopenharmony_ciRevision History
6955bd8deadSopenharmony_ci
6965bd8deadSopenharmony_ci    none yet
697