15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_sparse_texture2
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_sparse_texture2
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
125bd8deadSopenharmony_ci    Piers Daniell, NVIDIA Corporation (pdaniell 'at' nvidia.com)
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciContributors
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA Corporation
175bd8deadSopenharmony_ci    Mathias Heyer, NVIDIA Corporation
185bd8deadSopenharmony_ci    Eric Werness, NVIDIA Corporation
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ciNotice
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ci    Copyright (c) 2015 The Khronos Group Inc. Copyright terms at
235bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ciSpecification Update Policy
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
285bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
295bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
305bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
315bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
325bd8deadSopenharmony_ci    described in more detail at
335bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciStatus
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    Complete. Approved by the ARB on June 26, 2015.
385bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on August 7, 2015.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciVersion
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    Last Modified Date:         May 26, 2015
435bd8deadSopenharmony_ci    Revision:                   3
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ciNumber
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    ARB Extension #186
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ciDependencies
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.5 Specification
525bd8deadSopenharmony_ci    (Compatibility Profile), dated February 2, 2015.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    This extension is written against the OpenGL Shading Language
555bd8deadSopenharmony_ci    Specification, version 4.50, revision 5.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    When implemented in OpenGL, this extension requires and extends
585bd8deadSopenharmony_ci    ARB_sparse_texture.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    This extension interacts trivially with EXT_depth_bounds_test.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci    This extension interacts with NV_gpu_program4 and NV_gpu_program5.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ciOverview
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    This extension builds on the ARB_sparse_texture extension, providing the
675bd8deadSopenharmony_ci    following new functionality:
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci      * New built-in GLSL texture lookup and image load functions are provided
705bd8deadSopenharmony_ci        that return information on whether the texels accessed for the texture
715bd8deadSopenharmony_ci        lookup accessed uncommitted texture memory.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci      * New built-in GLSL texture lookup functions are provided that specify a
745bd8deadSopenharmony_ci        minimum level of detail to use for lookups where the level of detail
755bd8deadSopenharmony_ci        is computed automatically.  This allows shaders to avoid accessing
765bd8deadSopenharmony_ci        unpopulated portions of high-resolution levels of detail when it knows
775bd8deadSopenharmony_ci        that the memory accessed is unpopulated, either from a priori
785bd8deadSopenharmony_ci        knowledge or from feedback provided by the return value of previously
795bd8deadSopenharmony_ci        executed "sparse" texture lookup functions.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci      * Reads of uncommitted texture memory will act as though such memory
825bd8deadSopenharmony_ci        were filled with zeroes; previously, the values returned by reads were
835bd8deadSopenharmony_ci        undefined.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci      * Standard implementation-independent virtual page sizes for internal
865bd8deadSopenharmony_ci        formats required to be supported with sparse textures. These standard
875bd8deadSopenharmony_ci        sizes can be requested by leaving VIRTUAL_PAGE_SIZE_INDEX_ARB at its
885bd8deadSopenharmony_ci        initial value (0).
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci      * Support for creating sparse multisample and multisample array textures
915bd8deadSopenharmony_ci        is added.  However, the virtual page sizes for such textures remain
925bd8deadSopenharmony_ci        fully implementation-dependent.
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ciNew Procedures and Functions
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    None.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ciNew Tokens
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    None.
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ciModifications to the OpenGL 4.5 Specification (Compatibility Profile)
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    Modify Section 8.10, Texture Parameters, p. 264
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    (modify the following Errors section entry for TexParameter*, added by
1075bd8deadSopenharmony_ci    ARB_sparse_texture, to allow for sparse multisample and multisample array
1085bd8deadSopenharmony_ci    textures)
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci        INVALID_VALUE is generated if <pname> is TEXTURE_SPARSE_ARB, <pname>
1115bd8deadSopenharmony_ci    is TRUE and <target> is not one of TEXTURE_2D, TEXTURE_2D_ARRAY,
1125bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP, TEXTURE_CUBE_MAP_ARRAY, TEXTURE_3D, TEXTURE_RECTANGLE,
1135bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE, or TEXTURE_2D_MULTISAMPLE_ARRAY.
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    Modify the edits to Section 8.19 (Immutable-Format Texture Images), as
1175bd8deadSopenharmony_ci    made by ARB_sparse_texture
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    (remove the following language from the "p. 233" edits starting with "If
1205bd8deadSopenharmony_ci     TEXTURE_SPARSE_ARB is TRUE"; there is no longer a restriction on the base
1215bd8deadSopenharmony_ci     size of a sparse texture allocation)
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    [REMOVED LANGUAGE] ... In this case, <width>, <height>, and <depth> must
1245bd8deadSopenharmony_ci    either be integer multiples of the selected virtual page size in the X, Y,
1255bd8deadSopenharmony_ci    and Z dimensions, respectively, or be less than those dimensions. ...
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    (remove the following TexStorage error added by ARB_sparse_texture; there
1285bd8deadSopenharmony_ci     is no longer a restriction on the base size of a sparse texture
1295bd8deadSopenharmony_ci     allocation)
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    [REMOVED LANGUAGE] An INVALID_VALUE error is generated if
1325bd8deadSopenharmony_ci    TEXTURE_SPARSE_ARB is TRUE and <width>, <height> or <depth> is is not an
1335bd8deadSopenharmony_ci    integer multiple of the page size in the corresponding dimension.
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    (remove the error language beginning with "If the value of
1365bd8deadSopenharmony_ci     SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB is FALSE", and replace with
1375bd8deadSopenharmony_ci     the following)
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    In older extensions supporting sparse textures, the constant
1405bd8deadSopenharmony_ci    SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB was provided to advertise
1415bd8deadSopenharmony_ci    implementation-dependent limitations potentially prohibiting the
1425bd8deadSopenharmony_ci    allocation of array or cube map textures with full mipmap chains.  No such
1435bd8deadSopenharmony_ci    limitations apply in this extension.  This constant is retained for
1445bd8deadSopenharmony_ci    backwards compatibility, but all implementations of this extension must
1455bd8deadSopenharmony_ci    return TRUE.
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    Modify Section 8.20.1 of ARB_sparse_texture (Allocation of and Access to
1495bd8deadSopenharmony_ci    Sparse Textures)
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci    (insert after the two paragraphs discussing VIRTUAL_PAGE_SIZE_INDEX_ARB)
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    When leaving the VIRTUAL_PAGE_SIZE_INDEX_ARB texture parameter at its
1545bd8deadSopenharmony_ci    initial value (0), the virtual page size for many non-multisample sparse
1555bd8deadSopenharmony_ci    textures can be found in Table 8.X. If the internal format of the texture
1565bd8deadSopenharmony_ci    is not listed in Table 8.X or if the texture target is
1575bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY, or TEXTURE_3D, the
1585bd8deadSopenharmony_ci    virtual page size for index zero is fully implementation-
1595bd8deadSopenharmony_ci    dependent. Otherwise, the virtual page size of such a texture comes from
1605bd8deadSopenharmony_ci    the value listed in the value listed in the "2D Page Size" column.
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci      Internal Format      2D Page Size
1635bd8deadSopenharmony_ci      ---------------      -------------
1645bd8deadSopenharmony_ci      R8                   256 x 256 x 1
1655bd8deadSopenharmony_ci      R8_SNORM
1665bd8deadSopenharmony_ci      R8I
1675bd8deadSopenharmony_ci      R8UI
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci      R16                  256 x 128 x 1
1705bd8deadSopenharmony_ci      R16_SNORM
1715bd8deadSopenharmony_ci      RG8
1725bd8deadSopenharmony_ci      RG8_SNORM
1735bd8deadSopenharmony_ci      RGB565
1745bd8deadSopenharmony_ci      R16F
1755bd8deadSopenharmony_ci      R16I
1765bd8deadSopenharmony_ci      R16UI
1775bd8deadSopenharmony_ci      RG8I
1785bd8deadSopenharmony_ci      RG8UI
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci      RG16                 128 x 128 x 1
1815bd8deadSopenharmony_ci      RG16_SNORM
1825bd8deadSopenharmony_ci      RGBA8
1835bd8deadSopenharmony_ci      RGBA8_SNORM
1845bd8deadSopenharmony_ci      RGB10_A2
1855bd8deadSopenharmony_ci      RGB10_A2UI
1865bd8deadSopenharmony_ci      RG16F
1875bd8deadSopenharmony_ci      R32F
1885bd8deadSopenharmony_ci      R11F_G11F_B10F
1895bd8deadSopenharmony_ci      RGB9_E5
1905bd8deadSopenharmony_ci      R32I
1915bd8deadSopenharmony_ci      R32UI
1925bd8deadSopenharmony_ci      RG16I
1935bd8deadSopenharmony_ci      RG16UI
1945bd8deadSopenharmony_ci      RGBA8I
1955bd8deadSopenharmony_ci      RGBA8UI
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci      RGBA16               128 x 64 x 1
1985bd8deadSopenharmony_ci      RGBA16_SNORM
1995bd8deadSopenharmony_ci      RGBA16F
2005bd8deadSopenharmony_ci      RG32F
2015bd8deadSopenharmony_ci      RG32I
2025bd8deadSopenharmony_ci      RG32UI
2035bd8deadSopenharmony_ci      RGBA16I
2045bd8deadSopenharmony_ci      RGBA16UI
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci      RGBA32F              64 x 64 x 1
2075bd8deadSopenharmony_ci      RGBA32I
2085bd8deadSopenharmony_ci      RGBA32UI
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci      Table 8.X, Standard Virtual Page Sizes for Sparse Textures
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    (modify first bullet under "When a sparsely committed texture is accessed
2145bd8deadSopenharmony_ci     by the GL" at the end of the section)
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci        * Reads from such regions behave as if the data in texture memory for
2175bd8deadSopenharmony_ci          all components present in the texture format were zero.  This
2185bd8deadSopenharmony_ci          includes samples required for the implementation of texture
2195bd8deadSopenharmony_ci          filtering, image loads, mipmap generation, and so on.  For texture
2205bd8deadSopenharmony_ci          and image loads, components not present in the texture format (e.g.,
2215bd8deadSopenharmony_ci          alpha in a texture with an RGB base internal format) will return
2225bd8deadSopenharmony_ci          default values, as in non-sparse textures.
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    (modify third bullet under "When a sparsely committed texture is accessed
2255bd8deadSopenharmony_ci     by the GL" at the end of the section)
2265bd8deadSopenharmony_ci
2275bd8deadSopenharmony_ci        * Atomic operations operating on uncommitted regions will not generate
2285bd8deadSopenharmony_ci          exceptions but will always return zero.  The result of the atomic
2295bd8deadSopenharmony_ci          operation, which is normally written to memory, will instead be
2305bd8deadSopenharmony_ci          discarded.
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    (add new bullets under "When a sparsely committed texture is accessed by
2335bd8deadSopenharmony_ci     the GL" at the end of the section)
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci        * When performing the stencil test (section 17.3.5), depth buffer test
2365bd8deadSopenharmony_ci          (section 17.3.6), or depth bounds test on pixels in uncommitted
2375bd8deadSopenharmony_ci          regions, the results of the test will be consistent with reading a
2385bd8deadSopenharmony_ci          value of zero from the framebuffer.  No value is written to the
2395bd8deadSopenharmony_ci          depth buffer.
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    (add a new paragraph at the end of the section)
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci    The OpenGL Shading Language provides built-in functions that perform a
2445bd8deadSopenharmony_ci    texture fetch or image load and return sparse texture status information
2455bd8deadSopenharmony_ci    to the caller.  The status information can be queried by the built-in
2465bd8deadSopenharmony_ci    function sparseTexelsResidentARB(), which returns false if the lookup
2475bd8deadSopenharmony_ci    function read one or more uncommitted texels and true otherwise.  For the
2485bd8deadSopenharmony_ci    purposes of this query, texels addressed by a filter normally computing a
2495bd8deadSopenharmony_ci    weighted average of multiple texels (e.g., LINEAR) will be considered to
2505bd8deadSopenharmony_ci    access only those texels with non-zero weights.
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci    Modify Section 8.20.2 of ARB_sparse_texture (Controlling Sparse Texture
2545bd8deadSopenharmony_ci    Commitment)
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci    (modify the fifth paragraph of the section from ARB_sparse_texture,
2575bd8deadSopenharmony_ci    starting with "For levels of a sparse texture where..." to guarantee that
2585bd8deadSopenharmony_ci    any level greater than or equal to the page size in all dimensions can be
2595bd8deadSopenharmony_ci    sparsely populated)
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    For levels of a sparse texture where each dimension is greater than or
2625bd8deadSopenharmony_ci    equal to of the virtual page size, the residency of individual page-size
2635bd8deadSopenharmony_ci    regions is controlled by TexPageCommitmentARB and such levels may be
2645bd8deadSopenharmony_ci    partially populated.  When the mipmap chain reaches a level that is not
2655bd8deadSopenharmony_ci    greater than or equal to the virtual page size in any dimension, padding
2665bd8deadSopenharmony_ci    and memory layout considerations may make it impossible to treat that
2675bd8deadSopenharmony_ci    level and subsequent smaller ones as partially populated.  ...
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ciModifications to the OpenGL Shading Language Specification, Version 4.50
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the
2735bd8deadSopenharmony_ci    language features described in this extension:
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci      #extension GL_ARB_sparse_texture2 : <behavior>
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.3.
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci    New preprocessor #defines are added to the OpenGL Shading Language:
2805bd8deadSopenharmony_ci
2815bd8deadSopenharmony_ci      #define GL_ARB_sparse_texture2            1
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    Modify Section 8.9.2, Texel Lookup Functions, p. 162
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci    (This extension adds one new variant of texture lookup functions. The
2865bd8deadSopenharmony_ci    "sparse" functions are like normal texture lookup functions, except that
2875bd8deadSopenharmony_ci    they return a sparse texture residency status to the caller and return the
2885bd8deadSopenharmony_ci    actual filtered texel value in an "out" parameter.
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    For each set of texture functions, we provide one to three new variants
2915bd8deadSopenharmony_ci    based on whether sparse functionality is desired. This new variant copies
2925bd8deadSopenharmony_ci    the existing functions, adds suffixes to the function names, and adds one or
2935bd8deadSopenharmony_ci    more new parameters.
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    We create a new variant only for the targets for which sparse storage is
2965bd8deadSopenharmony_ci    supported -- no new functions are added for the following sampler types:
2975bd8deadSopenharmony_ci    gsampler1D, sampler1DShadow, gsampler1DArray, sampler1DArrayShadow.
2985bd8deadSopenharmony_ci    Additionally, to reduce the number of new functions added, we are not
2995bd8deadSopenharmony_ci    including any new variants for textureProj*() built-ins.  To use the new
3005bd8deadSopenharmony_ci    features with projective texture lookups, shaders can divide through by q
3015bd8deadSopenharmony_ci    and use non-projective variants.)
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci    (insert new lookup function table cells, at the end of the section,
3045bd8deadSopenharmony_ci    p. 168)
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    Syntax:
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ci      int sparseTextureARB(gsampler2D sampler, vec2 P,
3095bd8deadSopenharmony_ci                           out gvec4 texel [, float bias]);
3105bd8deadSopenharmony_ci      int sparseTextureARB(gsampler3D sampler, vec3 P,
3115bd8deadSopenharmony_ci                           out gvec4 texel [, float bias]);
3125bd8deadSopenharmony_ci      int sparseTextureARB(gsamplerCube sampler, vec3 P,
3135bd8deadSopenharmony_ci                           out gvec4 texel [, float bias]);
3145bd8deadSopenharmony_ci      int sparseTextureARB(sampler2DShadow sampler, vec3 P,
3155bd8deadSopenharmony_ci                           out float texel [, float bias]);
3165bd8deadSopenharmony_ci      int sparseTextureARB(samplerCubeShadow sampler, vec4 P,
3175bd8deadSopenharmony_ci                           out float texel [, float bias]);
3185bd8deadSopenharmony_ci      int sparseTextureARB(gsampler2DArray sampler, vec3 P,
3195bd8deadSopenharmony_ci                           out gvec4 texel [, float bias]);
3205bd8deadSopenharmony_ci      int sparseTextureARB(gsamplerCubeArray sampler, vec4 P,
3215bd8deadSopenharmony_ci                           out gvec4 texel [, float bias]);
3225bd8deadSopenharmony_ci      int sparseTextureARB(sampler2DArrayShadow sampler, vec4 P,
3235bd8deadSopenharmony_ci                           out float texel);
3245bd8deadSopenharmony_ci      int sparseTextureARB(gsampler2DRect sampler, vec2 P,
3255bd8deadSopenharmony_ci                           out gvec4 texel);
3265bd8deadSopenharmony_ci      int sparseTextureARB(sampler2DRectShadow sampler, vec3 P,
3275bd8deadSopenharmony_ci                           out float texel);
3285bd8deadSopenharmony_ci      int sparseTextureARB(samplerCubeArrayShadow sampler, vec4 P,
3295bd8deadSopenharmony_ci                           float compare, out float texel);
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci    Description:
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ci    Do a filtered texture lookup as in texture(), but return texture access
3345bd8deadSopenharmony_ci    residency information from the function and the filtered lookup result in
3355bd8deadSopenharmony_ci    the out parameter <texel>.
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ci    --
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ci    Syntax:
3415bd8deadSopenharmony_ci
3425bd8deadSopenharmony_ci      int sparseTextureLodARB(gsampler2D sampler, vec2 P, float lod,
3435bd8deadSopenharmony_ci                              out gvec4 texel);
3445bd8deadSopenharmony_ci      int sparseTextureLodARB(gsampler3D sampler, vec3 P, float lod,
3455bd8deadSopenharmony_ci                              out gvec4 texel);
3465bd8deadSopenharmony_ci      int sparseTextureLodARB(gsamplerCube sampler, vec3 P, float lod,
3475bd8deadSopenharmony_ci                              out gvec4 texel);
3485bd8deadSopenharmony_ci      int sparseTextureLodARB(sampler2DShadow sampler, vec3 P, float lod,
3495bd8deadSopenharmony_ci                              out float texel);
3505bd8deadSopenharmony_ci      int sparseTextureLodARB(gsampler2DArray sampler, vec3 P, float lod,
3515bd8deadSopenharmony_ci                              out gvec4 texel);
3525bd8deadSopenharmony_ci      int sparseTextureLodARB(gsamplerCubeArray sampler, vec4 P, float lod,
3535bd8deadSopenharmony_ci                              out gvec4 texel);
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci    Description:
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci    Do a filtered texture lookup as in textureLod(), but return texture access
3585bd8deadSopenharmony_ci    residency information from the function and the filtered lookup result in
3595bd8deadSopenharmony_ci    the out parameter <texel>.
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    --
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci    Syntax:
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci      int sparseTextureOffsetARB(gsampler2D sampler, vec2 P,
3665bd8deadSopenharmony_ci                                 ivec2 offset, out gvec4 texel
3675bd8deadSopenharmony_ci                                 [, float bias]);
3685bd8deadSopenharmony_ci      int sparseTextureOffsetARB(gsampler3D sampler, vec3 P,
3695bd8deadSopenharmony_ci                                 ivec3 offset, out gvec4 texel
3705bd8deadSopenharmony_ci                                 [, float bias]);
3715bd8deadSopenharmony_ci      int sparseTextureOffsetARB(gsampler2DRect sampler, vec2 P,
3725bd8deadSopenharmony_ci                                 ivec2 offset, out gvec4 texel);
3735bd8deadSopenharmony_ci      int sparseTextureOffsetARB(sampler2DRectShadow sampler, vec3 P,
3745bd8deadSopenharmony_ci                                 ivec2 offset, out float texel);
3755bd8deadSopenharmony_ci      int sparseTextureOffsetARB(sampler2DShadow sampler, vec3 P,
3765bd8deadSopenharmony_ci                                 ivec2 offset, out float texel
3775bd8deadSopenharmony_ci                                 [, float bias]);
3785bd8deadSopenharmony_ci      int sparseTextureOffsetARB(gsampler2DArray sampler, vec3 P,
3795bd8deadSopenharmony_ci                                 ivec2 offset, out gvec4 texel
3805bd8deadSopenharmony_ci                                 [, float bias]);
3815bd8deadSopenharmony_ci      int sparseTextureOffsetARB(sampler2DArrayShadow sampler, vec4 P,
3825bd8deadSopenharmony_ci                                 ivec2 offset, out float texel);
3835bd8deadSopenharmony_ci
3845bd8deadSopenharmony_ci    Description:
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci    Do a filtered texture lookup as in textureOffset(), but return texture
3875bd8deadSopenharmony_ci    access residency information from the function and the filtered lookup
3885bd8deadSopenharmony_ci    result in the out parameter <texel>.
3895bd8deadSopenharmony_ci
3905bd8deadSopenharmony_ci    --
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci    Syntax:
3935bd8deadSopenharmony_ci
3945bd8deadSopenharmony_ci      int sparseTexelFetchARB(gsampler2D sampler, ivec2 P, int lod,
3955bd8deadSopenharmony_ci                              out gvec4 texel);
3965bd8deadSopenharmony_ci      int sparseTexelFetchARB(gsampler3D sampler, ivec3 P, int lod,
3975bd8deadSopenharmony_ci                              out gvec4 texel);
3985bd8deadSopenharmony_ci      int sparseTexelFetchARB(gsampler2DRect sampler, ivec2 P,
3995bd8deadSopenharmony_ci                              out gvec4 texel);
4005bd8deadSopenharmony_ci      int sparseTexelFetchARB(gsampler2DArray sampler, ivec3 P, int lod,
4015bd8deadSopenharmony_ci                              out gvec4 texel);
4025bd8deadSopenharmony_ci      int sparseTexelFetchARB(gsampler2DMS sampler, ivec2 P, int sample,
4035bd8deadSopenharmony_ci                              out gvec4 texel);
4045bd8deadSopenharmony_ci      int sparseTexelFetchARB(gsampler2DMSArray sampler, ivec3 P, int sample,
4055bd8deadSopenharmony_ci                              out gvec4 texel);
4065bd8deadSopenharmony_ci
4075bd8deadSopenharmony_ci    Description:
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    Do a single texel fetch as in texelFetch(), but return texture access
4105bd8deadSopenharmony_ci    residency information from the function and the fetched texel in the out
4115bd8deadSopenharmony_ci    parameter <texel>.
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci    --
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci    Syntax:
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci      int sparseTexelFetchOffsetARB(gsampler2D sampler, ivec2 P, int lod,
4185bd8deadSopenharmony_ci                                    ivec2 offset, out gvec4 texel);
4195bd8deadSopenharmony_ci      int sparseTexelFetchOffsetARB(gsampler3D sampler, ivec3 P, int lod,
4205bd8deadSopenharmony_ci                                    ivec3 offset, out gvec4 texel);
4215bd8deadSopenharmony_ci      int sparseTexelFetchOffsetARB(gsampler2DRect sampler, ivec2 P,
4225bd8deadSopenharmony_ci                                    ivec2 offset, out gvec4 texel);
4235bd8deadSopenharmony_ci      int sparseTexelFetchOffsetARB(gsampler2DArray sampler, ivec3 P, int lod,
4245bd8deadSopenharmony_ci                                    ivec2 offset, out gvec4 texel);
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci    Description:
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci    Do a single texel fetch as in texelFetchOffset(), but return texture
4295bd8deadSopenharmony_ci    access residency information from the function and the fetched texel in
4305bd8deadSopenharmony_ci    the out parameter <texel>.
4315bd8deadSopenharmony_ci
4325bd8deadSopenharmony_ci    --
4335bd8deadSopenharmony_ci
4345bd8deadSopenharmony_ci    Syntax:
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ci      int sparseTextureLodOffsetARB(gsampler2D sampler, vec2 P,
4375bd8deadSopenharmony_ci                                    float lod, ivec2 offset,
4385bd8deadSopenharmony_ci                                    out gvec4 texel);
4395bd8deadSopenharmony_ci      int sparseTextureLodOffsetARB(gsampler3D sampler, vec3 P,
4405bd8deadSopenharmony_ci                                    float lod, ivec3 offset,
4415bd8deadSopenharmony_ci                                    out gvec4 texel);
4425bd8deadSopenharmony_ci      int sparseTextureLodOffsetARB(sampler2DShadow sampler, vec3 P,
4435bd8deadSopenharmony_ci                                    float lod, ivec2 offset,
4445bd8deadSopenharmony_ci                                    out float texel);
4455bd8deadSopenharmony_ci      int sparseTextureLodOffsetARB(gsampler2DArray sampler, vec3 P,
4465bd8deadSopenharmony_ci                                    float lod, ivec2 offset,
4475bd8deadSopenharmony_ci                                    out gvec4 texel);
4485bd8deadSopenharmony_ci
4495bd8deadSopenharmony_ci    Description:
4505bd8deadSopenharmony_ci
4515bd8deadSopenharmony_ci    Do a filtered texture lookup as in textureLodOffset(), but return texture
4525bd8deadSopenharmony_ci    access residency information from the function and the filtered lookup
4535bd8deadSopenharmony_ci    result in the out parameter <texel>.
4545bd8deadSopenharmony_ci
4555bd8deadSopenharmony_ci    --
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ci    Syntax:
4585bd8deadSopenharmony_ci
4595bd8deadSopenharmony_ci      int sparseTextureGradARB(gsampler2D sampler, vec2 P,
4605bd8deadSopenharmony_ci                               vec2 dPdx, vec2 dPdy,
4615bd8deadSopenharmony_ci                               out gvec4 texel);
4625bd8deadSopenharmony_ci      int sparseTextureGradARB(gsampler3D sampler, vec3 P,
4635bd8deadSopenharmony_ci                               vec3 dPdx, vec3 dPdy,
4645bd8deadSopenharmony_ci                               out gvec4 texel);
4655bd8deadSopenharmony_ci      int sparseTextureGradARB(gsamplerCube sampler, vec3 P,
4665bd8deadSopenharmony_ci                               vec3 dPdx, vec3 dPdy,
4675bd8deadSopenharmony_ci                               out gvec4 texel);
4685bd8deadSopenharmony_ci      int sparseTextureGradARB(gsampler2DRect sampler, vec2 P,
4695bd8deadSopenharmony_ci                               vec2 dPdx, vec2 dPdy,
4705bd8deadSopenharmony_ci                               out gvec4 texel);
4715bd8deadSopenharmony_ci      int sparseTextureGradARB(sampler2DRectShadow sampler, vec3 P,
4725bd8deadSopenharmony_ci                               vec2 dPdx, vec2 dPdy,
4735bd8deadSopenharmony_ci                               out float texel);
4745bd8deadSopenharmony_ci      int sparseTextureGradARB(sampler2DShadow sampler, vec3 P,
4755bd8deadSopenharmony_ci                               vec2 dPdx, vec2 dPdy,
4765bd8deadSopenharmony_ci                               out float texel);
4775bd8deadSopenharmony_ci      int sparseTextureGradARB(samplerCubeShadow sampler, vec4 P,
4785bd8deadSopenharmony_ci                               vec3 dPdx, vec3 dPdy,
4795bd8deadSopenharmony_ci                               out float texel);
4805bd8deadSopenharmony_ci      int sparseTextureGradARB(gsampler2DArray sampler, vec3 P,
4815bd8deadSopenharmony_ci                               vec2 dPdx, vec2 dPdy,
4825bd8deadSopenharmony_ci                               out gvec4 texel);
4835bd8deadSopenharmony_ci      int sparseTextureGradARB(sampler2DArrayShadow sampler, vec4 P,
4845bd8deadSopenharmony_ci                               vec2 dPdx, vec2 dPdy,
4855bd8deadSopenharmony_ci                               out float texel);
4865bd8deadSopenharmony_ci      int sparseTextureGradARB(gsamplerCubeArray sampler, vec4 P,
4875bd8deadSopenharmony_ci                               vec3 dPdx, vec3 dPdy,
4885bd8deadSopenharmony_ci                               out gvec4 texel);
4895bd8deadSopenharmony_ci
4905bd8deadSopenharmony_ci    Description:
4915bd8deadSopenharmony_ci
4925bd8deadSopenharmony_ci    Do a filtered texture lookup as in textureGrad(), but return texture
4935bd8deadSopenharmony_ci    access residency information from the function and the filtered lookup
4945bd8deadSopenharmony_ci    result in the out parameter <texel>.
4955bd8deadSopenharmony_ci
4965bd8deadSopenharmony_ci    --
4975bd8deadSopenharmony_ci
4985bd8deadSopenharmony_ci    Syntax:
4995bd8deadSopenharmony_ci
5005bd8deadSopenharmony_ci      int sparseTextureGradOffsetARB(gsampler2D sampler, vec2 P,
5015bd8deadSopenharmony_ci                                     vec2 dPdx, vec2 dPdy, ivec2 offset,
5025bd8deadSopenharmony_ci                                     out gvec4 texel);
5035bd8deadSopenharmony_ci      int sparseTextureGradOffsetARB(gsampler3D sampler, vec3 P,
5045bd8deadSopenharmony_ci                                     vec3 dPdx, vec3 dPdy, ivec3 offset,
5055bd8deadSopenharmony_ci                                     out gvec4 texel);
5065bd8deadSopenharmony_ci      int sparseTextureGradOffsetARB(gsampler2DRect sampler, vec2 P,
5075bd8deadSopenharmony_ci                                     vec2 dPdx, vec2 dPdy, ivec2 offset,
5085bd8deadSopenharmony_ci                                     out gvec4 texel);
5095bd8deadSopenharmony_ci      int sparseTextureGradOffsetARB(sampler2DRectShadow sampler, vec3 P,
5105bd8deadSopenharmony_ci                                     vec2 dPdx, vec2 dPdy, ivec2 offset,
5115bd8deadSopenharmony_ci                                     out float texel);
5125bd8deadSopenharmony_ci      int sparseTextureGradOffsetARB(sampler2DShadow sampler, vec3 P,
5135bd8deadSopenharmony_ci                                     vec2 dPdx, vec2 dPdy, ivec2 offset,
5145bd8deadSopenharmony_ci                                     out float texel);
5155bd8deadSopenharmony_ci      int sparseTextureGradOffsetARB(gsampler2DArray sampler, vec3 P,
5165bd8deadSopenharmony_ci                                     vec2 dPdx, vec2 dPdy, ivec2 offset,
5175bd8deadSopenharmony_ci                                     out gvec4 texel);
5185bd8deadSopenharmony_ci      int sparseTextureGradOffsetARB(sampler2DArrayShadow sampler, vec4 P,
5195bd8deadSopenharmony_ci                                     vec2 dPdx, vec2 dPdy, ivec2 offset,
5205bd8deadSopenharmony_ci                                     out float texel);
5215bd8deadSopenharmony_ci
5225bd8deadSopenharmony_ci    Description:
5235bd8deadSopenharmony_ci
5245bd8deadSopenharmony_ci    Do a filtered texture lookup as in textureGradOffset(), but return texture
5255bd8deadSopenharmony_ci    access residency information from the function and the filtered lookup
5265bd8deadSopenharmony_ci    result in the out parameter <texel>.
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ci    Modify Section 8.9.3, Texel Gather Functions, p. 161
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci    (insert new lookup function table cells, at the end of the section,
5335bd8deadSopenharmony_ci    p. 163)
5345bd8deadSopenharmony_ci
5355bd8deadSopenharmony_ci    Syntax:
5365bd8deadSopenharmony_ci
5375bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsampler2D sampler, vec2 P,
5385bd8deadSopenharmony_ci                                 out gvec4 texel [, int comp]);
5395bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsampler2DArray sampler, vec3 P,
5405bd8deadSopenharmony_ci                                 out gvec4 texel [, int comp]);
5415bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsamplerCube sampler, vec3 P,
5425bd8deadSopenharmony_ci                                 out gvec4 texel [, int comp]);
5435bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsamplerCubeArray sampler, vec4 P,
5445bd8deadSopenharmony_ci                                 out gvec4 texel [, int comp]);
5455bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsampler2DRect sampler, vec2 P,
5465bd8deadSopenharmony_ci                                 out gvec4 texel [, int comp]);
5475bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsampler2DShadow sampler, vec2 P,
5485bd8deadSopenharmony_ci                                 float refZ, out vec4 texel);
5495bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsampler2DArrayShadow sampler, vec3 P,
5505bd8deadSopenharmony_ci                                 float refZ, out vec4 texel);
5515bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsamplerCubeShadow sampler, vec3 P,
5525bd8deadSopenharmony_ci                                 float refZ, out vec4 texel);
5535bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsamplerCubeArrayShadow sampler, vec4 P,
5545bd8deadSopenharmony_ci                                 float refZ, out vec4 texel);
5555bd8deadSopenharmony_ci      int sparseTextureGatherARB(gsampler2DRectShadow sampler, vec2 P,
5565bd8deadSopenharmony_ci                                 float refZ, out vec4 texel);
5575bd8deadSopenharmony_ci
5585bd8deadSopenharmony_ci    Description:
5595bd8deadSopenharmony_ci
5605bd8deadSopenharmony_ci    Do a texture gather operation as in textureGather(), but return texture
5615bd8deadSopenharmony_ci    access residency information from the function and the filtered lookup
5625bd8deadSopenharmony_ci    result in the out parameter <texel>.
5635bd8deadSopenharmony_ci
5645bd8deadSopenharmony_ci    --
5655bd8deadSopenharmony_ci
5665bd8deadSopenharmony_ci    Syntax:
5675bd8deadSopenharmony_ci
5685bd8deadSopenharmony_ci      int sparseTextureGatherOffsetARB(gsampler2D sampler, vec2 P,
5695bd8deadSopenharmony_ci                                       ivec2 offset, out gvec4 texel
5705bd8deadSopenharmony_ci                                       [, int comp]);
5715bd8deadSopenharmony_ci      int sparseTextureGatherOffsetARB(gsampler2DArray sampler, vec3 P,
5725bd8deadSopenharmony_ci                                       ivec2 offset, out gvec4 texel
5735bd8deadSopenharmony_ci                                       [, int comp]);
5745bd8deadSopenharmony_ci      int sparseTextureGatherOffsetARB(gsampler2DRect sampler, vec2 P,
5755bd8deadSopenharmony_ci                                       ivec2 offset, out gvec4 texel
5765bd8deadSopenharmony_ci                                       [, int comp]);
5775bd8deadSopenharmony_ci      int sparseTextureGatherOffsetARB(gsampler2DShadow sampler, vec2 P,
5785bd8deadSopenharmony_ci                                       float refZ, ivec2 offset,
5795bd8deadSopenharmony_ci                                       out vec4 texel);
5805bd8deadSopenharmony_ci      int sparseTextureGatherOffsetARB(gsampler2DArrayShadow sampler, vec3 P,
5815bd8deadSopenharmony_ci                                       float refZ, ivec2 offset,
5825bd8deadSopenharmony_ci                                       out vec4 texel);
5835bd8deadSopenharmony_ci      int sparseTextureGatherOffsetARB(gsampler2DRectShadow sampler, vec2 P,
5845bd8deadSopenharmony_ci                                       float refZ, ivec2 offset,
5855bd8deadSopenharmony_ci                                       out vec4 texel);
5865bd8deadSopenharmony_ci
5875bd8deadSopenharmony_ci    Description:
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ci    Do a texture gather operation as in textureGatherOffset(), but return
5905bd8deadSopenharmony_ci    texture access residency information from the function and the filtered
5915bd8deadSopenharmony_ci    lookup result in the out parameter <texel>.
5925bd8deadSopenharmony_ci
5935bd8deadSopenharmony_ci    --
5945bd8deadSopenharmony_ci
5955bd8deadSopenharmony_ci    Syntax:
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ci      int sparseTextureGatherOffsetsARB(gsampler2D sampler, vec2 P,
5985bd8deadSopenharmony_ci                                        ivec2 offsets[4], out gvec4 texel
5995bd8deadSopenharmony_ci                                        [, int comp]);
6005bd8deadSopenharmony_ci      int sparseTextureGatherOffsetsARB(gsampler2DArray sampler, vec3 P,
6015bd8deadSopenharmony_ci                                        ivec2 offsets[4], out gvec4 texel
6025bd8deadSopenharmony_ci                                        [, int comp]);
6035bd8deadSopenharmony_ci      int sparseTextureGatherOffsetsARB(gsampler2DRect sampler, vec2 P,
6045bd8deadSopenharmony_ci                                        ivec2 offsets[4], out gvec4 texel
6055bd8deadSopenharmony_ci                                        [, int comp]);
6065bd8deadSopenharmony_ci      int sparseTextureGatherOffsetsARB(gsampler2DShadow sampler, vec2 P,
6075bd8deadSopenharmony_ci                                        float refZ, ivec2 offsets[4],
6085bd8deadSopenharmony_ci                                        out vec4 texel);
6095bd8deadSopenharmony_ci      int sparseTextureGatherOffsetsARB(gsampler2DArrayShadow sampler, vec3 P,
6105bd8deadSopenharmony_ci                                        float refZ, ivec2 offsets[4],
6115bd8deadSopenharmony_ci                                        out vec4 texel);
6125bd8deadSopenharmony_ci      int sparseTextureGatherOffsetsARB(gsampler2DRectShadow sampler, vec2 P,
6135bd8deadSopenharmony_ci                                        float refZ, ivec2 offsets[4],
6145bd8deadSopenharmony_ci                                        out vec4 texel);
6155bd8deadSopenharmony_ci
6165bd8deadSopenharmony_ci    Description:
6175bd8deadSopenharmony_ci
6185bd8deadSopenharmony_ci    Do a texture gather operation as in textureGatherOffset(), but return
6195bd8deadSopenharmony_ci    texture access residency information from the function and the filtered
6205bd8deadSopenharmony_ci    lookup result in the out parameter <texel>.
6215bd8deadSopenharmony_ci
6225bd8deadSopenharmony_ci
6235bd8deadSopenharmony_ci    Add to the end of Section 8.12, Image Functions, p. 167
6245bd8deadSopenharmony_ci
6255bd8deadSopenharmony_ci    (insert new lookup function table cells, at the end of the section,
6265bd8deadSopenharmony_ci    p. 170)
6275bd8deadSopenharmony_ci
6285bd8deadSopenharmony_ci    Syntax:
6295bd8deadSopenharmony_ci
6305bd8deadSopenharmony_ci      int sparseImageLoadARB(gimage2D image, ivec2 P,
6315bd8deadSopenharmony_ci                             out gvec4 texel);
6325bd8deadSopenharmony_ci      int sparseImageLoadARB(gimage3D image, ivec3 P,
6335bd8deadSopenharmony_ci                             out gvec4 texel);
6345bd8deadSopenharmony_ci      int sparseImageLoadARB(gimage2DRect image, ivec2 P,
6355bd8deadSopenharmony_ci                             out gvec4 texel);
6365bd8deadSopenharmony_ci      int sparseImageLoadARB(gimageCube image, ivec3 P,
6375bd8deadSopenharmony_ci                             out gvec4 texel);
6385bd8deadSopenharmony_ci      int sparseImageLoadARB(gimage2DArray image, ivec3 P,
6395bd8deadSopenharmony_ci                             out gvec4 texel);
6405bd8deadSopenharmony_ci      int sparseImageLoadARB(gimageCubeArray image, ivec3 P,
6415bd8deadSopenharmony_ci                             out gvec4 texel);
6425bd8deadSopenharmony_ci      int sparseImageLoadARB(gimage2DMS image, ivec2 P, int sample,
6435bd8deadSopenharmony_ci                             out gvec4 texel);
6445bd8deadSopenharmony_ci      int sparseImageLoadARB(gimage2DMSArray image, ivec3 P, int sample,
6455bd8deadSopenharmony_ci                             out gvec4 texel);
6465bd8deadSopenharmony_ci
6475bd8deadSopenharmony_ci    Description:
6485bd8deadSopenharmony_ci
6495bd8deadSopenharmony_ci    Loads a texel from the image <image> as in imageLoad(), but return texture
6505bd8deadSopenharmony_ci    access residency information from the function and the filtered lookup
6515bd8deadSopenharmony_ci    result in the out parameter <texel>.
6525bd8deadSopenharmony_ci
6535bd8deadSopenharmony_ci
6545bd8deadSopenharmony_ci    Add to the end of Section 8.17, Shader Memory Control Functions, p. 178
6555bd8deadSopenharmony_ci
6565bd8deadSopenharmony_ci    Many of the built-in texture lookup functions in sections 8.9.2 and 8.9.3
6575bd8deadSopenharmony_ci    and the sparseImageLoad() function in section 8.12 can be used to return
6585bd8deadSopenharmony_ci    sparse texture residency information in addition to texel values.  In
6595bd8deadSopenharmony_ci    these functions, the sparse texture residency information is returned by
6605bd8deadSopenharmony_ci    the function as an integer and the texel values are returned in the output
6615bd8deadSopenharmony_ci    parameter <texel>.  The residency information can be interpreted by a
6625bd8deadSopenharmony_ci    built-in function to determine if the lookup accessed any uncommitted
6635bd8deadSopenharmony_ci    texels.
6645bd8deadSopenharmony_ci
6655bd8deadSopenharmony_ci    Syntax:
6665bd8deadSopenharmony_ci
6675bd8deadSopenharmony_ci      bool sparseTexelsResidentARB(int code);
6685bd8deadSopenharmony_ci
6695bd8deadSopenharmony_ci    Description:
6705bd8deadSopenharmony_ci
6715bd8deadSopenharmony_ci      Returns false if any of the texels accessed by the sparse texture lookup
6725bd8deadSopenharmony_ci      generating <code> were in uncommitted texture memory, and true
6735bd8deadSopenharmony_ci      otherwise.
6745bd8deadSopenharmony_ci
6755bd8deadSopenharmony_ci
6765bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
6775bd8deadSopenharmony_ci
6785bd8deadSopenharmony_ci    None.
6795bd8deadSopenharmony_ci
6805bd8deadSopenharmony_ciErrors
6815bd8deadSopenharmony_ci
6825bd8deadSopenharmony_ci    None.
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ciNew State
6855bd8deadSopenharmony_ci
6865bd8deadSopenharmony_ci    None.
6875bd8deadSopenharmony_ci
6885bd8deadSopenharmony_ciNew Implementation Dependent State
6895bd8deadSopenharmony_ci
6905bd8deadSopenharmony_ci    None.
6915bd8deadSopenharmony_ci
6925bd8deadSopenharmony_ciDependencies on EXT_depth_bounds_test
6935bd8deadSopenharmony_ci
6945bd8deadSopenharmony_ci    If EXT_depth_bounds_test is not supported, references to the depth bounds
6955bd8deadSopenharmony_ci    test should be removed.
6965bd8deadSopenharmony_ci
6975bd8deadSopenharmony_ciDependencies on NV_gpu_program4 and NV_gpu_program5
6985bd8deadSopenharmony_ci
6995bd8deadSopenharmony_ci    Modify Section 2.X.2, Program Grammar
7005bd8deadSopenharmony_ci
7015bd8deadSopenharmony_ci    <opModifier>            ::= "SPARSE"
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci    <ccMaskRule>            ::= "RESIDENT"
7045bd8deadSopenharmony_ci                              | "NONRESIDENT"
7055bd8deadSopenharmony_ci
7065bd8deadSopenharmony_ci    Modify Section 2.X.3.7, Program Condition Code Registers
7075bd8deadSopenharmony_ci
7085bd8deadSopenharmony_ci    (modify the first paragraph)
7095bd8deadSopenharmony_ci
7105bd8deadSopenharmony_ci    There are two general-purpose four-component condition code registers (CC0
7115bd8deadSopenharmony_ci    and CC1), where each component of this register is a collection of
7125bd8deadSopenharmony_ci    single-bit flags, including a sign flag (SF), a zero flag (ZF), an
7135bd8deadSopenharmony_ci    overflow flag (OF), and a carry flag (CF).  The values of these registers
7145bd8deadSopenharmony_ci    are undefined at the beginning of program execution.  Additionally, there
7155bd8deadSopenharmony_ci    is a special single-component sparse memory condition code register that
7165bd8deadSopenharmony_ci    holds the status of the most recently executed texture or image load
7175bd8deadSopenharmony_ci    instruction using the "SPARSE" opcode modifier.  This condition code
7185bd8deadSopenharmony_ci    includes a resident flag (RESF) indicating whether all memory accessed by
7195bd8deadSopenharmony_ci    the instruction was populated.
7205bd8deadSopenharmony_ci
7215bd8deadSopenharmony_ci    Modify Section 2.X.4.1, Program Instruction Modifiers
7225bd8deadSopenharmony_ci
7235bd8deadSopenharmony_ci    (Update the discussion of instruction precision modifiers.  If
7245bd8deadSopenharmony_ci     GL_NV_gpu_program_fp64 is not found in the extension string, the "F64"
7255bd8deadSopenharmony_ci     instruction modifier described below is not supported.)
7265bd8deadSopenharmony_ci
7275bd8deadSopenharmony_ci    (add to Table X.14 of the NV_gpu_program4 specification.)
7285bd8deadSopenharmony_ci
7295bd8deadSopenharmony_ci      Modifier  Description
7305bd8deadSopenharmony_ci      --------  ------------------------------------------------------
7315bd8deadSopenharmony_ci      SPARSE    Update the sparse memory condition code with status on
7325bd8deadSopenharmony_ci                whether the memory accessed by a texture or image load
7335bd8deadSopenharmony_ci                instruction was fully populated.
7345bd8deadSopenharmony_ci
7355bd8deadSopenharmony_ci    For texture fetch, surface load, and surface atomic instructions, the
7365bd8deadSopenharmony_ci    "SPARSE" modifier specifies that the sparse memory condition code
7375bd8deadSopenharmony_ci    described in Section 2.X.3.7 should be updated to reflect whether the
7385bd8deadSopenharmony_ci    memory accessed by the instruction was fully populated.
7395bd8deadSopenharmony_ci
7405bd8deadSopenharmony_ci    Modify Section 2.X.4.3, Program Destination Variable Update
7415bd8deadSopenharmony_ci
7425bd8deadSopenharmony_ci    (add to Table X.16, Condition Code Tests)
7435bd8deadSopenharmony_ci
7445bd8deadSopenharmony_ci         mask rule         test name                condition
7455bd8deadSopenharmony_ci         ---------------   ----------------------   -----------------
7465bd8deadSopenharmony_ci         RESIDENT          sparse resident          RESF
7475bd8deadSopenharmony_ci         NONRESIDENT       sparse nonresident       !RESF
7485bd8deadSopenharmony_ci
7495bd8deadSopenharmony_ci    (also modify the table description)
7505bd8deadSopenharmony_ci
7515bd8deadSopenharmony_ci      Table X.16, Condition Code Tests.  The allowed rules are specified in
7525bd8deadSopenharmony_ci      the "mask rule" column.  For "RESIDENT" or "NONRESIDENT", all four
7535bd8deadSopenharmony_ci      components of the test result are loaded from the RESF flag of the
7545bd8deadSopenharmony_ci      sparse condition code.  Otherwise, If "0" or "1" is appended ...
7555bd8deadSopenharmony_ci
7565bd8deadSopenharmony_ci    (modify the paragraph about condition code updates)
7575bd8deadSopenharmony_ci
7585bd8deadSopenharmony_ci    A program instruction can also optionally update one of the two general
7595bd8deadSopenharmony_ci    condition code registers ...
7605bd8deadSopenharmony_ci
7615bd8deadSopenharmony_ci    (add a new paragraph about updating CCSPARSE)
7625bd8deadSopenharmony_ci
7635bd8deadSopenharmony_ci    Additionally, a program instruction accessing memory can optionally update
7645bd8deadSopenharmony_ci    the sparse memory condition code register if the "SPARSE" instruction
7655bd8deadSopenharmony_ci    modifier is specified.  If the memory accessed by the instruction was
7665bd8deadSopenharmony_ci    fully populated, the resident flag (RESF) is set; otherwise, RESF is
7675bd8deadSopenharmony_ci    cleared.
7685bd8deadSopenharmony_ci
7695bd8deadSopenharmony_ciIssues
7705bd8deadSopenharmony_ci
7715bd8deadSopenharmony_ci    (1) How does this extension compare to the ARB_sparse_texture extension?
7725bd8deadSopenharmony_ci
7735bd8deadSopenharmony_ci      RESOLVED:  We extend the mechanisms provided by ARB_sparse_texture in
7745bd8deadSopenharmony_ci      several ways:
7755bd8deadSopenharmony_ci
7765bd8deadSopenharmony_ci        - We add built-in texture and image lookup functions returning
7775bd8deadSopenharmony_ci          information on memory accesses performed by the built-in functions;
7785bd8deadSopenharmony_ci          in particular, whether any uncommitted memory was referenced.
7795bd8deadSopenharmony_ci
7805bd8deadSopenharmony_ci        - We specify that all loads and atomics from uncommitted sparse memory
7815bd8deadSopenharmony_ci          behave as though zero were fetched.
7825bd8deadSopenharmony_ci
7835bd8deadSopenharmony_ci        - We remove the requirement that the base size of a sparse texture
7845bd8deadSopenharmony_ci          must be a multiple of the page size.  Implementations are expected
7855bd8deadSopenharmony_ci          to pad mipmap allocations internally to page size boundaries as
7865bd8deadSopenharmony_ci          required, until the tail is reached.
7875bd8deadSopenharmony_ci
7885bd8deadSopenharmony_ci        - We modify the definition of the sparse texture mipmap tail, so that
7895bd8deadSopenharmony_ci          all levels greater than or equal to the page size in all dimensions
7905bd8deadSopenharmony_ci          are guaranteed to be sparsely populated (i.e., not in the tail).
7915bd8deadSopenharmony_ci          The previous spec allowed implementations to put levels in the tail
7925bd8deadSopenharmony_ci          if they were not integer multiples of the page size.
7935bd8deadSopenharmony_ci
7945bd8deadSopenharmony_ci        - We add support for an implementation-independent virtual page size
7955bd8deadSopenharmony_ci          for some formats, instead of depending on querying
7965bd8deadSopenharmony_ci          implementation-dependent page size. For such formats, the default
7975bd8deadSopenharmony_ci          virtual page size index (0) is guaranteed to specify the standard
7985bd8deadSopenharmony_ci          page size.
7995bd8deadSopenharmony_ci
8005bd8deadSopenharmony_ci        - We require that all implementations of this extension return TRUE
8015bd8deadSopenharmony_ci          for the value of the implementation-dependent constant
8025bd8deadSopenharmony_ci          SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB, which removes some
8035bd8deadSopenharmony_ci          potential errors when allocating sparse array or cube map textures.
8045bd8deadSopenharmony_ci
8055bd8deadSopenharmony_ci        - We add support for sparse multisample and multisample array
8065bd8deadSopenharmony_ci          textures, but require no implementation-independent virtual page
8075bd8deadSopenharmony_ci          size.
8085bd8deadSopenharmony_ci
8095bd8deadSopenharmony_ci    (2) How does this extension compare to the AMD_sparse_texture extension?
8105bd8deadSopenharmony_ci
8115bd8deadSopenharmony_ci      RESOLVED:  This extension, like the AMD extension, provide built-in
8125bd8deadSopenharmony_ci      texture lookup functions returning information on whether uncommitted
8135bd8deadSopenharmony_ci      memory was accessed.  There are several differences between these
8145bd8deadSopenharmony_ci      functions:
8155bd8deadSopenharmony_ci
8165bd8deadSopenharmony_ci        - This extension uses an "ARB" suffix on built-in function names.
8175bd8deadSopenharmony_ci
8185bd8deadSopenharmony_ci        - This extension supports sparse accesses for shadow map sampler types
8195bd8deadSopenharmony_ci          (e.g., sampler2DShadow).
8205bd8deadSopenharmony_ci
8215bd8deadSopenharmony_ci        - This extension supports sparse variants of imageLoad(); the AMD
8225bd8deadSopenharmony_ci          extension does not.
8235bd8deadSopenharmony_ci
8245bd8deadSopenharmony_ci        - This extension doesn't attempt to support sparse variants of
8255bd8deadSopenharmony_ci          projective texture lookups to reduce the number of texture functions
8265bd8deadSopenharmony_ci          added.
8275bd8deadSopenharmony_ci
8285bd8deadSopenharmony_ci        - This extension doesn't attempt to support sparse variants of
8295bd8deadSopenharmony_ci          one-dimensional and one-dimensional array texture lookups.  Sparse
8305bd8deadSopenharmony_ci          textures with these targets are explicitly not supported in the ARB
8315bd8deadSopenharmony_ci          extension.
8325bd8deadSopenharmony_ci
8335bd8deadSopenharmony_ci        - This extension returns the texel data in an "out" parameter and
8345bd8deadSopenharmony_ci          returns a value consistent with sampling zero in any uncommitted
8355bd8deadSopenharmony_ci          texels.  The AMD extension returns the texel data in an "inout"
8365bd8deadSopenharmony_ci          parameter and guarantees not to write to the return value if any
8375bd8deadSopenharmony_ci          uncommitted texel is accessed.
8385bd8deadSopenharmony_ci
8395bd8deadSopenharmony_ci        - The function sparseTexelResident() from the AMD extension is renamed
8405bd8deadSopenharmony_ci          to sparseTexelsResidentARB().  We use "texels" instead of "texel" in
8415bd8deadSopenharmony_ci          the function name because a texture lookup may access multiple
8425bd8deadSopenharmony_ci          texels, and the code will reflect non-resident status if any of the
8435bd8deadSopenharmony_ci          texels is non-resident.
8445bd8deadSopenharmony_ci
8455bd8deadSopenharmony_ci      The built-in functions returning zero on reads from uncommitted memory,
8465bd8deadSopenharmony_ci      and the standard virtual page size are not provided by the AMD extension,
8475bd8deadSopenharmony_ci      either.
8485bd8deadSopenharmony_ci
8495bd8deadSopenharmony_ci      Neither this extension nor ARB_sparse_texture provide the minimum LOD
8505bd8deadSopenharmony_ci      warning feature provided by the AMD extension or the related built-in
8515bd8deadSopenharmony_ci      functions.
8525bd8deadSopenharmony_ci
8535bd8deadSopenharmony_ci    (3) How should the "sparse" built-in functions return both access status
8545bd8deadSopenharmony_ci        and a texel value?
8555bd8deadSopenharmony_ci
8565bd8deadSopenharmony_ci      RESOLVED:  We mostly followed the precedent of the AMD extension, where
8575bd8deadSopenharmony_ci      the sparse access status is returned as an integer and the texel values
8585bd8deadSopenharmony_ci      are returning in a vec4-typed "out" parameter.  (This differs slightly
8595bd8deadSopenharmony_ci      from the AMD extension in that it uses an "inout" parameter.)
8605bd8deadSopenharmony_ci
8615bd8deadSopenharmony_ci      We considered included returning the texel values from the function,
8625bd8deadSopenharmony_ci      just like normal texture lookups, and returning status in a separate
8635bd8deadSopenharmony_ci      "out" parameter (reversing the order).  We also considered returning a
8645bd8deadSopenharmony_ci      structure type containing both the status and the texel.  We ultimately
8655bd8deadSopenharmony_ci      chose to return the status code to more closely match the AMD extension
8665bd8deadSopenharmony_ci      and because we expect that shaders caring to use the "sparse" functions
8675bd8deadSopenharmony_ci      will want to look at the status code first.
8685bd8deadSopenharmony_ci
8695bd8deadSopenharmony_ci    (4) What data type should we use for the access status information
8705bd8deadSopenharmony_ci        returned by the "sparse" built-in functions?
8715bd8deadSopenharmony_ci
8725bd8deadSopenharmony_ci      RESOLVED:  We chose to follow the precedent of the AMD extension, where
8735bd8deadSopenharmony_ci      an integer code is returned.  Requiring a separate function call
8745bd8deadSopenharmony_ci      (sparseTexelsResidentARB) is required to reason about the code returned
8755bd8deadSopenharmony_ci      is mildly annoying, but we didn't consider it serious enough to warrant
8765bd8deadSopenharmony_ci      a change.
8775bd8deadSopenharmony_ci
8785bd8deadSopenharmony_ci      We could have used a "bool" type instead, but chose to stick with "int"
8795bd8deadSopenharmony_ci      for compatibility and for possible future expansion.  The AMD extension
8805bd8deadSopenharmony_ci      also includes built-in functions sparseTexelMinLodWarning() and
8815bd8deadSopenharmony_ci      sparseTexelWarningFetch() that can be used to check the return code for
8825bd8deadSopenharmony_ci      other conditions not supported by this extension.  Shaders that only
8835bd8deadSopenharmony_ci      care about residency information can still check the status in a single
8845bd8deadSopenharmony_ci      (long) line:
8855bd8deadSopenharmony_ci
8865bd8deadSopenharmony_ci        if (!sparseTexelsResidentARB(sparseTextureARB(sampler, coords,
8875bd8deadSopenharmony_ci                                                      texel))
8885bd8deadSopenharmony_ci        {
8895bd8deadSopenharmony_ci          // do something about the failure
8905bd8deadSopenharmony_ci        }
8915bd8deadSopenharmony_ci
8925bd8deadSopenharmony_ci    (5) When using a "sparse" built-in texture function, what RGBA values are
8935bd8deadSopenharmony_ci        generated when the lookup accesses one or more uncommited texels?
8945bd8deadSopenharmony_ci
8955bd8deadSopenharmony_ci      RESOLVED:  We return a filtered result vector where memory for
8965bd8deadSopenharmony_ci      uncommitted texels is treated as being filled with zeroes.  The data
8975bd8deadSopenharmony_ci      vector returned by the "sparse" functions for this case should exactly
8985bd8deadSopenharmony_ci      match the vector returned by an equivalent non-"sparse" function.
8995bd8deadSopenharmony_ci
9005bd8deadSopenharmony_ci    (6) For "sparse" built-in texture functions, where should the <texel>
9015bd8deadSopenharmony_ci        return value go relative to other parameters?
9025bd8deadSopenharmony_ci
9035bd8deadSopenharmony_ci      RESOLVED:  We chose to follow the precedent of the AMD extension,
9045bd8deadSopenharmony_ci      putting it in (approximately) the last parameter.  Note that the
9055bd8deadSopenharmony_ci      optional <bias> parameter of texture() breaks this pattern; we chose to
9065bd8deadSopenharmony_ci      keep the optional bias at the end.
9075bd8deadSopenharmony_ci
9085bd8deadSopenharmony_ci      Other options considered included:  always first (before the sampler),
9095bd8deadSopenharmony_ci      always second (after the sampler), always third (after the sampler and
9105bd8deadSopenharmony_ci      the base coordinates).  For "always third", note there are a couple
9115bd8deadSopenharmony_ci      cases like shadow lookups in cube arrays where the coordinates are split
9125bd8deadSopenharmony_ci      across multiple parameters and "always third" would be awkward.
9135bd8deadSopenharmony_ci      Additional options are discussed in issue (3).
9145bd8deadSopenharmony_ci
9155bd8deadSopenharmony_ci    (7) Should we provide sparse variants of the "2DMS" and "2DMSArray"
9165bd8deadSopenharmony_ci        variants of texelFetch() and imageLoad() in this extension?
9175bd8deadSopenharmony_ci
9185bd8deadSopenharmony_ci      RESOLVED:  Yes.  ARB_sparse_texture doesn't support multisample
9195bd8deadSopenharmony_ci      textures.  In this extension, we lift this restriction, allow them to be
9205bd8deadSopenharmony_ci      accessed using normal built-ins, and provide new functions allowing
9215bd8deadSopenharmony_ci      shaders to determine if uncommitted memory was accessed.
9225bd8deadSopenharmony_ci
9235bd8deadSopenharmony_ci    (8) How does the feedback provided in the "sparse" built-in texture
9245bd8deadSopenharmony_ci        functions interact with texture filtering modes involving multiple
9255bd8deadSopenharmony_ci        texels?
9265bd8deadSopenharmony_ci
9275bd8deadSopenharmony_ci      RESOLVED:  The sparse texture lookup status will indicate that
9285bd8deadSopenharmony_ci      uncommitted memory was accessed if any texel read during the filtering
9295bd8deadSopenharmony_ci      operation was uncommitted, but will do so only if the filter weight is
9305bd8deadSopenharmony_ci      non-zero.  When applying a texture filter such as LINEAR_MIPMAP_LINEAR,
9315bd8deadSopenharmony_ci      it's possible that the interpolated texture coordinate lines up exactly
9325bd8deadSopenharmony_ci      at the center of a texel and/or exactly at an integer level of detail.
9335bd8deadSopenharmony_ci      According to the standard filtering equations, eight samples are taken
9345bd8deadSopenharmony_ci      -- four in each of two levels.  However, it's possible that only one of
9355bd8deadSopenharmony_ci      the eight samples has a non-zero weight (if the coordinates hit a texel
9365bd8deadSopenharmony_ci      center and the LOD is an integer).
9375bd8deadSopenharmony_ci
9385bd8deadSopenharmony_ci      This "non-zero weight" feature may be important for getting proper
9395bd8deadSopenharmony_ci      feedback in some cases, such as displaying a texture tile with an
9405bd8deadSopenharmony_ci      aligned 1:1 mapping of pixels to texels or forcing a specific level of
9415bd8deadSopenharmony_ci      detail in some cases.  Note that when attempting to apply a 1:1 mapping
9425bd8deadSopenharmony_ci      of pixels to texels via an interpolated texture attribute, it's possible
9435bd8deadSopenharmony_ci      that small floating-point errors might produce very small but non-zero
9445bd8deadSopenharmony_ci      weights for neighboring texels.  If avoiding such errors is important
9455bd8deadSopenharmony_ci      and a 1:1 mapping is required, a single-sample filter like NEAREST
9465bd8deadSopenharmony_ci      should be used.
9475bd8deadSopenharmony_ci
9485bd8deadSopenharmony_ci    (9) Should we support sparse texel fetches and image loads for buffer
9495bd8deadSopenharmony_ci        textures?
9505bd8deadSopenharmony_ci
9515bd8deadSopenharmony_ci      RESOLVED:  Not in this extension.  This should be handled by a separate
9525bd8deadSopenharmony_ci      extension allowing for the creation and use of sparse buffer resources.
9535bd8deadSopenharmony_ci      Such an extension might also provide the ability to get "sparse"
9545bd8deadSopenharmony_ci      information when non-texture mechanisms are used to access memory (e.g.,
9555bd8deadSopenharmony_ci      ARB_shader_storage_buffer_object, NV_shader_buffer_load).
9565bd8deadSopenharmony_ci
9575bd8deadSopenharmony_ci    (10) Should we support "sparse" variants of the image atomic functions
9585bd8deadSopenharmony_ci         that return information on residency as well as the value normally
9595bd8deadSopenharmony_ci         returned by the atomic operation?
9605bd8deadSopenharmony_ci
9615bd8deadSopenharmony_ci      RESOLVED:  Not in this extension; it's not clear that there's an
9625bd8deadSopenharmony_ci      important use case for this.  If required, a shader can use imageLoad()
9635bd8deadSopenharmony_ci      to probe the residency of a given texel and ignore the data values
9645bd8deadSopenharmony_ci      returned.
9655bd8deadSopenharmony_ci
9665bd8deadSopenharmony_ci    (11) This extension is adding a *large* number of new built-in functions.
9675bd8deadSopenharmony_ci         What can we do to control this?
9685bd8deadSopenharmony_ci
9695bd8deadSopenharmony_ci      RESOLVED:  We chose not to add any "sparse" variants of
9705bd8deadSopenharmony_ci      projective texture lookups (e.g., textureProj).  If required, you can
9715bd8deadSopenharmony_ci      divide through by the "q" texture coordinate and use an equivalent
9725bd8deadSopenharmony_ci      non-projective lookup.
9735bd8deadSopenharmony_ci
9745bd8deadSopenharmony_ci      We considered the possibility of more significant GLSL syntax changes to
9755bd8deadSopenharmony_ci      reduce the cross-product of different features.  For example, the AMD
9765bd8deadSopenharmony_ci      extension has a function:
9775bd8deadSopenharmony_ci
9785bd8deadSopenharmony_ci        int sparseTextureProjGradOffset(...);
9795bd8deadSopenharmony_ci
9805bd8deadSopenharmony_ci      that combines four separate "optional" features (sparse, projection,
9815bd8deadSopenharmony_ci      explicitly specified gradients, and texel offsets) and is supported for
9825bd8deadSopenharmony_ci      six separate texture targets.  One might consider an approach like:
9835bd8deadSopenharmony_ci
9845bd8deadSopenharmony_ci        #define TEX_IS_PROJECTIVE       0x1
9855bd8deadSopenharmony_ci        #define TEX_HAS_GRADIENTS       0x2
9865bd8deadSopenharmony_ci        #define TEX_HAS_TEXEL_OFFSET    0x4
9875bd8deadSopenharmony_ci        #define TEX_WANTS_SPARSE_STATUS 0x8
9885bd8deadSopenharmony_ci        struct TexLookup3D {
9895bd8deadSopenharmony_ci          uint          flags;          /* in */
9905bd8deadSopenharmony_ci          float         q;              /* in */
9915bd8deadSopenharmony_ci          vec3          ddx, ddy;       /* in */
9925bd8deadSopenharmony_ci          ivec3         texelOffset;    /* in */
9935bd8deadSopenharmony_ci          int           sparseStatus;   /* out */
9945bd8deadSopenharmony_ci        };
9955bd8deadSopenharmony_ci        ...
9965bd8deadSopenharmony_ci        TexLookup3D lookup;
9975bd8deadSopenharmony_ci        lookup.flags = (TEX_IS_PROJECTIVE | TEX_HAS_GRADIENTS |
9985bd8deadSopenharmony_ci                        TEX_HAS_TEXEL_OFFSET | TEX_WANTS_SPARSE_STATUS);
9995bd8deadSopenharmony_ci        lookup.q = coords.w;
10005bd8deadSopenharmony_ci        lookup.ddx = ddx;
10015bd8deadSopenharmony_ci        lookup.ddy = ddy;
10025bd8deadSopenharmony_ci        lookup.texelOffset = ivec3(-1,+1,+2);
10035bd8deadSopenharmony_ci        texture(sampler, lookup);
10045bd8deadSopenharmony_ci
10055bd8deadSopenharmony_ci      to handle all possible cases in one interface.  Alternately, a
10065bd8deadSopenharmony_ci      "prettier" C++-style approach with methods on sampler classes could be
10075bd8deadSopenharmony_ci      used.
10085bd8deadSopenharmony_ci
10095bd8deadSopenharmony_ci      Given that either such feature might involve a large change to the
10105bd8deadSopenharmony_ci      shading language, it seems more appropriate to address this issue in a
10115bd8deadSopenharmony_ci      future core version of a shading language rather than an extension.
10125bd8deadSopenharmony_ci
10135bd8deadSopenharmony_ci    (12) How does the "reads produce zero" behave if a sparse texture is bound
10145bd8deadSopenharmony_ci         to a framebuffer and used for the depth or stencil test?
10155bd8deadSopenharmony_ci
10165bd8deadSopenharmony_ci      RESOLVED:  The depth and stencil tests act as though zero were read from
10175bd8deadSopenharmony_ci      the framebuffer.  The actual results of the tests depend on the depth
10185bd8deadSopenharmony_ci      and stencil functions, the incoming depth value, and the stencil
10195bd8deadSopenharmony_ci      reference value.
10205bd8deadSopenharmony_ci
10215bd8deadSopenharmony_ci      There may be cases where it might be advantageous to configure the depth
10225bd8deadSopenharmony_ci      or stencil tests to fail when touching an unpopulated portion of the
10235bd8deadSopenharmony_ci      depth/stencil buffer.  The "return zero" behavior may work well for some
10245bd8deadSopenharmony_ci      cases (e.g., returning zero when using a depth test of LESS will cause
10255bd8deadSopenharmony_ci      the test to almost always fail), but not as well for others (e.g., depth
10265bd8deadSopenharmony_ci      test of GREATER).  We've chosen not to address this case in the current
10275bd8deadSopenharmony_ci      extension.
10285bd8deadSopenharmony_ci
10295bd8deadSopenharmony_ci    (13) How does the "reads produce zero" behave for textures that don't have
10305bd8deadSopenharmony_ci         all four components?
10315bd8deadSopenharmony_ci
10325bd8deadSopenharmony_ci      RESOLVED:  Components that are present in the texture will return zero;
10335bd8deadSopenharmony_ci      others will return default values.  For example, an access to an
10345bd8deadSopenharmony_ci      uncommitted sparse texture whose with a format has no alpha component
10355bd8deadSopenharmony_ci      (e.g, RGB8) will return 1.0 on the alpha channel of the returned RGBA
10365bd8deadSopenharmony_ci      vector.  The handling of "missing" components is the same as for
10375bd8deadSopenharmony_ci      non-sparse textures.
10385bd8deadSopenharmony_ci
10395bd8deadSopenharmony_ci    (14) Should we provide standard sparse texture page sizes that
10405bd8deadSopenharmony_ci         applications can rely on without having to query the set of supported
10415bd8deadSopenharmony_ci         page sizes for each format it uses?  If so, how will this be handled?
10425bd8deadSopenharmony_ci         Will we have some formats that have standard sizes and others that
10435bd8deadSopenharmony_ci         don't?
10445bd8deadSopenharmony_ci
10455bd8deadSopenharmony_ci      RESOLVED: Yes; we will provide standard page sizes for some, but not
10465bd8deadSopenharmony_ci      all, formats.  However, we will still allow for implementation-
10475bd8deadSopenharmony_ci      dependent page sizes (as in ARB_sparse_textures) for formats that have a
10485bd8deadSopenharmony_ci      standard page size and allow implementations to support sparse textures
10495bd8deadSopenharmony_ci      on formats for which a standard page size is not available.  The basic
10505bd8deadSopenharmony_ci      page sizes we use arrange sparse textures into 64KB pages and attempt to
10515bd8deadSopenharmony_ci      keep the X and Y dimensions of the page roughly equal.
10525bd8deadSopenharmony_ci
10535bd8deadSopenharmony_ci    (15) Should we add specific compressed formats to the required formats list
10545bd8deadSopenharmony_ci         and provide standard page sizes?
10555bd8deadSopenharmony_ci
10565bd8deadSopenharmony_ci      RESOLVED:  Not in this extension.  Note that the current
10575bd8deadSopenharmony_ci      ARB_sparse_texture extension already allows implementations to support
10585bd8deadSopenharmony_ci      compressed formats.
10595bd8deadSopenharmony_ci
10605bd8deadSopenharmony_ci      We've chosen not to go to the trouble of enumerating standard page sizes
10615bd8deadSopenharmony_ci      for all the compressed formats (many of which are added by extension),
10625bd8deadSopenharmony_ci      but one logical approach would be to treat each 64- or 128-bit block in
10635bd8deadSopenharmony_ci      common formats as a single logical texel and treat the standard page
10645bd8deadSopenharmony_ci      sizes of 64- and 128-bit texels as being in units of compression blocks.
10655bd8deadSopenharmony_ci
10665bd8deadSopenharmony_ci    (16) How do applications get to use the standard page size?
10675bd8deadSopenharmony_ci
10685bd8deadSopenharmony_ci      RESOLVED:  Applications opt in to using standard page sizes by leaving
10695bd8deadSopenharmony_ci      VIRTUAL_PAGE_SIZE_INDEX_ARB at its initial value (zero).
10705bd8deadSopenharmony_ci
10715bd8deadSopenharmony_ci      In ARB_sparse_texture, there were no standard page sizes.  Applications
10725bd8deadSopenharmony_ci      can use GetInternalformativ() with <pname> of NUM_VIRTUAL_PAGE_SIZES_ARB
10735bd8deadSopenharmony_ci      to query the implementation-dependent number of page sizes supported for
10745bd8deadSopenharmony_ci      any given format.  Some formats may be unsupported, and the GL will
10755bd8deadSopenharmony_ci      return a page size count of zero.  Other formats may have a page size
10765bd8deadSopenharmony_ci      count of one, or more than one if the implementation supports multiple
10775bd8deadSopenharmony_ci      page sizes.  An application can query the properties of each page size
10785bd8deadSopenharmony_ci      index by calling GetInternalFormativ() with <pname> set to
10795bd8deadSopenharmony_ci      VIRTUAL_PAGE_SIZE_{X,Y,Z}_ARB.  When an application determines the page
10805bd8deadSopenharmony_ci      size it wants to use from the options returned by the GL, it sets the
10815bd8deadSopenharmony_ci      VIRTUAL_PAGE_SIZE_INDEX_ARB texture parameter prior to calling
10825bd8deadSopenharmony_ci      TexStorage* to allocate storage for the sparse texture.
10835bd8deadSopenharmony_ci
10845bd8deadSopenharmony_ci      If an application doesn't bother setting the VIRTUAL_PAGE_SIZE_INDEX_ARB
10855bd8deadSopenharmony_ci      texture parameter, the default index of zero will be used and the page
10865bd8deadSopenharmony_ci      size will be whatever the implementation chooses for its first page size
10875bd8deadSopenharmony_ci      index.  In the absence of this extension, the application still needs to
10885bd8deadSopenharmony_ci      call GetInternalFormativ() to determine the page size being used so it
10895bd8deadSopenharmony_ci      can manage texture residency. But in the presence of this extension, page
10905bd8deadSopenharmony_ci      size index 0 will be a standard size and will be the same on all
10915bd8deadSopenharmony_ci      implementations supporting the extension.
10925bd8deadSopenharmony_ci
10935bd8deadSopenharmony_ci    (17) Should we support sparse multisample textures?  If so, should we
10945bd8deadSopenharmony_ci         support standard virtual page sizes?
10955bd8deadSopenharmony_ci
10965bd8deadSopenharmony_ci      RESOLVED:  Yes, we add will support for sparse multisample textures, but
10975bd8deadSopenharmony_ci      will not specify standard page sizes.
10985bd8deadSopenharmony_ci
10995bd8deadSopenharmony_ci      Different implementations of this extension may represent multisample
11005bd8deadSopenharmony_ci      textures in different ways.  Some implementations might interleave
11015bd8deadSopenharmony_ci      samples in memory, while others might have separate "planes" in memory
11025bd8deadSopenharmony_ci      for each individual sample.  If we were to support a standard page size,
11035bd8deadSopenharmony_ci      the easiest approach might be to have a greatest-common-multiple
11045bd8deadSopenharmony_ci      standard page size.  For example, the standard page size for
11055bd8deadSopenharmony_ci      single-sample textures with 32-bit texels is 128x128 (64KB total).  We
11065bd8deadSopenharmony_ci      could choose to use the same page size for multisample textures.  For 4x
11075bd8deadSopenharmony_ci      multisample, a page of 128x128 pixels would have an effective page size
11085bd8deadSopenharmony_ci      of 256KB.  If an implementation interleaves samples, each virtual page
11095bd8deadSopenharmony_ci      might be assembled from four consecutive 64K physical pages.  If an
11105bd8deadSopenharmony_ci      implementation has separate "planes", the virtual page might be
11115bd8deadSopenharmony_ci      assembled from four 64K physical pages spread out in memory.
11125bd8deadSopenharmony_ci
11135bd8deadSopenharmony_ci    (18) Should we require support for sparse depth or stencil textures?
11145bd8deadSopenharmony_ci         Sparse support for these formats is optional in ARB_sparse_texture.
11155bd8deadSopenharmony_ci         If so, should we support standard virtual page sizes?
11165bd8deadSopenharmony_ci
11175bd8deadSopenharmony_ci      RESOLVED:  Not in this extension.
11185bd8deadSopenharmony_ci
11195bd8deadSopenharmony_ci      The current ARB_sparse_texture extension already allows implementations
11205bd8deadSopenharmony_ci      to support sparse depth/stencil formats, so the only things a change
11215bd8deadSopenharmony_ci      could accomplish is (a) provide standard page sizes that can be used
11225bd8deadSopenharmony_ci      without querying implementation page sizes, (b) ensure that apps can
11235bd8deadSopenharmony_ci      rely on *some* support by just checking the extension without querying
11245bd8deadSopenharmony_ci      the number of supported page sizes via GetInternalFormat.
11255bd8deadSopenharmony_ci
11265bd8deadSopenharmony_ci      We expect that different implementations may store depth and stencil
11275bd8deadSopenharmony_ci      textures in different ways and might have different "natural" page
11285bd8deadSopenharmony_ci      sizes.  We could deal with this by using a greatest-common-multiple
11295bd8deadSopenharmony_ci      standard page size (i.e., have a standard page size larger than 64K),
11305bd8deadSopenharmony_ci      but it's not clear if that will fly.
11315bd8deadSopenharmony_ci
11325bd8deadSopenharmony_ci      The advantages of (b) seem low relative to (a), so we aren't proposing
11335bd8deadSopenharmony_ci      to add depth and stencil formats to the required list for this
11345bd8deadSopenharmony_ci      extension.
11355bd8deadSopenharmony_ci
11365bd8deadSopenharmony_ci    (19) Should we make a separate extension for the LOD clamp GLSL functions?
11375bd8deadSopenharmony_ci
11385bd8deadSopenharmony_ci      RESOLVED:  Yes. See ARB_sparse_texture_clamp.
11395bd8deadSopenharmony_ci
11405bd8deadSopenharmony_ci    (20) Should we reconsider re-examining some of the non-orthogonalities in
11415bd8deadSopenharmony_ci         the current set of texture built-ins, which are being extended for
11425bd8deadSopenharmony_ci         sparse.  For example, the texture() built-in for a sampler type of
11435bd8deadSopenharmony_ci         samplerCubeArrayShadow does not include an optional LOD bias despite
11445bd8deadSopenharmony_ci         the fact that cubemap arrays do support multiple LODs.
11455bd8deadSopenharmony_ci
11465bd8deadSopenharmony_ci      RESOLVED:  Not in this extension.
11475bd8deadSopenharmony_ci
11485bd8deadSopenharmony_ci      We chose to create "sparse" variants of existing built-ins without
11495bd8deadSopenharmony_ci      re-examining current capabilities.  It might make sense to have an
11505bd8deadSopenharmony_ci      extension or future core shading language re-examine things and improve
11515bd8deadSopenharmony_ci      orthogonality if implementations can support it.
11525bd8deadSopenharmony_ci
11535bd8deadSopenharmony_ciRevision History
11545bd8deadSopenharmony_ci
11555bd8deadSopenharmony_ci    Revision 1
11565bd8deadSopenharmony_ci      - Branched from EXT_sparse_texture2
11575bd8deadSopenharmony_ci
11585bd8deadSopenharmony_ci    Revision 2
11595bd8deadSopenharmony_ci      - Split clamp functions into ARB_sparse_texture_clamp
11605bd8deadSopenharmony_ci
11615bd8deadSopenharmony_ci    Revision 3
11625bd8deadSopenharmony_ci      - Remove pre-defined page sizes for 3D textures
1163