15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_sparse_texture
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_sparse_texture
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Dominik Witczak, Mobica
125bd8deadSopenharmony_ci    Contributors to ARB_sparse_texture
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ci    Xi Chen, NVIDIA
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ciContact
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ci    Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com)
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ciNotice
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ci    Copyright (c) 2013 The Khronos Group Inc. Copyright terms at
235bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
245bd8deadSopenharmony_ci
255bd8deadSopenharmony_ci    Portions Copyright (c) 2014 NVIDIA Corporation.
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciStatus
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    Complete.
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciVersion
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    Last Modified Date:         27/03/2015
345bd8deadSopenharmony_ci    Revision:                   3
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciNumber
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    OpenGL ES Extension #240
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciDependencies
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    OpenGL ES 3.1 is required.
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    This extension is written against the OpenGL ES 3.1 (June 4, 2014)
455bd8deadSopenharmony_ci    Specification.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    This extension interacts with OES_texture_border_clamp.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    This extension interacts with EXT_texture_border_clamp.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    This extension interacts with OES_texture_cube_map_array.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension interacts with EXT_texture_cube_map_array.
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    This extension interacts with OES_texture_view.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    This extension interacts with EXT_texture_view.
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    This extension interacts with EXT_texture_norm16.
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    The definition of this extension is affected by the presence of
625bd8deadSopenharmony_ci    EXT_direct_state_access.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ciOverview
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    Recent advances in application complexity and a desire for higher
675bd8deadSopenharmony_ci    resolutions have pushed texture sizes up considerably. Often, the amount
685bd8deadSopenharmony_ci    of physical memory available to a graphics processor is a limiting factor
695bd8deadSopenharmony_ci    in the performance of texture-heavy applications. Once the available
705bd8deadSopenharmony_ci    physical memory is exhausted, paging may occur bringing performance down
715bd8deadSopenharmony_ci    considerably - or worse, the application may fail. Nevertheless, the amount
725bd8deadSopenharmony_ci    of address space available to the graphics processor has increased to the
735bd8deadSopenharmony_ci    point where many gigabytes - or even terabytes of address space may be
745bd8deadSopenharmony_ci    usable even though that amount of physical memory is not present.
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    This extension allows the separation of the graphics processor's address
775bd8deadSopenharmony_ci    space (reservation) from the requirement that all textures must be
785bd8deadSopenharmony_ci    physically backed (commitment). This exposes a limited form of
795bd8deadSopenharmony_ci    virtualization for textures. Use cases include sparse (or partially
805bd8deadSopenharmony_ci    resident) textures, texture paging, on-demand and delayed loading of
815bd8deadSopenharmony_ci    texture assets and application controlled level of detail.
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciNew Procedures and Functions
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci        void TexPageCommitmentEXT(enum target,
865bd8deadSopenharmony_ci                                  int level,
875bd8deadSopenharmony_ci                                  int xoffset,
885bd8deadSopenharmony_ci                                  int yoffset,
895bd8deadSopenharmony_ci                                  int zoffset,
905bd8deadSopenharmony_ci                                  sizei width,
915bd8deadSopenharmony_ci                                  sizei height,
925bd8deadSopenharmony_ci                                  sizei depth,
935bd8deadSopenharmony_ci                                  boolean commit);
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    [[ The following is only added if EXT_direct_state_access is supported. ]]
965bd8deadSopenharmony_ci
975bd8deadSopenharmony_ci        void TexturePageCommitmentEXT(uint texture,
985bd8deadSopenharmony_ci                                      int level,
995bd8deadSopenharmony_ci                                      int xoffset,
1005bd8deadSopenharmony_ci                                      int yoffset,
1015bd8deadSopenharmony_ci                                      int zoffset,
1025bd8deadSopenharmony_ci                                      sizei width,
1035bd8deadSopenharmony_ci                                      sizei height,
1045bd8deadSopenharmony_ci                                      sizei depth,
1055bd8deadSopenharmony_ci                                      boolean commit);
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ciNew Tokens
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci    Accepted by the <pname> parameter to TexParameter{if}{v},
1105bd8deadSopenharmony_ci    GetTexParameter{if}v, TexParameterI{u}ivOES, GetTexParameterI{u}ivOES
1115bd8deadSopenharmony_ci    TexParameterI{u}ivEXT, and GetTexParameterI{u}ivEXT:
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci        TEXTURE_SPARSE_EXT                          0x91A6
1145bd8deadSopenharmony_ci        VIRTUAL_PAGE_SIZE_INDEX_EXT                 0x91A7
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetTexParameter{if}v,
1175bd8deadSopenharmony_ci    GetTexParameterIi{u}vOES, and GetTexParameterIi{u}vEXT:
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci        NUM_SPARSE_LEVELS_EXT                       0x91AA
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    Accepted by the <pname> parameter to GetInternalformativ:
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci        NUM_VIRTUAL_PAGE_SIZES_EXT                  0x91A8
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci        VIRTUAL_PAGE_SIZE_X_EXT                     0x9195
1265bd8deadSopenharmony_ci        VIRTUAL_PAGE_SIZE_Y_EXT                     0x9196
1275bd8deadSopenharmony_ci        VIRTUAL_PAGE_SIZE_Z_EXT                     0x9197
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    Accepted by the <target> parameter to GetInternalformativ:
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci        TEXTURE_2D                                  0x0DE1
1325bd8deadSopenharmony_ci        TEXTURE_2D_ARRAY                            0x8C1A
1335bd8deadSopenharmony_ci        TEXTURE_CUBE_MAP                            0x8513
1345bd8deadSopenharmony_ci        TEXTURE_CUBE_MAP_ARRAY_OES                  0x9009
1355bd8deadSopenharmony_ci        TEXTURE_3D                                  0x806F
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    Accepted by the <pname> parameter to GetIntegerv, GetFloatv,
1385bd8deadSopenharmony_ci    GetInteger64v, and GetBooleanv:
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci        MAX_SPARSE_TEXTURE_SIZE_EXT                 0x9198
1415bd8deadSopenharmony_ci        MAX_SPARSE_3D_TEXTURE_SIZE_EXT              0x9199
1425bd8deadSopenharmony_ci        MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT         0x919A
1435bd8deadSopenharmony_ci        SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT  0x91A9
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL ES 3.1 Specification (Textures and
1465bd8deadSopenharmony_ciSamplers)
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    Add the "Supports Sparse Allocation" column to Table 8.13, "Correspondence
1495bd8deadSopenharmony_ci    of sized internal color formats..."
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci        +-------------------------------+-------------------------------+
1525bd8deadSopenharmony_ci        | Sized Internal Format         | Supports Sparse Allocation    |
1535bd8deadSopenharmony_ci        +-------------------------------+-------------------------------+
1545bd8deadSopenharmony_ci        | R8                            | Y                             |
1555bd8deadSopenharmony_ci        | R8_SNORM                      | Y                             |
1565bd8deadSopenharmony_ci        | R16_EXT                       | Y                             |
1575bd8deadSopenharmony_ci        | R16_SNORM_EXT                 | Y                             |
1585bd8deadSopenharmony_ci        | RG8                           | Y                             |
1595bd8deadSopenharmony_ci        | RG8_SNORM                     | Y                             |
1605bd8deadSopenharmony_ci        | RG16_EXT                      | Y                             |
1615bd8deadSopenharmony_ci        | RG16_SNORM_EXT                | Y                             |
1625bd8deadSopenharmony_ci        | RGB565                        | Y                             |
1635bd8deadSopenharmony_ci        | RGB8                          |                               |
1645bd8deadSopenharmony_ci        | RGB8_SNORM                    |                               |
1655bd8deadSopenharmony_ci        | RGB16_EXT                     |                               |
1665bd8deadSopenharmony_ci        | RGB16_SNORM_EXT               |                               |
1675bd8deadSopenharmony_ci        | RGBA4                         |                               |
1685bd8deadSopenharmony_ci        | RGB5_A1                       |                               |
1695bd8deadSopenharmony_ci        | RGBA8                         | Y                             |
1705bd8deadSopenharmony_ci        | RGBA8_SNORM                   | Y                             |
1715bd8deadSopenharmony_ci        | RGB10_A2                      | Y                             |
1725bd8deadSopenharmony_ci        | RGB10_A2UI                    | Y                             |
1735bd8deadSopenharmony_ci        | RGBA16_EXT                    | Y                             |
1745bd8deadSopenharmony_ci        | RGBA16_SNORM_EXT              | Y                             |
1755bd8deadSopenharmony_ci        | SRGB8                         |                               |
1765bd8deadSopenharmony_ci        | SRGB8_ALPHA8                  |                               |
1775bd8deadSopenharmony_ci        | R16F                          | Y                             |
1785bd8deadSopenharmony_ci        | RG16F                         | Y                             |
1795bd8deadSopenharmony_ci        | RGB16F                        |                               |
1805bd8deadSopenharmony_ci        | RGBA16F                       | Y                             |
1815bd8deadSopenharmony_ci        | R32F                          | Y                             |
1825bd8deadSopenharmony_ci        | RG32F                         | Y                             |
1835bd8deadSopenharmony_ci        | RGB32F                        |                               |
1845bd8deadSopenharmony_ci        | RGBA32F                       | Y                             |
1855bd8deadSopenharmony_ci        | R11F_G11F_B10F                | Y                             |
1865bd8deadSopenharmony_ci        | RGB9_E5                       | Y                             |
1875bd8deadSopenharmony_ci        | R8I                           | Y                             |
1885bd8deadSopenharmony_ci        | R8UI                          | Y                             |
1895bd8deadSopenharmony_ci        | R16I                          | Y                             |
1905bd8deadSopenharmony_ci        | R16UI                         | Y                             |
1915bd8deadSopenharmony_ci        | R32I                          | Y                             |
1925bd8deadSopenharmony_ci        | R32UI                         | Y                             |
1935bd8deadSopenharmony_ci        | RG8I                          | Y                             |
1945bd8deadSopenharmony_ci        | RG8UI                         | Y                             |
1955bd8deadSopenharmony_ci        | RG16I                         | Y                             |
1965bd8deadSopenharmony_ci        | RG16UI                        | Y                             |
1975bd8deadSopenharmony_ci        | RG32I                         | Y                             |
1985bd8deadSopenharmony_ci        | RG32UI                        | Y                             |
1995bd8deadSopenharmony_ci        | RGB8I                         |                               |
2005bd8deadSopenharmony_ci        | RGB8UI                        |                               |
2015bd8deadSopenharmony_ci        | RGB16I                        |                               |
2025bd8deadSopenharmony_ci        | RGB16UI                       |                               |
2035bd8deadSopenharmony_ci        | RGB32I                        |                               |
2045bd8deadSopenharmony_ci        | RGB32UI                       |                               |
2055bd8deadSopenharmony_ci        | RGBA8I                        | Y                             |
2065bd8deadSopenharmony_ci        | RGBA8UI                       | Y                             |
2075bd8deadSopenharmony_ci        | RGBA16I                       | Y                             |
2085bd8deadSopenharmony_ci        | RGBA16UI                      | Y                             |
2095bd8deadSopenharmony_ci        | RGBA32I                       | Y                             |
2105bd8deadSopenharmony_ci        | RGBA32UI                      | Y                             |
2115bd8deadSopenharmony_ci        +-------------------------------+-------------------------------+
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ci    Insert the following paragraph before Table 8.16:
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci        If <pname> is TEXTURE_SPARSE_EXT or VIRTUAL_PAGE_SIZE_INDEX_EXT, then
2165bd8deadSopenharmony_ci    the state is stored in the texture, but only takes effect the next time
2175bd8deadSopenharmony_ci    storage is allocated for a texture using TexStorage*. If the value of
2185bd8deadSopenharmony_ci    TEXTURE_IMMUTABLE_FORMAT is TRUE, then TEXTURE_SPARSE_EXT and
2195bd8deadSopenharmony_ci    VIRTUAL_PAGE_SIZE_INDEX_EXT cannot be changed and an error is generated.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    Append to Table 8.20: "Texture parameters and their values."
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci      +------------------------------+---------+---------------------------+
2245bd8deadSopenharmony_ci      | Name                         | Type    | Legal values              |
2255bd8deadSopenharmony_ci      +------------------------------+---------+---------------------------+
2265bd8deadSopenharmony_ci      | TEXTURE_SPARSE_EXT           | boolean | TRUE, FALSE               |
2275bd8deadSopenharmony_ci      | VIRTUAL_PAGE_SIZE_INDEX_EXT  | int     | any non-negative integer  |
2285bd8deadSopenharmony_ci      +------------------------------+---------+---------------------------+
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    Add to the Errors table for TexParameter*
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci        INVALID_OPERATION is generated if <pname> is TEXTURE_SPARSE_EXT or
2335bd8deadSopenharmony_ci    VIRTUAL_PAGE_SIZE_INDEX_EXT and the value of TEXTURE_IMMUTABLE_FORMAT for
2345bd8deadSopenharmony_ci    the texture identified by <target> is TRUE.
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci        INVALID_VALUE is generated if <pname> is TEXTURE_SPARSE_EXT, <pname>
2375bd8deadSopenharmony_ci    is TRUE and <target> is not one of TEXTURE_2D, TEXTURE_2D_ARRAY,
2385bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP, TEXTURE_CUBE_MAP_ARRAY_OES, or TEXTURE_3D.
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ci    Additions to Section 8.16view (Texture Views), of the OpenGL ES
2415bd8deadSopenharmony_ci    Specification (as added by OES_texture_view or EXT_texture_view):
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci        Texture views may be created that reference sparse textures (see
2445bd8deadSopenharmony_ci    Section 8.17sparse.1), and in such cases, the view is considered to be sparse.
2455bd8deadSopenharmony_ci    Should a texture view reference part or all of the tail of a sparse
2465bd8deadSopenharmony_ci    texture, then modifications to the commitment of that tail via the view
2475bd8deadSopenharmony_ci    affect the tail of the parent texture and all other views that reference
2485bd8deadSopenharmony_ci    the tail, even for portions of the tail outside the controlling view.
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    Additions to Section 8.17 of the OpenGL Specification, "Immutable-Format
2515bd8deadSopenharmony_ci    Texture Images"
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci    Add the following bullet point to the list of psuedo-operations performed
2545bd8deadSopenharmony_ci    by all variants of TexStorage* (p.188):
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci        * If TEXTURE_SPARSE_EXT is TRUE, only virtual address space is
2575bd8deadSopenharmony_ci          allocated for the texture but physical backing store is not.
2585bd8deadSopenharmony_ci          Physical store for pages of a virtual texture may be committed and
2595bd8deadSopenharmony_ci          decommitted by calling TexPageCommitmentEXT. The page size chosen
2605bd8deadSopenharmony_ci          for the texture is taken from the texture's value of
2615bd8deadSopenharmony_ci          VIRTUAL_PAGE_SIZE_INDEX_EXT. In this case, <width>, <height> and
2625bd8deadSopenharmony_ci          <depth> must either be integer multiples of the selected virtual
2635bd8deadSopenharmony_ci          page size in the X, Y and Z dimensions, respectively, or be less
2645bd8deadSopenharmony_ci          than those dimensions. Additionally, the dimensions of sparse
2655bd8deadSopenharmony_ci          textures must be compatible with the chosen value of
2665bd8deadSopenharmony_ci          <internalFormat> as described in Section 8.17sparse.1.
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci    Add to the errors that may be generated by TexStorage*:
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci        An INVALID_OPERATION error is generated if the texture's
2715bd8deadSopenharmony_ci        TEXTURE_SPARSE_EXT parameter is TRUE and the value of its
2725bd8deadSopenharmony_ci        VIRTUAL_PAGE_SIZE_INDEX_EXT parameter is greater than or equal to
2735bd8deadSopenharmony_ci        NUM_VIRTUAL_PAGE_SIZES_EXT for the specified target and internal
2745bd8deadSopenharmony_ci        format.
2755bd8deadSopenharmony_ci
2765bd8deadSopenharmony_ci        An INVALID_VALUE error is generated if the texture's TEXTURE_SPARSE_EXT
2775bd8deadSopenharmony_ci        parameter is TRUE and any of the following are true:
2785bd8deadSopenharmony_ci
2795bd8deadSopenharmony_ci          * <target> is TEXTURE_3D, and <width>, <height>, or <depth>
2805bd8deadSopenharmony_ci            is greater than MAX_SPARSE_3D_TEXTURE_SIZE_EXT;
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci          * <target> is not TEXTURE_3D, and <width> or <height> is greater
2835bd8deadSopenharmony_ci            than MAX_SPARSE_TEXTURE_SIZE_EXT; or
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci          * <target> is TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP_ARRAY_OES and
2865bd8deadSopenharmony_ci            <depth> is greater than MAX_SPARSE_TEXTURE_ARRAY_LAYERS_EXT.
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci        An INVALID_VALUE error is generated if the texture's
2895bd8deadSopenharmony_ci        TEXTURE_SPARSE_EXT parameter is TRUE and <width> or <height> is greater
2905bd8deadSopenharmony_ci        than the value of MAX_SPARSE_3D_TEXTURE_SIZE_EXT when <target> is
2915bd8deadSopenharmony_ci        TEXTURE_3D, or if <height> or <depth> is greater than the value of
2925bd8deadSopenharmony_ci        MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT if <target> is a 2D array
2935bd8deadSopenharmony_ci        texture target, respectively.
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci        An INVALID_VALUE error is generated if TEXTURE_SPARSE_EXT is TRUE and
2965bd8deadSopenharmony_ci        <width>, <height> or <depth> is is not an integer multiple of the
2975bd8deadSopenharmony_ci        page size in the corresponding dimension.
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci        If the value of SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT is FALSE,
3005bd8deadSopenharmony_ci        then TexStorage* will generate an INVALID_OPERATION error if
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci          * the texture's TEXTURE_SPARSE_EXT parameter is TRUE,
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci          * <target> is one of TEXTURE_2D_ARRAY, TEXTURE_CUBE_MAP, or
3055bd8deadSopenharmony_ci            TEXTURE_CUBE_MAP_ARRAY_OES, and
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ci          * for the virtual page size corresponding to the
3085bd8deadSopenharmony_ci            VIRTUAL_PAGE_SIZE_INDEX_EXT parameter, either of the following is
3095bd8deadSopenharmony_ci            true:
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci              - <width> is not a multiple of VIRTUAL_PAGE_SIZE_X_EXT *
3125bd8deadSopenharmony_ci                 2^(<levels>-1), or
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci              - <height> is not a multiple of VIRTUAL_PAGE_SIZE_Y_EXT *
3155bd8deadSopenharmony_ci                 2^(<levels>-1).
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    Insert Section 8.17sparse, "Sparse Textures and Commitment"
3185bd8deadSopenharmony_ci    following section 8.17 "Immutable-Format Texture Images".
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ci        Textures may be allocated such that their images' physical backing
3215bd8deadSopenharmony_ci    store is only partially allocated. Only immutable format textures may
3225bd8deadSopenharmony_ci    be sparsely allocated. To allocate a sparse texture, set a texture's
3235bd8deadSopenharmony_ci    TEXTURE_SPARSE_EXT parameter to TRUE before allocating storage for it
3245bd8deadSopenharmony_ci    with TexStorage*.
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci    Insert Subsection 8.17sparse.1, "Allocation of and Access to Sparse Textures"
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci        Sparse textures are allocated setting a texture's TEXTURE_SPARSE_EXT
3295bd8deadSopenharmony_ci    parameter to TRUE and then issuing one of the TexStorage* commands.
3305bd8deadSopenharmony_ci    The dimensions of a sparse texture must be compatible with the internal
3315bd8deadSopenharmony_ci    format chosen for the texture. Each internal format has zero or more
3325bd8deadSopenharmony_ci    sparse page sizes that may be selected. The number of available page sizes
3335bd8deadSopenharmony_ci    for an internal format and the dimensions of the pages may be determined
3345bd8deadSopenharmony_ci    by calling GetInternalFormat* with the <pname> NUM_VIRTUAL_PAGE_SIZES_EXT
3355bd8deadSopenharmony_ci    (for the number of available page sizes), VIRTUAL_PAGE_SIZE_X_EXT,
3365bd8deadSopenharmony_ci    VIRTUAL_PAGE_SIZE_Y_EXT or VIRTUAL_PAGE_SIZE_Z_EXT (for the virtual
3375bd8deadSopenharmony_ci    page widths, heights and depths, respectively). Not all internal formats
3385bd8deadSopenharmony_ci    support sparse allocation. For those formats, the value of
3395bd8deadSopenharmony_ci    NUM_VIRTUAL_PAGE_SIZES_EXT will be zero. The internal formats which are
3405bd8deadSopenharmony_ci    guaranteed to support sparse allocation is listed in Table 8.13. Formats
3415bd8deadSopenharmony_ci    not listed as supported in Table 8.13 may still be supported by some
3425bd8deadSopenharmony_ci    implementations.
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ci        The VIRTUAL_PAGE_SIZE_INDEX_EXT may be used to select the page layout for
3455bd8deadSopenharmony_ci    a sparse texture. The value of the texture's VIRTUAL_PAGE_SIZE_INDEX_EXT
3465bd8deadSopenharmony_ci    parameter is treated as an index into the array of possible page sizes
3475bd8deadSopenharmony_ci    for the type and requested internal format of the texture, and matches
3485bd8deadSopenharmony_ci    index of the array of values returned for the VIRTUAL_PAGE_SIZE_{XYZ}_EXT
3495bd8deadSopenharmony_ci    internal format query.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci        When a sparsely committed texture is accessed by the GL, accesses that
3525bd8deadSopenharmony_ci    require only samples contained in committed regions complete as normal.
3535bd8deadSopenharmony_ci    For operations that access samples from uncommitted regions produce
3545bd8deadSopenharmony_ci    the following behavior:
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci        * Reads from such regions produce undefined data, but otherwise have
3575bd8deadSopenharmony_ci          no adverse effect. This includes samples required for the
3585bd8deadSopenharmony_ci          implementation of texture filtering, mipmap generation and so on.
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci        * Writes to such regions are ignored. The GL may attempt to write to
3615bd8deadSopenharmony_ci          uncommitted regions but the effect of doing so will be benign.
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci        * Atomic operations with return values on uncommitted regions will
3645bd8deadSopenharmony_ci          complete normally, but the returned value will be undefined and the
3655bd8deadSopenharmony_ci          result of the atomic operation will be discarded.
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci        * Reads and writes through framebuffers shall have no adverse effect,
3685bd8deadSopenharmony_ci          but fragment shaders corresponding to uncommitted regions of the
3695bd8deadSopenharmony_ci          framebuffer still execute to completion. Visible side effects
3705bd8deadSopenharmony_ci          of these shaders such as operations on atomic counters, storage
3715bd8deadSopenharmony_ci          blocks or committed regions of images are still seen, as are
3725bd8deadSopenharmony_ci          the results of operations such as occlusion queries.
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci        * Access to uncommitted regions by the client (for example through
3755bd8deadSopenharmony_ci          ReadPixels) shall have similar effect as through any
3765bd8deadSopenharmony_ci          other part of the GL --- reads return undefined data and writes are
3775bd8deadSopenharmony_ci          discarded, with no other ill effect.
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci    Insert Subsection 8.17sparse.2. "Controlling Sparse Texture Commitment"
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci        If a texture is allocated using sparse storage (that is, its
3825bd8deadSopenharmony_ci    TEXTURE_SPARSE_EXT parameter is TRUE at the time that its storage is
3835bd8deadSopenharmony_ci    allocated), it is initially created with only a virtual data store, and no
3845bd8deadSopenharmony_ci    physical data store. Individual pages of a sparse texture may be made
3855bd8deadSopenharmony_ci    resident or non-resident by calling
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci        void TexPageCommitmentEXT(enum target,
3885bd8deadSopenharmony_ci                                  int level,
3895bd8deadSopenharmony_ci                                  int xoffset,
3905bd8deadSopenharmony_ci                                  int yoffset,
3915bd8deadSopenharmony_ci                                  int zoffset,
3925bd8deadSopenharmony_ci                                  sizei width,
3935bd8deadSopenharmony_ci                                  sizei height,
3945bd8deadSopenharmony_ci                                  sizei depth,
3955bd8deadSopenharmony_ci                                  boolean commit);
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci    with <target> and <level> indicating the level of the texture object whose
3985bd8deadSopenharmony_ci    residency is to be modified. <xoffset>, <yoffset>, <zoffset>, <width>,
3995bd8deadSopenharmony_ci    <height> and <depth> are interpreted as they are in TexSubImage3D.  An
4005bd8deadSopenharmony_ci    error will be generated unless <xoffset>, <yoffset> <zoffset>, <width>,
4015bd8deadSopenharmony_ci    <height> and <depth> specify a region of the texture level that is aligned
4025bd8deadSopenharmony_ci    to multiples of the page size or to the edges of the texture.
4035bd8deadSopenharmony_ci
4045bd8deadSopenharmony_ci    If the value of <commit> is TRUE, then the texture pages contained in
4055bd8deadSopenharmony_ci    the region defined by the values of <xoffset>, <yoffset>, <zoffset>,
4065bd8deadSopenharmony_ci    <width>, <height> and <depth> are committed. If they were not committed
4075bd8deadSopenharmony_ci    before the call, then new physical backing store is allocated and associated
4085bd8deadSopenharmony_ci    with the sparse pages and their initial content is undefined. If the pages
4095bd8deadSopenharmony_ci    were already committed, then they remain committed, no error is generated,
4105bd8deadSopenharmony_ci    and the content of those pages remains unmodified. If the value of
4115bd8deadSopenharmony_ci    <committed> is FALSE, then the texture pages contained in the region are
4125bd8deadSopenharmony_ci    made de-committed. Their physical store is de-allocated, and their contents
4135bd8deadSopenharmony_ci    again become undefined.
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci    For the purposes of commitment, a cube map texture is treated as a 2D
4165bd8deadSopenharmony_ci    array texture with a depth of six and cube map array textures are treated
4175bd8deadSopenharmony_ci    as 2D array textures with a depth equal to six times the number of layers
4185bd8deadSopenharmony_ci    in the cube map array.
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    For levels of a sparse texture where each dimension is a multiple of the
4215bd8deadSopenharmony_ci    virtual page size, the residency of individual page-size regions is
4225bd8deadSopenharmony_ci    controlled by TexPageCommitmentEXT and such levels may be partially
4235bd8deadSopenharmony_ci    populated.  When the mipmap chain reaches a level that is not an integer
4245bd8deadSopenharmony_ci    multiple of the virtual page size in any dimension, padding and memory
4255bd8deadSopenharmony_ci    layout considerations may make it impossible to treat that level and
4265bd8deadSopenharmony_ci    subsequent smaller ones as partially populated.  The set of levels that
4275bd8deadSopenharmony_ci    can be partially populated is implementation-dependent.  The total number
4285bd8deadSopenharmony_ci    of levels that may be partially populated may be queried by calling
4295bd8deadSopenharmony_ci    GetTexParameter* with the <pname> NUM_SPARSE_LEVELS_EXT.
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci    The collection of texture levels that may not be partially populated, if
4325bd8deadSopenharmony_ci    any, consists of levels NUM_SPARSE_LEVELS_EXT and higher, and is referred
4335bd8deadSopenharmony_ci    to as the mipmap 'tail'.  The levels comprising the tail are made resident
4345bd8deadSopenharmony_ci    or non-resident as a unit.  The tail is resident if and only if
4355bd8deadSopenharmony_ci    TexPageCommitmentEXT has been called successfully with <level> greater
4365bd8deadSopenharmony_ci    than or equal to NUM_SPARSE_LEVELS_EXT and the value of <commit> was TRUE
4375bd8deadSopenharmony_ci    for the last such call.
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci    Views of sparse textures are also considered sparse. Modifications to
4405bd8deadSopenharmony_ci    commitment of a texture via a view of it affect the parent texture and
4415bd8deadSopenharmony_ci    any other views containing the modified pages. If a view of a sparse
4425bd8deadSopenharmony_ci    texture references its tail (or is entirely contained within it),
4435bd8deadSopenharmony_ci    modifications to commitment of the tail via the view will affect the entire
4445bd8deadSopenharmony_ci    tail of the parent, even for parts of the tail that are not referenced
4455bd8deadSopenharmony_ci    by the view. Furthermore, modifications to tail commitment may affect
4465bd8deadSopenharmony_ci    views referencing other parts of the tail.
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ci    Errors
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci      An INVALID_OPERATION error is generated if <xoffset> + <width> or
4515bd8deadSopenharmony_ci      <yoffset> + <height> is greater than the width or height, respectively,
4525bd8deadSopenharmony_ci      of level <level> of the texture bound to <target>.
4535bd8deadSopenharmony_ci
4545bd8deadSopenharmony_ci      An INVALID_OPERATION error is generated if <zoffset> + <depth> is
4555bd8deadSopenharmony_ci      greater than
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ci        * the depth of level <level> of the texture bound to <target>, if
4585bd8deadSopenharmony_ci          <target> is TEXTURE_3D;
4595bd8deadSopenharmony_ci
4605bd8deadSopenharmony_ci        * the number of layers of level <level> of the texture bound to
4615bd8deadSopenharmony_ci          <target>, if <target> is TEXTURE_2D_ARRAY;
4625bd8deadSopenharmony_ci
4635bd8deadSopenharmony_ci        * six times the number of layers of level <level> of the texture bound
4645bd8deadSopenharmony_ci          to <target>, if <target> is TEXTURE_CUBE_MAP_ARRAY_OES; or
4655bd8deadSopenharmony_ci
4665bd8deadSopenharmony_ci        * one, for all other targets.
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci      An INVALID_VALUE error is generated if <xoffset>, <yoffset>, or
4695bd8deadSopenharmony_ci      <zoffset> is not a multiple of VIRTUAL_PAGE_SIZE_X_EXT,
4705bd8deadSopenharmony_ci      VIRTUAL_PAGE_SIZE_Y_EXT, or VIRTUAL_PAGE_SIZE_Z_EXT, respectively, of
4715bd8deadSopenharmony_ci      the texture bound to <target>.
4725bd8deadSopenharmony_ci
4735bd8deadSopenharmony_ci      An INVALID_OPERATION error is generated if <width> is not an integer
4745bd8deadSopenharmony_ci      multiple of VIRTUAL_PAGE_SIZE_X_EXT and <width> plus <xoffset> is not
4755bd8deadSopenharmony_ci      equal to the width of level <level> of the texture bound to <target>.
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci      An INVALID_OPERATION error is generated if <height> is not an integer
4785bd8deadSopenharmony_ci      multiple of VIRTUAL_PAGE_SIZE_Y_EXT and <height> plus <yoffset> is not
4795bd8deadSopenharmony_ci      equal to the height of level <level> of the texture bound to <target>.
4805bd8deadSopenharmony_ci
4815bd8deadSopenharmony_ci      An INVALID_OPERATION error is generated if <depth> is not an integer
4825bd8deadSopenharmony_ci      multiple of VIRTUAL_PAGE_SIZE_Z_EXT and <depth> plus <zoffset> is not
4835bd8deadSopenharmony_ci      equal to
4845bd8deadSopenharmony_ci
4855bd8deadSopenharmony_ci        * the depth of level <level> of the texture bound to <target>, if
4865bd8deadSopenharmony_ci          <target> is TEXTURE_3D;
4875bd8deadSopenharmony_ci
4885bd8deadSopenharmony_ci        * the number of layers of level <level> of the texture bound to
4895bd8deadSopenharmony_ci          <target>, if <target> is TEXTURE_2D_ARRAY;
4905bd8deadSopenharmony_ci
4915bd8deadSopenharmony_ci        * six times the number of layers of level <level> of the texture bound
4925bd8deadSopenharmony_ci          to <target>, if <target> is TEXTURE_CUBE_MAP_ARRAY; or
4935bd8deadSopenharmony_ci
4945bd8deadSopenharmony_ci        * one, for all other targets.
4955bd8deadSopenharmony_ci
4965bd8deadSopenharmony_ci      An INVALID_OPERATION error is generated if the value of
4975bd8deadSopenharmony_ci      TEXTURE_IMMUTABLE_FORMAT or TEXTURE_SPARSE_EXT for the texture bound to
4985bd8deadSopenharmony_ci      <target> is FALSE.
4995bd8deadSopenharmony_ci
5005bd8deadSopenharmony_ci    [[ The following is only added if EXT_direct_state_access is supported. ]]
5015bd8deadSopenharmony_ci
5025bd8deadSopenharmony_ci    The command
5035bd8deadSopenharmony_ci
5045bd8deadSopenharmony_ci        void TexturePageCommitmentEXT(uint texture,
5055bd8deadSopenharmony_ci                                      int level,
5065bd8deadSopenharmony_ci                                      int xoffset,
5075bd8deadSopenharmony_ci                                      int yoffset,
5085bd8deadSopenharmony_ci                                      int zoffset,
5095bd8deadSopenharmony_ci                                      sizei width,
5105bd8deadSopenharmony_ci                                      sizei height,
5115bd8deadSopenharmony_ci                                      sizei depth,
5125bd8deadSopenharmony_ci                                      boolean commit);
5135bd8deadSopenharmony_ci
5145bd8deadSopenharmony_ci    may also be used to control the residency of sparse textures.  This
5155bd8deadSopenharmony_ci    command behaves identically to TexPageCommitmentEXT, except that the
5165bd8deadSopenharmony_ci    texture is identified by the name <texture> instead of via <target>.
5175bd8deadSopenharmony_ci
5185bd8deadSopenharmony_ci    Errors
5195bd8deadSopenharmony_ci
5205bd8deadSopenharmony_ci      An INVALID_OPERATION error is generated if <texture> is not the name of
5215bd8deadSopenharmony_ci      an existing texture.
5225bd8deadSopenharmony_ci
5235bd8deadSopenharmony_ci      All other errors listed for TexPageCommitmentEXT also apply to
5245bd8deadSopenharmony_ci      TexturePageCommitmentEXT, except that references to "the texture bound
5255bd8deadSopenharmony_ci      to <target>" should be replaced with "the texture <texture>", and all
5265bd8deadSopenharmony_ci      other references to "<target>" should be replaced with "the target of
5275bd8deadSopenharmony_ci      texture <texture>".
5285bd8deadSopenharmony_ci
5295bd8deadSopenharmony_ciAdditions to Chapter 19 of the OpenGL ES 3.1 Specification (Context State
5305bd8deadSopenharmony_ciQueries)
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci    Append to Table 19.1, "Possible targets that internalformat can be used
5335bd8deadSopenharmony_ci    with and the corresponding usage meaning"
5345bd8deadSopenharmony_ci
5355bd8deadSopenharmony_ci    +-------------------------------+-------------------------+
5365bd8deadSopenharmony_ci    | Target                        | Usage                   |
5375bd8deadSopenharmony_ci    +-------------------------------+-------------------------+
5385bd8deadSopenharmony_ci    | TEXTURE_2D                    | 2D texture              |
5395bd8deadSopenharmony_ci    | TEXTURE_2D_ARRAY              | 2D texture array        |
5405bd8deadSopenharmony_ci    | TEXTURE_CUBE_MAP              | Cube map texture        |
5415bd8deadSopenharmony_ci    | TEXTURE_CUBE_MAP_ARRAY_OES    | Cube map texture array  |
5425bd8deadSopenharmony_ci    | TEXTURE_3D                    | 3D texture              |
5435bd8deadSopenharmony_ci    +-------------------------------+-------------------------+
5445bd8deadSopenharmony_ci
5455bd8deadSopenharmony_ci    Modify Section 19.3.1, "Internal Format Query Parameters"
5465bd8deadSopenharmony_ci
5475bd8deadSopenharmony_ci    (In the first item on the supported pnames list for NUM_SAMPLE_COUNTS,
5485bd8deadSopenharmony_ci     modify the first sub-list item "If <target> does not support multiple
5495bd8deadSopenharmony_ci     samples..")
5505bd8deadSopenharmony_ci
5515bd8deadSopenharmony_ci        - If <internalformat> is not color-renderable, depth-renderable, or
5525bd8deadSopenharmony_ci          stencil-renderable (as defined in section 9.4), or if <target> does
5535bd8deadSopenharmony_ci          not support multiple samples (is not TEXTURE_2D_MULTISAMPLE. or
5545bd8deadSopenharmony_ci          RENDERBUFFER), zero is returned.
5555bd8deadSopenharmony_ci
5565bd8deadSopenharmony_ci    (In the second item on the supported pnames list for SAMPLES, append to the
5575bd8deadSopenharmony_ci     sub-list)
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci        - If <internalformat> is not color-renderable, depth-renderable, or
5605bd8deadSopenharmony_ci          stencil-renderable (as defined in section 9.4), or if <target> does
5615bd8deadSopenharmony_ci          not support multiple samples (is not TEXTURE_2D_MULTISAMPLE. or
5625bd8deadSopenharmony_ci          RENDERBUFFER), <params> is not modified.
5635bd8deadSopenharmony_ci
5645bd8deadSopenharmony_ci    (Add to supported pnames list)
5655bd8deadSopenharmony_ci
5665bd8deadSopenharmony_ci        * NUM_VIRTUAL_PAGE_SIZES_EXT: The number of virtual page sizes
5675bd8deadSopenharmony_ci          supported by internalformat and target is written into params.
5685bd8deadSopenharmony_ci          Unsupported internal formats and targets report 0.
5695bd8deadSopenharmony_ci
5705bd8deadSopenharmony_ci        * VIRTUAL_PAGE_SIZE_X_EXT: The virtual page widths supported for
5715bd8deadSopenharmony_ci          internalformat and target are written into params.
5725bd8deadSopenharmony_ci
5735bd8deadSopenharmony_ci        * VIRTUAL_PAGE_SIZE_Y_EXT: The virtual page heights supported for
5745bd8deadSopenharmony_ci          internalformat and target are written into params.
5755bd8deadSopenharmony_ci
5765bd8deadSopenharmony_ci        * VIRTUAL_PAGE_SIZE_Z_EXT: The virtual page depths supported for
5775bd8deadSopenharmony_ci          internalformat and target are written into params.
5785bd8deadSopenharmony_ci
5795bd8deadSopenharmony_ci    In the error list on p.353, modify the first item:
5805bd8deadSopenharmony_ci
5815bd8deadSopenharmony_ci    * An INVALID_ENUM error is generated if <target> is not one of the targets
5825bd8deadSopenharmony_ci      in table 19.1, or if <pname> is not SAMPLES, NUM_SAMPLES_COUNTS,
5835bd8deadSopenharmony_ci      NUM_VIRTUAL_PAGE_SIZES_EXT, VIRTUAL_PAGE_SIZE_X_EXT,
5845bd8deadSopenharmony_ci      VIRTUAL_PAGE_SIZE_Y_EXT or VIRTUAL_PAGE_SIZE_Z_EXT.
5855bd8deadSopenharmony_ci
5865bd8deadSopenharmony_ci    Remove the second item "An INVALID_ENUM error is generated if
5875bd8deadSopenharmony_ci    internalformat is not color-, depth- or stencil-renderable."
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL/EGL Specifications
5905bd8deadSopenharmony_ci
5915bd8deadSopenharmony_ci    None.
5925bd8deadSopenharmony_ci
5935bd8deadSopenharmony_ciGLX Protocol
5945bd8deadSopenharmony_ci
5955bd8deadSopenharmony_ci    None.
5965bd8deadSopenharmony_ci
5975bd8deadSopenharmony_ciNew State
5985bd8deadSopenharmony_ci
5995bd8deadSopenharmony_ci    Append to Table 20.9, "Textures (state per texture object) (cont.)"
6005bd8deadSopenharmony_ci
6015bd8deadSopenharmony_ci    +-----------------------------------+-------+---------------------+-----------------+---------------------------------------+-------------+
6025bd8deadSopenharmony_ci    | Get Value                         | Type  | Get Command         | Initial Value   | Description                           | Sec.        |
6035bd8deadSopenharmony_ci    +-----------------------------------+-------+---------------------+-----------------+---------------------------------------+-------------+
6045bd8deadSopenharmony_ci    | VIRTUAL_PAGE_SIZE_INDEX_EXT       | Z+    | GetTexParameteriv   | 0               | Virtual page size index               | 8.17sparse  |
6055bd8deadSopenharmony_ci    | TEXTURE_SPARSE_EXT                | B     | GetTexParameteriv   | FALSE           | Texture sparseness                    | 8.17sparse  |
6065bd8deadSopenharmony_ci    | NUM_SPARSE_LEVELS_EXT             | Z+    | GetTexParameteriv   | 0               | Number of potentially sparse levels   | 8.17sparse  |
6075bd8deadSopenharmony_ci    +-----------------------------------+-------+---------------------+-----------------+---------------------------------------+-------------+
6085bd8deadSopenharmony_ci
6095bd8deadSopenharmony_ciNew Implementation Dependent State
6105bd8deadSopenharmony_ci
6115bd8deadSopenharmony_ci    Append to Table 20.41, "Implementation Dependent Values"
6125bd8deadSopenharmony_ci
6135bd8deadSopenharmony_ci    +--------------------------------------------+-------+-------------+-----------------+---------------------------------------+-------+
6145bd8deadSopenharmony_ci    | Get Value                                  | Type  | Get Command | Minimum Value   | Description                           | Sec.  |
6155bd8deadSopenharmony_ci    +--------------------------------------------+-------+-------------+-----------------+---------------------------------------+-------+
6165bd8deadSopenharmony_ci    | MAX_SPARSE_TEXTURE_SIZE_EXT                | Z+    | GetIntegerv | 2048            | Maximum 1D/2D/rectangle texture image | 8.19  |
6175bd8deadSopenharmony_ci    |                                            |       |             |                 | dimension for a sparse texture.       |       |
6185bd8deadSopenharmony_ci    | MAX_SPARSE_3D_TEXTURE_SIZE_EXT             | Z+    | GetIntegerv | 256             | Maximum 3D texture image dimension    | 8.19  |
6195bd8deadSopenharmony_ci    |                                            |       |             |                 | for a sparse texture.                 |       |
6205bd8deadSopenharmony_ci    | MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT        | Z+    | GetIntegerv | 256             | Maximum number of layers in a sparse  | 8.19  |
6215bd8deadSopenharmony_ci    |                                            |       |             |                 | array texture.                        |       |
6225bd8deadSopenharmony_ci    | SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT | B     | GetBooleanv | -               | TRUE if there are no restrictions on  | 8.19  |
6235bd8deadSopenharmony_ci    |                                            |       |             |                 | the allocation of mipmaps in sparse   |       |
6245bd8deadSopenharmony_ci    |                                            |       |             |                 | textures and FALSE otherwise.         |       |
6255bd8deadSopenharmony_ci    +--------------------------------------------+-------+-------------+-----------------+---------------------------------------+-------+
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ci    (Note the values of MAX_SPARSE_TEXTURE_SIZE_EXT, MAX_SPARSE_3D_TEXTURE_SIZE_EXT,
6285bd8deadSopenharmony_ci    MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT must be at least as high as the
6295bd8deadSopenharmony_ci    corresponding non-sparse maximums. These values were 16384, 2048, and
6305bd8deadSopenharmony_ci    2048 respectively in ARB_sparse_texture, reflecting the desktop texture
6315bd8deadSopenharmony_ci    size limits. They were reduced in this extension to reflect the ES 3.1
6325bd8deadSopenharmony_ci    limits of 2048, 256, and 256.)
6335bd8deadSopenharmony_ci
6345bd8deadSopenharmony_ciDependencies on OES_texture_view and EXT_texture_view
6355bd8deadSopenharmony_ci
6365bd8deadSopenharmony_ci    If neither OES_texture_view nor EXT_texture_view is supported,
6375bd8deadSopenharmony_ci    then remove all references to texture views.
6385bd8deadSopenharmony_ci
6395bd8deadSopenharmony_ciDependencies on OES_texture_border_clamp
6405bd8deadSopenharmony_ci
6415bd8deadSopenharmony_ci    If OES_texture_border_clamp is not supported, ignore all references
6425bd8deadSopenharmony_ci    to TexParameterI{u}ivOES and GetTexParameterI{u}ivOES.
6435bd8deadSopenharmony_ci
6445bd8deadSopenharmony_ciDependencies on EXT_texture_border_clamp
6455bd8deadSopenharmony_ci
6465bd8deadSopenharmony_ci    If EXT_texture_border_clamp is not supported, ignore all references
6475bd8deadSopenharmony_ci    to TexParameterI{u}ivEXT and GetTexParameterI{u}ivEXT.
6485bd8deadSopenharmony_ci
6495bd8deadSopenharmony_ciDependencies on OES_texture_cube_map_array and EXT_texture_cube_map_array
6505bd8deadSopenharmony_ci
6515bd8deadSopenharmony_ci    If neither OES_texture_cube_map_array nor EXT_texture_cube_map_array is
6525bd8deadSopenharmony_ci    supported, ignore all references to cube map array textures and
6535bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_ARRAY_OES.
6545bd8deadSopenharmony_ci
6555bd8deadSopenharmony_ci    If OES_texture_cube_map_array is not supported, but
6565bd8deadSopenharmony_ci    EXT_texture_cube_map_array is, replace all occurrences of
6575bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_ARRAY_OES with TEXTURE_CUBE_MAP_ARRAY_EXT.
6585bd8deadSopenharmony_ci
6595bd8deadSopenharmony_ciDependencies on EXT_texture_norm16
6605bd8deadSopenharmony_ci
6615bd8deadSopenharmony_ci    If EXT_texture_norm16 is not supported, remove references to
6625bd8deadSopenharmony_ci    all texture formats added by that extension. These are:
6635bd8deadSopenharmony_ci    R16_EXT, R16_SNORM_EXT, RG16_EXT, RG16_SNORM_EXT, RGB16_EXT,
6645bd8deadSopenharmony_ci    RGB16_SNORM_EXT, RGBA16_EXT, and RGBA16_SNORM_EXT.
6655bd8deadSopenharmony_ci
6665bd8deadSopenharmony_ciDependencies on GL_EXT_direct_state_access
6675bd8deadSopenharmony_ci
6685bd8deadSopenharmony_ci    If the GL_EXT_direct_state_access extension is not supported, remove all
6695bd8deadSopenharmony_ci    references to TexturePageCommitmentEXT.
6705bd8deadSopenharmony_ci
6715bd8deadSopenharmony_ciIssues
6725bd8deadSopenharmony_ci
6735bd8deadSopenharmony_ci    Note: Issues 1-9 are the same as those in the OpenGL extension
6745bd8deadSopenharmony_ci    ARB_sparse_texture, which can be found in the OpenGL Registry.
6755bd8deadSopenharmony_ci    They were retained here to aid in understanding the functionality.
6765bd8deadSopenharmony_ci
6775bd8deadSopenharmony_ci    0) How does this extension differ from ARB_sparse_texture?
6785bd8deadSopenharmony_ci
6795bd8deadSopenharmony_ci        * It was rebased against OpenGL ES 3.1 and suffices converted from
6805bd8deadSopenharmony_ci          ARB to EXT.  Interactions with ES extensions were added.
6815bd8deadSopenharmony_ci        * References to functions and texture formats not present in
6825bd8deadSopenharmony_ci          OpenGL ES were removed (GetDoublev, GetTexImage).
6835bd8deadSopenharmony_ci
6845bd8deadSopenharmony_ci    1) Do we want to mandate specific page sizes for specific formats?
6855bd8deadSopenharmony_ci
6865bd8deadSopenharmony_ci       RESOLVED. No, this functionality is available in EXT_sparse_texture2.
6875bd8deadSopenharmony_ci
6885bd8deadSopenharmony_ci    2) What happened to MIN_SPARSE_LEVEL_AMD from the AMD spec? Do we need it
6895bd8deadSopenharmony_ci       here?
6905bd8deadSopenharmony_ci
6915bd8deadSopenharmony_ci       RESOLVED. We changed it to NUM_SPARSE_LEVELS_EXT. MIN_SPARSE_LEVEL_AMD
6925bd8deadSopenharmony_ci       could not acceptably describe the case where a texture is technically
6935bd8deadSopenharmony_ci       sparse, but no level of the texture may be sparsely populated. The
6945bd8deadSopenharmony_ci       AMD specification disallowed creation of such a texture. However, this
6955bd8deadSopenharmony_ci       extension does allow creation of a texture that is either wholly
6965bd8deadSopenharmony_ci       resident or non-resident. Furthermore, if a view of a sparse texture
6975bd8deadSopenharmony_ci       is created starting somewhere in the tail, then that whole view
6985bd8deadSopenharmony_ci       is essentially sparse.
6995bd8deadSopenharmony_ci
7005bd8deadSopenharmony_ci    3) Should it be mandatory to support sparse allocation for compressed
7015bd8deadSopenharmony_ci       textures?
7025bd8deadSopenharmony_ci
7035bd8deadSopenharmony_ci       RESOLVED: No, but in all likelihood, implementations will support some
7045bd8deadSopenharmony_ci       or all compressed texture formats.
7055bd8deadSopenharmony_ci
7065bd8deadSopenharmony_ci    4) Are multisample textures supported? What about depth and stencil
7075bd8deadSopenharmony_ci       format textures?
7085bd8deadSopenharmony_ci
7095bd8deadSopenharmony_ci       RESOLVED: No. Depth and stencil format textures are optional to support.
7105bd8deadSopenharmony_ci       Providing support would be a case of reporting non-zero for
7115bd8deadSopenharmony_ci       NUM_VIRTUAL_PAGE_SIZES_EXT for those formats. Multi-sample textures
7125bd8deadSopenharmony_ci       are explicitly not supported by this extension as their targets are
7135bd8deadSopenharmony_ci       excluded from TexStorage* support. Allowing support for these would
7145bd8deadSopenharmony_ci       require a new extension, if only to remove the error generated
7155bd8deadSopenharmony_ci       if one of the multi-sample targets is used with TexStorage* when
7165bd8deadSopenharmony_ci       the sparse flag is set.
7175bd8deadSopenharmony_ci
7185bd8deadSopenharmony_ci    5) Do we need language clarifying completeness and the effects of
7195bd8deadSopenharmony_ci       residency on completeness?
7205bd8deadSopenharmony_ci
7215bd8deadSopenharmony_ci       RESOLVED: Currently, there is no language. Textures allocated by
7225bd8deadSopenharmony_ci       TexStorage* (which include all sparse textures) are always complete.
7235bd8deadSopenharmony_ci       Residency doesn't effect that and sampling from them is well defined
7245bd8deadSopenharmony_ci       (or explicitly undefined).
7255bd8deadSopenharmony_ci
7265bd8deadSopenharmony_ci    6) Can commitment fail? What happens if it does?
7275bd8deadSopenharmony_ci
7285bd8deadSopenharmony_ci       RESOLVED: An OUT_OF_MEMORY error is generated if physical backing cannot
7295bd8deadSopenharmony_ci       be allocated for the previously allocated virtual space. No language
7305bd8deadSopenharmony_ci       is added here as it is implicit that any command can generate
7315bd8deadSopenharmony_ci       OUT_OF_MEMORY at any time for any reason... which includes new commands
7325bd8deadSopenharmony_ci       introduced here.
7335bd8deadSopenharmony_ci
7345bd8deadSopenharmony_ci    7) Please explain, in plain English, what the rules are governing the size
7355bd8deadSopenharmony_ci       of a texture's base level, mipmap levels, and the 'tail'.
7365bd8deadSopenharmony_ci
7375bd8deadSopenharmony_ci       The base level of the texture must be an integer multiple of the page
7385bd8deadSopenharmony_ci       size in each dimension. This need not be a power of two or square or
7395bd8deadSopenharmony_ci       anything of that nature. As we proceed along the mipmap chain, the
7405bd8deadSopenharmony_ci       current level will become smaller and smaller, at each step halving in
7415bd8deadSopenharmony_ci       size. At some point, the level dimensions will no longer be an integer
7425bd8deadSopenharmony_ci       multiple of the page size, where the memory corresponding to that level
7435bd8deadSopenharmony_ci       and smaller sized levels may not be evenly divided into pages.  The
7445bd8deadSopenharmony_ci       memory allocated to such levels may not be naturally aligned on memory
7455bd8deadSopenharmony_ci       page boundaries or may be too small to bother with partial residency.
7465bd8deadSopenharmony_ci       Implementations are permitted to treat such a level and all subsequent
7475bd8deadSopenharmony_ci       levels as either fully resident or fully non-resident.  We refer to
7485bd8deadSopenharmony_ci       this set of levels as the mipmap "tail".  The set of levels belonging
7495bd8deadSopenharmony_ci       to the tail is implementation-dependent.  Some implementations may
7505bd8deadSopenharmony_ci       start the tail at the first level where any dimension is not the
7515bd8deadSopenharmony_ci       multiple of a page size; others might pad out such allocations to page
7525bd8deadSopenharmony_ci       boundaries and start the tail at a much smaller mipmap level.  The tail
7535bd8deadSopenharmony_ci       is made resident or non-resident as a unit; the tail is resident if and
7545bd8deadSopenharmony_ci       only if <resident> was TRUE for the last call to TexPageCommitmentEXT
7555bd8deadSopenharmony_ci       when <level> was any value in the tail.
7565bd8deadSopenharmony_ci
7575bd8deadSopenharmony_ci       Clearly, making the base level a square power of two multiple of the
7585bd8deadSopenharmony_ci       page size will mean that the greatest part of the texture can be sparse
7595bd8deadSopenharmony_ci       and will minimize the size of the tail. However, it's perfectly legal,
7605bd8deadSopenharmony_ci       with a hypothetical 256 x 256 texel page size to create a texture with
7615bd8deadSopenharmony_ci       a base level of 4096 x 256. Such a texture can be sparse in the base
7625bd8deadSopenharmony_ci       level, but level 1 would be 2048 x 128, which is no longer a multiple
7635bd8deadSopenharmony_ci       of the page size, and therefore might be considered as the start of the
7645bd8deadSopenharmony_ci       tail.
7655bd8deadSopenharmony_ci
7665bd8deadSopenharmony_ci    8) What's SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT for?
7675bd8deadSopenharmony_ci
7685bd8deadSopenharmony_ci       Some implementations may store the mipmap chain for array textures
7695bd8deadSopenharmony_ci       and cubemaps such that the presence and size of mipmaps affects the
7705bd8deadSopenharmony_ci       alignment of the start of each layer, even in the base level. Consider
7715bd8deadSopenharmony_ci       an implementation that stores all layers of level 0, then all of
7725bd8deadSopenharmony_ci       level 1, then all of level 2 and so on. The presence of a mipmap chain
7735bd8deadSopenharmony_ci       (or lack thereof) would have no effect on the alignment of layers 1
7745bd8deadSopenharmony_ci       through N of the array (or cubemap faces). Now, consider an
7755bd8deadSopenharmony_ci       implementation that stores all of the levels for layer 0, then all
7765bd8deadSopenharmony_ci       levels of layer 1 and so on. The number and size of the levels of the
7775bd8deadSopenharmony_ci       texture _would_ have an effect on the alignment of layers 1 through N
7785bd8deadSopenharmony_ci       of the texture. If the size of the mipmap chain for a single layer
7795bd8deadSopenharmony_ci       causes the next layer to become misaligned to the page size in linear
7805bd8deadSopenharmony_ci       address space, then the texture cannot be sparsely populated. This flag
7815bd8deadSopenharmony_ci       indicates whether the implementation has any restrictions on the size
7825bd8deadSopenharmony_ci       of the mipmap chain. In particular, these restrictions ensure that,
7835bd8deadSopenharmony_ci       while the texture may have mipmaps, the total size of the mipmap chain
7845bd8deadSopenharmony_ci       for each level still satisfies the alignment restrictions required by
7855bd8deadSopenharmony_ci       that implementation's virtual memory subsystem.
7865bd8deadSopenharmony_ci
7875bd8deadSopenharmony_ci    9) What happens when you create a view of a sparse texture?
7885bd8deadSopenharmony_ci
7895bd8deadSopenharmony_ci       RESOLVED: That view is sparse, as are views of that view and so on.
7905bd8deadSopenharmony_ci       Also, if the view hits the tail, then modifications of tail residency
7915bd8deadSopenharmony_ci       via the view affect the whole tail of the parent texture.
7925bd8deadSopenharmony_ci
7935bd8deadSopenharmony_ciRevision History
7945bd8deadSopenharmony_ci
7955bd8deadSopenharmony_ci    Rev.    Date      Author    Changes
7965bd8deadSopenharmony_ci    ----  ----------  --------  -----------------------------------------
7975bd8deadSopenharmony_ci     3    03/27/2015  dkoch     update status and contributors
7985bd8deadSopenharmony_ci     2    02/25/2015  xiche     Additional interaction with GetInternalformativ
7995bd8deadSopenharmony_ci     1    11/13/2014  dkoch     Initial version based on ARB_sparse_texture v11
800