15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_clear_texture
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_clear_texture
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Daniel Koch, NVIDIA Corporation (dkoch 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Graham Sellers, AMD
165bd8deadSopenharmony_ci    Jonathan Putsman, Imagination
175bd8deadSopenharmony_ci    Ian Rominick, Intel
185bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA
195bd8deadSopenharmony_ci    Pat Brown, NVIDIA
205bd8deadSopenharmony_ci    Piers Daniel, NVIDIA
215bd8deadSopenharmony_ci    James Helferty, NVIDIA
225bd8deadSopenharmony_ci    Members of the ARB working group
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ciNotice
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ci    Copyright (c) 2013 The Khronos Group Inc. Copyright terms at
275bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ciSpecification Update Policy
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
325bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
335bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
345bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
355bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
365bd8deadSopenharmony_ci    described in more detail at
375bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciStatus
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    Complete. Approved by the ARB on June 3, 2013.
425bd8deadSopenharmony_ci    Ratified by the Khronos Board of Promoters on July 19, 2013.
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ciVersion
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    Last Modified Date: August 12, 2013
475bd8deadSopenharmony_ci    Revision: 16
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ciNumber
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    ARB Extension #145
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ciDependencies
545bd8deadSopenharmony_ci
555bd8deadSopenharmony_ci    OpenGL 1.3 is required.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.3 (Core Profile)
585bd8deadSopenharmony_ci    Specification (October 18, 2012).
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    This extension interacts with EXT_texture_integer.
615bd8deadSopenharmony_ci
625bd8deadSopenharmony_ci    This extension interacts with ARB_texture_buffer_object.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    This extension interacts with ARB_texture_multisample.
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    This extension interacts with ARB_depth_texture.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    This extension interacts with EXT_packed_depth_stencil and
695bd8deadSopenharmony_ci    ARB_framebuffer_object.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    This extension interacts with ARB_texture_stencil8.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    This extension interacts with ARB_shader_image_load_store.
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    This extension interacts with ARB_internalformat_query2.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ciOverview
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    Texture objects are fundamental to the operation of OpenGL. They are
805bd8deadSopenharmony_ci    used as a source for texture sampling and destination for rendering
815bd8deadSopenharmony_ci    as well as being accessed in shaders for image load/store operations
825bd8deadSopenharmony_ci    It is also possible to invalidate the contents of a texture. It is
835bd8deadSopenharmony_ci    currently only possible to set texture image data to known values by
845bd8deadSopenharmony_ci    uploading some or all of a image array from application memory or by
855bd8deadSopenharmony_ci    attaching it to a framebuffer object and using the Clear or ClearBuffer
865bd8deadSopenharmony_ci    commands.
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    Both uploading initial texture data and clearing by attaching to a
895bd8deadSopenharmony_ci    framebuffer have potential disadvantages when one simply wants to
905bd8deadSopenharmony_ci    initialize texture data to a known value. Uploading initial data
915bd8deadSopenharmony_ci    requires the application to allocate a (potentially large) chunk
925bd8deadSopenharmony_ci    of memory and transferring that to the GL.  This can be a costly
935bd8deadSopenharmony_ci    operation both in terms of memory bandwidth and power usage.
945bd8deadSopenharmony_ci    Alternatively, attaching a texture level to a framebuffer to clear it
955bd8deadSopenharmony_ci    may not be possible if the texture format isn't supported for
965bd8deadSopenharmony_ci    rendering, or even if it is, attaching the image to a framebuffer object
975bd8deadSopenharmony_ci    may cause the texture to be allocated in certain types of memory, which
985bd8deadSopenharmony_ci    it may otherwise not need to be placed in.
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    This extension solves these problems by providing a mechanism whereby
1015bd8deadSopenharmony_ci    the contents of a texture image array can be set to known values by
1025bd8deadSopenharmony_ci    using the ClearTexImage or ClearTexSubImage commands.  These commands
1035bd8deadSopenharmony_ci    can also be useful for initializing an image that will be used for
1045bd8deadSopenharmony_ci    atomic shader operations.
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ciIP Status
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    No known IP claims.
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ciNew Procedures and Functions
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci    void ClearTexImage(uint texture, int level,
1135bd8deadSopenharmony_ci                       enum format, enum type,
1145bd8deadSopenharmony_ci                       const void * data);
1155bd8deadSopenharmony_ci
1165bd8deadSopenharmony_ci    void ClearTexSubImage(uint texture, int level,
1175bd8deadSopenharmony_ci                          int xoffset, int yoffset, int zoffset,
1185bd8deadSopenharmony_ci                          sizei width, sizei height, sizei depth,
1195bd8deadSopenharmony_ci                          enum format, enum type,
1205bd8deadSopenharmony_ci                          const void * data);
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ciNew Types
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    None
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ciNew Tokens
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    Accepted by the <pname> parameter for GetInternalformativ and
1295bd8deadSopenharmony_ci    GetInternalformati64v:
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci        CLEAR_TEXTURE           0x9365
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ciAdditions to Chapter 7 of the OpenGL 4.3 (Core Profile) Specification
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    In section 7.12.2 (Shader Memory Access Synchronization) edit the
1365bd8deadSopenharmony_ci    description of the TEXTURE_UPDATE_BARRIER_BIT to add ClearTexImage
1375bd8deadSopenharmony_ci    and ClearTexSubImage to the list of commands that can write to
1385bd8deadSopenharmony_ci    texture images.
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ciAdditions to Chapter 8 of the OpenGL 4.3 (Core Profile) Specification
1415bd8deadSopenharmony_ci(Textures and Samplers)
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    Add a new Section 8.x (Clearing Texture Image Data) after
1445bd8deadSopenharmony_ci    Section 8.20 (Invalidating Texture Image Data):
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    "All or part of a texture image may be filled with a constant value
1475bd8deadSopenharmony_ci    by calling the command
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci      void ClearTexSubImage(uint texture, int level,
1505bd8deadSopenharmony_ci                            int xoffset, int yoffset, int zoffset,
1515bd8deadSopenharmony_ci                            sizei width, sizei height, sizei depth,
1525bd8deadSopenharmony_ci                            enum format, enum type,
1535bd8deadSopenharmony_ci                            const void * data);
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    with <texture> and <level> indicating which texture array image is being
1565bd8deadSopenharmony_ci    cleared.  It is an error if <texture> is zero or not the name of a texture
1575bd8deadSopenharmony_ci    object, if <texture> is a buffer texture, or if the texture image has
1585bd8deadSopenharmony_ci    a compressed internal format.
1595bd8deadSopenharmony_ci
1605bd8deadSopenharmony_ci    Arguments <xoffset>, <yoffset>, and <zoffset> specify the lower left
1615bd8deadSopenharmony_ci    texel coordinates of a <width>-wide by <height>-high by <depth>-deep
1625bd8deadSopenharmony_ci    rectangular subregion of the texel array and are interpreted as they
1635bd8deadSopenharmony_ci    are in TexSubImage3D as described in section 8.6 (Alternate Texture
1645bd8deadSopenharmony_ci    Image Specification Commands).
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    For 1D array textures, <yoffset> is interpreted as the first layer to be
1675bd8deadSopenharmony_ci    cleared and <height> is the number of layers to clear. For 2D array
1685bd8deadSopenharmony_ci    textures, <zoffset> is interpreted as the first layer to be cleared
1695bd8deadSopenharmony_ci    and <depth> is the number of layers to clear. Cube map textures are
1705bd8deadSopenharmony_ci    treated as an array of six slices in the z-dimension, where the value
1715bd8deadSopenharmony_ci    of <zoffset> is interpreted as specifying the cube map face for the
1725bd8deadSopenharmony_ci    corresponding <layer> in table 9.3 (Layer numbers for cube map texture
1735bd8deadSopenharmony_ci    faces) and <depth> is the number of faces to clear. For cube map array
1745bd8deadSopenharmony_ci    textures, <zoffset> is the first layer-face to clear, and <depth> is the
1755bd8deadSopenharmony_ci    number of layer-faces to clear. Each layer-face is translated into an
1765bd8deadSopenharmony_ci    array layer and a cube map face as described for layer-face numbers in
1775bd8deadSopenharmony_ci    section 8.5.3.
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci    Negative values of <xoffset>, <yoffset>, and <zoffset> correspond
1805bd8deadSopenharmony_ci    to the coordinates of border texels, addressed as in Figure 8.3.
1815bd8deadSopenharmony_ci    Taking <w_s>, <h_s>, <d_s>, <w_b>, <h_b>, and <d_b> to be the specified
1825bd8deadSopenharmony_ci    width, height, depth, and the border width, border height, and border
1835bd8deadSopenharmony_ci    depth of the texel array and taking <x>, <y>, <z>, <w>, <h>, and <d> to
1845bd8deadSopenharmony_ci    be the <xoffset>, <yoffset>, <zoffset>, <width>, <height>, and <depth>
1855bd8deadSopenharmony_ci    argument values, any of the following relationships generate an error:
1865bd8deadSopenharmony_ci              <x> < - <w_b>
1875bd8deadSopenharmony_ci        <x> + <w> > <w_s> - <w_b>
1885bd8deadSopenharmony_ci              <y> < - <h_b>
1895bd8deadSopenharmony_ci        <y> + <h> > <h_s> - <h_b>
1905bd8deadSopenharmony_ci              <z> < - <d_b>
1915bd8deadSopenharmony_ci        <z> + <d> > <d_s> - <d_b>
1925bd8deadSopenharmony_ci    For texture types that do not have certain dimensions, this
1935bd8deadSopenharmony_ci    command treats those dimensions as having a size of 1.  For example,
1945bd8deadSopenharmony_ci    to clear a portion of a two-dimensional texture, the application would
1955bd8deadSopenharmony_ci    use <zoffset> equal to zero and <depth> equal to one.
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    <format> and <type> specify the format and type of the source
1985bd8deadSopenharmony_ci    data and are interpreted as they are for TexImage3D, as described in
1995bd8deadSopenharmony_ci    section 8.4.4 (Transfer of Pixel Rectangles). Textures with a base
2005bd8deadSopenharmony_ci    internal format of DEPTH_COMPONENT, STENCIL_INDEX, or DEPTH_STENCIL
2015bd8deadSopenharmony_ci    require depth component, stencil, or depth/stencil component data
2025bd8deadSopenharmony_ci    respectively. Textures with other base internal formats require RGBA
2035bd8deadSopenharmony_ci    formats. Textures with integer internal formats (see table 8.12) require
2045bd8deadSopenharmony_ci    integer data.
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci    <data> is a pointer to an array of between one and four components of
2075bd8deadSopenharmony_ci    texel data that will be used as the source for the constant fill value.
2085bd8deadSopenharmony_ci    The elements of <data> are converted by the GL into the
2095bd8deadSopenharmony_ci    <internalformat> of the texture image (that was specified when the level
2105bd8deadSopenharmony_ci    was defined by any of the TexImage, TexStorage or CopyTexImage
2115bd8deadSopenharmony_ci    commands) in the manner described in section 8.4.4 (Transfer of Pixel
2125bd8deadSopenharmony_ci    Rectangles), and then used to fill the specified range of the
2135bd8deadSopenharmony_ci    destination texture level.  If <data> is NULL, then the pointer is
2145bd8deadSopenharmony_ci    ignored and the sub-range of the texture image is filled with zeros.
2155bd8deadSopenharmony_ci    If <texture> is a multisample texture, all the samples in a texel
2165bd8deadSopenharmony_ci    are cleared to the same value, that which was specified by <data>.
2175bd8deadSopenharmony_ci
2185bd8deadSopenharmony_ci    Errors
2195bd8deadSopenharmony_ci
2205bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <texture> is zero or not the
2215bd8deadSopenharmony_ci    name of a texture object.
2225bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <texture> is a buffer texture.
2235bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <texture> has a compressed
2245bd8deadSopenharmony_ci    internal format.
2255bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the base internal format is
2265bd8deadSopenharmony_ci    DEPTH_COMPONENT and <format> is not DEPTH_COMPONENT.
2275bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the base internal format is
2285bd8deadSopenharmony_ci    DEPTH_STENCIL and <format> is not DEPTH_STENCIL.
2295bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the base internal format is
2305bd8deadSopenharmony_ci    STENCIL_INDEX and <format> is not STENCIL_INDEX.
2315bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the base internal format is
2325bd8deadSopenharmony_ci    RGBA and the <format> is DEPTH_COMPONENT, STENCIL_INDEX, or DEPTH_STENCIL.
2335bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the internal format is integer
2345bd8deadSopenharmony_ci    and <format> does not specify integer data.
2355bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the internal format is
2365bd8deadSopenharmony_ci    not integer and <format> does specify integer data.
2375bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the <xoffset>, <yoffset>,
2385bd8deadSopenharmony_ci    <zoffset>, <width>, <height>, and <depth> parameters (or combinations
2395bd8deadSopenharmony_ci    thereof) fall outside the defined texture image array (including border,
2405bd8deadSopenharmony_ci    if any).
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    The command
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci      void ClearTexImage(uint texture, int level,
2455bd8deadSopenharmony_ci                         enum format, enum type,
2465bd8deadSopenharmony_ci                         const void * data);
2475bd8deadSopenharmony_ci
2485bd8deadSopenharmony_ci    is equivalent to calling ClearTexSubImage with <xoffset>, <yoffset>,
2495bd8deadSopenharmony_ci    and <zoffset> equal to -<b> and <width>, <height>, and <depth> equal
2505bd8deadSopenharmony_ci    to the dimensions of the texture image plus 2x<b> (or zero and one
2515bd8deadSopenharmony_ci    for dimensions the texture doesn't have).
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci    Errors
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if the image array identified by
2565bd8deadSopenharmony_ci    <level> has not previously been defined by a TexImage* or TexStorage*
2575bd8deadSopenharmony_ci    command."
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ciAdditions to Chapter 22 of the OpenGL 4.3 (Core Profile) Specification
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    In section 22.3 add the following to the list of <pname> values accepted
2625bd8deadSopenharmony_ci    by GetInternalformativ and GetInternalformati64v:
2635bd8deadSopenharmony_ci
2645bd8deadSopenharmony_ci        CLEAR_TEXTURE: The support for using the resource with the
2655bd8deadSopenharmony_ci        ClearTex*Image commands is returned in <params>.  Possible values
2665bd8deadSopenharmony_ci        returned are FULL_SUPPORT, CAVEAT_SUPPORT, or NONE.  If the resource
2675bd8deadSopenharmony_ci        or operation is not supported, NONE is returned.
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ciAdditions to the AGL/EGL/GLX/WGL Specifications
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci    None
2725bd8deadSopenharmony_ci
2735bd8deadSopenharmony_ciDependencies on EXT_texture_integer
2745bd8deadSopenharmony_ci
2755bd8deadSopenharmony_ci    If EXT_texture_integer or equivalent functionality is not supported,
2765bd8deadSopenharmony_ci    ignore all references to integer textures.
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ciDependencies on ARB_texture_buffer_object
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    If ARB_texture_buffer_object of equivalent functionality is not supported,
2815bd8deadSopenharmony_ci    ignore all references to buffer textures.
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ciDependencies on ARB_texture_multisample
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ci    If ARB_texture_multisample or equivalent functionality is not supported,
2865bd8deadSopenharmony_ci    ignore all references to multisample textures.
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ciDependencies on ARB_depth_texture
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    If ARB_depth_texture or equivalent functionality is not supported,
2915bd8deadSopenharmony_ci    ignore all references to depth textures and depth component formats.
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ciDependencies on EXT_packed_depth_stencil and ARB_framebuffer_object
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    If EXT_packed_depth_stencil, ARB_framebuffer_object, or equivalent
2965bd8deadSopenharmony_ci    functionality is not supported, ignore all refereces to depth/stencil
2975bd8deadSopenharmony_ci    textures and depth/stencil components.
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ciDependencies on ARB_texture_stencil8
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    If ARB_texture_stencil8 or equivalent functionality is not supported,
3025bd8deadSopenharmony_ci    ignore all references to stencil textures and stencil index formats.
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ciDependencies on ARB_shader_image_load_store
3055bd8deadSopenharmony_ci
3065bd8deadSopenharmony_ci    If ARB_shader_image_load_store or equivalent functionality is not
3075bd8deadSopenharmony_ci    supported, ignore the references to TEXTURE_UPDATE_BARRIER_BIT and
3085bd8deadSopenharmony_ci    edits to section 7.12.2.
3095bd8deadSopenharmony_ci
3105bd8deadSopenharmony_ciDependencies on ARB_internalformat_query2
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ci    If ARB_internalformat_query2 or equivalent functionality is not
3135bd8deadSopenharmony_ci    supported, ignore the references GetInternalformat* and the CLEAR_TEXTURE
3145bd8deadSopenharmony_ci    enum is not added.
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ciErrors
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3195bd8deadSopenharmony_ci    ClearTexSubImage if <texture> is zero or not the name of a texture object.
3205bd8deadSopenharmony_ci
3215bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3225bd8deadSopenharmony_ci    ClearTexSubImage if <texture> is a buffer texture.
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3255bd8deadSopenharmony_ci    ClearTexSubImage if <texture> has a compressed internal format.
3265bd8deadSopenharmony_ci
3275bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3285bd8deadSopenharmony_ci    ClearTexSubImage if the base internal format is DEPTH_COMPONENT and
3295bd8deadSopenharmony_ci    <format> is not DEPTH_COMPONENT.
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3325bd8deadSopenharmony_ci    ClearTexSubImage if the base internal format is STENCIL_INDEX and
3335bd8deadSopenharmony_ci    <format> is not STENCIL_INDEX.
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3365bd8deadSopenharmony_ci    ClearTexSubImage if the base internal format is DEPTH_STENCIL and
3375bd8deadSopenharmony_ci    <format> is not DEPTH_STENCIL.
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3405bd8deadSopenharmony_ci    ClearTexSubImage if the base internal format is RGBA and the <format>
3415bd8deadSopenharmony_ci    is DEPTH_COMPONENT, STENCIL_INDEX, or DEPTH_STENCIL.
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3445bd8deadSopenharmony_ci    ClearTexSubImage if the internal format is integer and <format> does not
3455bd8deadSopenharmony_ci    specify integer data.
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage or
3485bd8deadSopenharmony_ci    ClearTexSubImage if the internal format is not integer and <format>
3495bd8deadSopenharmony_ci    does specify integer data.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexSubImage if the
3525bd8deadSopenharmony_ci    <xoffset>, <yoffset>, <zoffset>, <width>, <height>, and <depth>
3535bd8deadSopenharmony_ci    parameters (or combinations thereof) fall outside the defined texture
3545bd8deadSopenharmony_ci    image array (including border, if any).
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by ClearTexImage if the
3575bd8deadSopenharmony_ci    image array identified by <level> has not previously been defined.
3585bd8deadSopenharmony_ci
3595bd8deadSopenharmony_ciNew State
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ci    None.
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ciNew Implementation Dependent State
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci    None.
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ciSample Code
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci    TBD
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ciConformance Tests
3725bd8deadSopenharmony_ci
3735bd8deadSopenharmony_ci    Needed.
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ciIssues
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    1. Should these commands use <target> or <name> to specify the object?
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci    DISCUSSION: TexImage/TexSubImage pass in a target and operate on the
3805bd8deadSopenharmony_ci    object that is currently bound to that target. However the
3815bd8deadSopenharmony_ci    InvalidateTexImage/InvalidateTexSubImage commands operate on a named
3825bd8deadSopenharmony_ci    object. A target would be necessary if ClearTex*Image supported
3835bd8deadSopenharmony_ci    defining new textures. It does not support this. It could also be
3845bd8deadSopenharmony_ci    useful for clearing only one face of a cube map - if this is useful
3855bd8deadSopenharmony_ci    this can be accomplished by creating a 2D texture which is view of one
3865bd8deadSopenharmony_ci    face of a cube map.
3875bd8deadSopenharmony_ci
3885bd8deadSopenharmony_ci    RESOLVED. We will use named objects and be consistent with
3895bd8deadSopenharmony_ci    the InvalidateTexImage entry points.
3905bd8deadSopenharmony_ci
3915bd8deadSopenharmony_ci    2. Should scissor and viewport settings be respected?
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ci    DISCUSSION: The scissor and viewport settings really have no meaning
3945bd8deadSopenharmony_ci    with respect to a texture that is not attached to a framebuffer object.
3955bd8deadSopenharmony_ci    D3D11's ClearRenderTargetView also does not apply scissor or viewport.
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci    RESOLVED. Scissor and viewport are not relevant to this command.
3985bd8deadSopenharmony_ci
3995bd8deadSopenharmony_ci    3. Should we support clearing only a portion of a texture?
4005bd8deadSopenharmony_ci
4015bd8deadSopenharmony_ci    RESOLVED. Yes, it seems like it would be useful functionality.
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci    4. How many command variants do we need? We may want to provide
4045bd8deadSopenharmony_ci    integer, unsigned integer, or floating-point data. Is a void
4055bd8deadSopenharmony_ci    parameter sufficient, or do we need to use different commands
4065bd8deadSopenharmony_ci    similar to ClearBuffer?
4075bd8deadSopenharmony_ci
4085bd8deadSopenharmony_ci    RESOLVED. Similar to the initial texure data specification via
4095bd8deadSopenharmony_ci    TexSubImage, a single command is provided. The format and type
4105bd8deadSopenharmony_ci    parameters specify how the data should be interpreted, and enough
4115bd8deadSopenharmony_ci    data needs to provided to completely define one texel. This operates
4125bd8deadSopenharmony_ci    similarly to the ClearBufferData commands.
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci    5. Should depth/stencil textures be supported? If so, are the depth
4155bd8deadSopenharmony_ci    and stencil values provided separately?
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci    RESOLVED. Depth/stencil textures are supported in the same manner
4185bd8deadSopenharmony_ci    they are for TexSubImage.  The format and type describe how the
4195bd8deadSopenharmony_ci    data is interpreted.
4205bd8deadSopenharmony_ci
4215bd8deadSopenharmony_ci    6. Should compressed textures be supported? If so, does a whole
4225bd8deadSopenharmony_ci    block of data need to be specified?
4235bd8deadSopenharmony_ci
4245bd8deadSopenharmony_ci    DISCUSSION. For many compressed formats it may be fairly straight
4255bd8deadSopenharmony_ci    forward for a driver to construct a block based on a single value.
4265bd8deadSopenharmony_ci    It is unclear if this applies to all formats or not. In any case,
4275bd8deadSopenharmony_ci    if compressed textures are supported, the sub region that is cleared
4285bd8deadSopenharmony_ci    is required to be aligned on with block boundaries.
4295bd8deadSopenharmony_ci
4305bd8deadSopenharmony_ci    RESOLUTION: No. Compressed textures are not support. Not all formats
4315bd8deadSopenharmony_ci    support runtime compression so providing uncompressed data would not
4325bd8deadSopenharmony_ci    be viable. Providing a single block of compressed data may be possible
4335bd8deadSopenharmony_ci    but then it would have to be aligned to block boundaries and this becomes
4345bd8deadSopenharmony_ci    more of a sub-image command than a clear operation. This does not seem
4355bd8deadSopenharmony_ci    to have a compelling use-case so it is not being added at this time. It
4365bd8deadSopenharmony_ci    can always be added in a layered extension if desired.
4375bd8deadSopenharmony_ci
4385bd8deadSopenharmony_ci    7. Should we add an entry point for renderbuffers?
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci    RESOLVED. No. At this point there is really no use case that
4415bd8deadSopenharmony_ci    renderbuffers support that cannot be supported by multisample textures.
4425bd8deadSopenharmony_ci    Thus in order to avoid aggrandizing renderbuffers, this will not be
4435bd8deadSopenharmony_ci    provided.  Additionally, renderbuffers are by definition renderable,
4445bd8deadSopenharmony_ci    and thus they can be cleared by the standard mechanisms without affecting
4455bd8deadSopenharmony_ci    memory allocation patterns.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    8. Should these commands support support loading <data> from the pixel
4485bd8deadSopenharmony_ci    unpack buffer (ie PBO) or only client memory?
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci    RESOLVED. ClearTex*Image only supports <data> in client memory, like the
4515bd8deadSopenharmony_ci    comparable ClearBuffer*Data commands. There seems to be little value in
4525bd8deadSopenharmony_ci    supporting buffer-backed sources when there is only one texels' worth of
4535bd8deadSopenharmony_ci    data to upload. If the worst case (RGBA32F) it is only 16 bytes of data.
4545bd8deadSopenharmony_ci
4555bd8deadSopenharmony_ci    9. How does clearing multisample textures work?
4565bd8deadSopenharmony_ci
4575bd8deadSopenharmony_ci    RESOLVED: As with regular textures, the dimensions are specified in texels.
4585bd8deadSopenharmony_ci    All the samples in a texel are cleared to the same values, ie the one set
4595bd8deadSopenharmony_ci    of values which are provided in <data>.
4605bd8deadSopenharmony_ci
4615bd8deadSopenharmony_ci    10. Does conditional rendering interact with the ClearTex*Image commands?
4625bd8deadSopenharmony_ci
4635bd8deadSopenharmony_ci    RESOLVED: No. This is treated in a similar manner to the TexSubImage
4645bd8deadSopenharmony_ci    commands rather than the other image clearing commands and is thus not
4655bd8deadSopenharmony_ci    affected by conditional rendering.  This is similar to the clear buffer
4665bd8deadSopenharmony_ci    data commands.
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci    11. Would there be any benefit to providing some form of colormask style
4695bd8deadSopenharmony_ci    behavior?
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ci    RESOLVED: No. This is intended to be a simple operation like memset.
4725bd8deadSopenharmony_ci    If more complicated behaviour is required, one of the other mechanisms
4735bd8deadSopenharmony_ci    for specifying texture image data should be used.
4745bd8deadSopenharmony_ci
4755bd8deadSopenharmony_ci    12. Can ClearTexImage be used on buffer textures?
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci    RESOLVED: No. In the same way that TexSubImage cannot be used for
4785bd8deadSopenharmony_ci    buffer textures, neither can ClearTexImage.  The ClearBuffer{Sub}Data
4795bd8deadSopenharmony_ci    commands can be used for this purpose.
4805bd8deadSopenharmony_ci
4815bd8deadSopenharmony_ci    13. What happens if the subregion to be cleared is larger than the defined
4825bd8deadSopenharmony_ci    texture level's size?
4835bd8deadSopenharmony_ci
4845bd8deadSopenharmony_ci    RESOLVED: This is an error similar to TexSubImage3D.
4855bd8deadSopenharmony_ci
4865bd8deadSopenharmony_ci    14. What about texture zero?
4875bd8deadSopenharmony_ci
4885bd8deadSopenharmony_ci    RESOLVED: Which one? There are many zero textures (one of each target type).
4895bd8deadSopenharmony_ci    Since these commands don't distinguish based on target, this is an error.
4905bd8deadSopenharmony_ci    Also we really don't want to aggrandize texture zero.
4915bd8deadSopenharmony_ci
4925bd8deadSopenharmony_ci    15. What happens for undefined levels?
4935bd8deadSopenharmony_ci
4945bd8deadSopenharmony_ci    RESOLVED: This depends on the command.  An undefined level will have
4955bd8deadSopenharmony_ci    width, height, and depth of zero, and thus a ClearTexSubImage command with
4965bd8deadSopenharmony_ci    a non-zero sized clear region will fail the bounds check and result in
4975bd8deadSopenharmony_ci    an INVALID_OPERATION. A zero-sized clear region with no-offset is allowed,
4985bd8deadSopenharmony_ci    but is a no-op. ClearTexImage though, is defined in terms of
4995bd8deadSopenharmony_ci    ClearTexSubImage called with appropriate dimensions and offsets. Since
5005bd8deadSopenharmony_ci    it's unclear how many dimensions an undefined level would have, we've
5015bd8deadSopenharmony_ci    defined this to be an error.
5025bd8deadSopenharmony_ci
5035bd8deadSopenharmony_ci    16. What happens for incomplete textures?
5045bd8deadSopenharmony_ci
5055bd8deadSopenharmony_ci    RESOLVED: Incomplete textures do not affect the behaviour of these commands
5065bd8deadSopenharmony_ci    since they operate on individual levels.  However see Issue 15 for
5075bd8deadSopenharmony_ci    behaviour on undefined levels.
5085bd8deadSopenharmony_ci
5095bd8deadSopenharmony_ci    17. How does ClearTexture interact with the (compatibility) GENERATE_MIPMAP
5105bd8deadSopenharmony_ci    texture state?
5115bd8deadSopenharmony_ci
5125bd8deadSopenharmony_ci    RESOLVED: It doesn't (i.e. it doesn't provoke automatic mipmap generation).
5135bd8deadSopenharmony_ci    In general the policy is that new functionality doesn't need to interact with
5145bd8deadSopenharmony_ci    legacy functionality. This also falls out of the way the spec is written
5155bd8deadSopenharmony_ci    since section 8.14.5 on automatic mipmap generation says it applies to the
5165bd8deadSopenharmony_ci    image specification operations defined in sections 8.5 to 8.7. ClearTexture
5175bd8deadSopenharmony_ci    is defined in section 8.21.
5185bd8deadSopenharmony_ci
5195bd8deadSopenharmony_ciRevision History
5205bd8deadSopenharmony_ci
5215bd8deadSopenharmony_ci    Revision 16, 2013/08/12, Jon Leech
5225bd8deadSopenharmony_ci        - Clarify issue 8 (public bug 934).
5235bd8deadSopenharmony_ci    Revision 15, 2013/06/25, dgkoch
5245bd8deadSopenharmony_ci        - assign value for GL_CLEAR_TEXTURE
5255bd8deadSopenharmony_ci    Revision 14, 2013/06/21, dgkoch
5265bd8deadSopenharmony_ci        - add CLEAR_TEXTURE for GetInternalformat* query.
5275bd8deadSopenharmony_ci    Revision 13, 2013/06/04, dgkoch
5285bd8deadSopenharmony_ci      - add issue 17.
5295bd8deadSopenharmony_ci    Revision 12, 2013/05/30, Jon Leech
5305bd8deadSopenharmony_ci      - Move new error to per-command Errors section.
5315bd8deadSopenharmony_ci    Revision 11, 2013/05/30, dgkoch
5325bd8deadSopenharmony_ci      - Add Issues 15, 16. Add error for ClearTexImage on undefined levels.
5335bd8deadSopenharmony_ci      - fix naming of ARB_texture_stencil8 dependency.
5345bd8deadSopenharmony_ci    Revision 10, 2013/05/30, Jon Leech
5355bd8deadSopenharmony_ci      - Remove (some) redundant error descriptions from inline spec language
5365bd8deadSopenharmony_ci        and simplify description of layer-faces.
5375bd8deadSopenharmony_ci    Revision 9, 2013/05/29, dgkoch
5385bd8deadSopenharmony_ci      - change error back to INVALID_OP
5395bd8deadSopenharmony_ci    Revision 8, 2013/05/29, dgkoch
5405bd8deadSopenharmony_ci      - added general error conditions to command description
5415bd8deadSopenharmony_ci      - change error for non-texture names to be INVALID_VALUE
5425bd8deadSopenharmony_ci      - minor grammatical and formatting fixes.
5435bd8deadSopenharmony_ci    Revision 7, 2013/05/29, dgkoch
5445bd8deadSopenharmony_ci      - add interaction with ARB_shader_image_load_store / MemoryBarrier
5455bd8deadSopenharmony_ci    Revision 6, 2013/05/02, dgkoch
5465bd8deadSopenharmony_ci      - add interaction with stencil textures
5475bd8deadSopenharmony_ci      - fix typos and formatting
5485bd8deadSopenharmony_ci    Revision 5, 2013/04/23, dgkoch
5495bd8deadSopenharmony_ci      - fix more typos, confirm out of bounds error
5505bd8deadSopenharmony_ci    Revision 4, 2013/04/22, dgkoch
5515bd8deadSopenharmony_ci      - resolved issue 13, and update language appropriately
5525bd8deadSopenharmony_ci      - add error for texture zero, remove error for undefined levels
5535bd8deadSopenharmony_ci      - fix typos
5545bd8deadSopenharmony_ci    Revision 3, 2013/04/21, dgkoch
5555bd8deadSopenharmony_ci      - various formatting fixes
5565bd8deadSopenharmony_ci      - add dependencies
5575bd8deadSopenharmony_ci      - flesh out a lot of spec language instead of referring to other sections
5585bd8deadSopenharmony_ci      - add error conditions
5595bd8deadSopenharmony_ci      - allow larger dimensions than the texture image array.
5605bd8deadSopenharmony_ci      - Resolved issues 6,7,10,11
5615bd8deadSopenharmony_ci      - Added issues 12,13.
5625bd8deadSopenharmony_ci    Revision 2, 2013/03/13, dgkoch
5635bd8deadSopenharmony_ci      - Added issues 9,10,11
5645bd8deadSopenharmony_ci      - Resolved issues 1,2,3,4,5,8,9
5655bd8deadSopenharmony_ci      - update contact & contributors
5665bd8deadSopenharmony_ci    Revision 1, 2013/01/15, dgkoch
5675bd8deadSopenharmony_ci      - Initial revision
568