15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_invalidate_subdata
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_invalidate_subdata
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA Corporation (jbolz 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Michael Gold, NVIDIA Corporation
165bd8deadSopenharmony_ci    Bruce Merry
175bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciNotice
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    Copyright (c) 2012-2013 The Khronos Group Inc. Copyright terms at
225bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ciSpecification Update Policy
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
275bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
285bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
295bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
305bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
315bd8deadSopenharmony_ci    described in more detail at
325bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ciStatus
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    Complete.
375bd8deadSopenharmony_ci    Approved by the ARB on 2012/06/12.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ciVersion
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    Last Modified Date:         July 30, 2012
425bd8deadSopenharmony_ci    Revision:                   5
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ciNumber
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    ARB Extension #132
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ciDependencies
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    This extension is written against the OpenGL 3.2 specification 
515bd8deadSopenharmony_ci    (Compatibility profile).
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    OpenGL 2.0 is required.
545bd8deadSopenharmony_ci    
555bd8deadSopenharmony_ci    This extension interacts with OpenGL ES 2.0.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciOverview
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    This extension adds a mechanism for an application to tell the GL that
615bd8deadSopenharmony_ci    the previous contents of a subregion of an image or a range of a buffer 
625bd8deadSopenharmony_ci    may be invalidated.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    GL implementations often include several memory spaces, each with 
655bd8deadSopenharmony_ci    distinct performance characteristics, and the implementations 
665bd8deadSopenharmony_ci    transparently move allocations between memory spaces. With this 
675bd8deadSopenharmony_ci    extension, an application can tell the GL that the contents of a texture
685bd8deadSopenharmony_ci    or buffer are no longer needed, and the implementation can avoid 
695bd8deadSopenharmony_ci    transferring the data unnecessarily.
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    Examples of when this may be useful include:
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    (1) invalidating a multisample texture after resolving it into a non-
745bd8deadSopenharmony_ci        multisample texture.
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    (2) invalidating depth/stencil buffers after using them to generate a color
775bd8deadSopenharmony_ci        buffer.
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    (3) invalidating a subregion of a framebuffer rather than clearing it 
805bd8deadSopenharmony_ci        before rendering to it, when the whole subregion will be overwritten.
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    (4) invalidating dynamically generated data (e.g. textures written by FBO 
835bd8deadSopenharmony_ci        rendering or CopyTexSubImage, buffers written by transform feedback,
845bd8deadSopenharmony_ci        etc.) after it is no longer needed but before the end of the frame.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci    It is expected that the situations in which the GL will take advantage of
875bd8deadSopenharmony_ci    this knowledge and achieve increased performance as a result of its use
885bd8deadSopenharmony_ci    will be implementation-dependent. The first three examples may show 
895bd8deadSopenharmony_ci    benefit on tiled renderers where some data won't need to be copied into 
905bd8deadSopenharmony_ci    or out of on-chip memory. The fourth example may show a benefit in multi-
915bd8deadSopenharmony_ci    GPU systems where some data won't need to be copied between GPUs.
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    This extension is a superset of the EXT_discard_framebuffer extension 
945bd8deadSopenharmony_ci    with the following additions:
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci      - The parameters to InvalidateFramebufferEXT are extended for MRT support
975bd8deadSopenharmony_ci        and Desktop-GL-only buffer enums.
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ci      - New functions to invalidate a region of a texture image or buffer object
1005bd8deadSopenharmony_ci        data store.
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ciNew Procedures and Functions
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ci    void InvalidateTexSubImage(uint texture, int level,
1065bd8deadSopenharmony_ci                               int xoffset, int yoffset, int zoffset,
1075bd8deadSopenharmony_ci                               sizei width, sizei height, sizei depth);
1085bd8deadSopenharmony_ci    void InvalidateTexImage(uint texture, int level);
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    void InvalidateBufferSubData(uint buffer, intptr offset, sizeiptr length);
1115bd8deadSopenharmony_ci    void InvalidateBufferData(uint buffer);
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci    void InvalidateFramebuffer(enum target, 
1145bd8deadSopenharmony_ci                               sizei numAttachments, 
1155bd8deadSopenharmony_ci                               const enum *attachments);
1165bd8deadSopenharmony_ci    void InvalidateSubFramebuffer(enum target, 
1175bd8deadSopenharmony_ci                                  sizei numAttachments, 
1185bd8deadSopenharmony_ci                                  const enum *attachments,
1195bd8deadSopenharmony_ci                                  int x, int y, sizei width, sizei height);
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ciNew Tokens
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    None.
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 3.2 Specification (OpenGL Operation)
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    Add a new Section 2.9.X (Invalidating Buffer Data)
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    Invalidating Buffer Data
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci    All or part of the data store of a buffer object may be invalidated by
1345bd8deadSopenharmony_ci    calling
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci        void InvalidateBufferSubData(uint buffer, intptr offset, sizeiptr length);
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci    with <buffer> set to the name of the buffer whose data store is being 
1395bd8deadSopenharmony_ci    invalidated. <offset> and <length> specify the range of the data in the 
1405bd8deadSopenharmony_ci    buffer object that is to be invalidated. If <buffer> is zero or is not the 
1415bd8deadSopenharmony_ci    name of a buffer, the error INVALID_VALUE is generated. An INVALID_VALUE 
1425bd8deadSopenharmony_ci    error is generated if <offset> or <length> is negative, or if <offset> + 
1435bd8deadSopenharmony_ci    <length> is greater than the value of BUFFER_SIZE. An INVALID_OPERATION
1445bd8deadSopenharmony_ci    error is generated if the buffer is currently mapped by MapBuffer, or if
1455bd8deadSopenharmony_ci    the invalidate range intersects the range currently mapped by 
1465bd8deadSopenharmony_ci    MapBufferRange. After this command, data in the specified range have 
1475bd8deadSopenharmony_ci    undefined values.
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci     The command
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci        void InvalidateBufferData(uint buffer);
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    is equivalent to calling InvalidateBufferSubData with <offset> equal to 
1545bd8deadSopenharmony_ci    zero and <length> equal to the value of BUFFER_SIZE.
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci
1575bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 3.2 Specification (Rasterization)
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci    Add a new Section 3.9.X (Invalidating Texture Image Data)
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    Invalidating Texture Image Data
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    All or part of a texture image may be invalidated by calling
1645bd8deadSopenharmony_ci    
1655bd8deadSopenharmony_ci        void InvalidateTexSubImage(uint texture, int level,
1665bd8deadSopenharmony_ci                                   int xoffset, int yoffset, int zoffset,
1675bd8deadSopenharmony_ci                                   sizei width, sizei height, sizei depth);
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    with <texture> and <level> indicating which texture image is being
1705bd8deadSopenharmony_ci    invalidated. After this command, data in that subregion have undefined
1715bd8deadSopenharmony_ci    values. <xoffset>, <yoffset>, <zoffset>, <width>, <height>, and <depth>
1725bd8deadSopenharmony_ci    are interpreted as they are in TexSubImage3D. For texture targets that
1735bd8deadSopenharmony_ci    don't have certain dimensions, this command treats those dimensions as
1745bd8deadSopenharmony_ci    having a size of 1. For example, to invalidate a portion of a two-
1755bd8deadSopenharmony_ci    dimensional texture, the application would use <zoffset> equal to zero and
1765bd8deadSopenharmony_ci    <depth> equal to one. Cube map textures are treated as an array of six
1775bd8deadSopenharmony_ci    slices in the z-dimension, where a value of <zoffset> is interpreted as
1785bd8deadSopenharmony_ci    specifying face TEXTURE_CUBE_MAP_POSITIVE_X + <zoffset>.
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    If <level> is less than zero or greater than the base 2 logarithm of the
1815bd8deadSopenharmony_ci    maximum texture width, height, or depth, the error INVALID_VALUE is
1825bd8deadSopenharmony_ci    generated. The arguments <xoffset>, <yoffset>, <zoffset>, <width>,
1835bd8deadSopenharmony_ci    <height>, and <depth> generate the same errors as in the TexSubImage
1845bd8deadSopenharmony_ci    commands. That is, the specified subregion must be between -<b> and
1855bd8deadSopenharmony_ci    <dim>+<b> where <dim> is the size of the dimension of the texture image,
1865bd8deadSopenharmony_ci    and <b> is the size of the border of that texture image, otherwise
1875bd8deadSopenharmony_ci    INVALID_VALUE is generated (border is not applied to dimensions that don't
1885bd8deadSopenharmony_ci    exist in a given texture target). If <texture> is zero or is not the name
1895bd8deadSopenharmony_ci    of a texture, the error INVALID_VALUE is generated. It is not possible to
1905bd8deadSopenharmony_ci    invalidate a portion of a default texture. If the target of <texture> is
1915bd8deadSopenharmony_ci    TEXTURE_RECTANGLE, TEXTURE_BUFFER, TEXTURE_2D_MULTISAMPLE, or
1925bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE_ARRAY, and <level> is not zero, the error
1935bd8deadSopenharmony_ci    INVALID_VALUE is generated.
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    The command
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci        void InvalidateTexImage(uint texture, int level);
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    is equivalent to calling InvalidateTexSubImage with <xoffset>, <yoffset>,
2005bd8deadSopenharmony_ci    and <zoffset> equal to <-b> and <width>, <height>, and <depth> equal to 
2015bd8deadSopenharmony_ci    the dimensions of the texture image plus 2*<b> (or zero and one for 
2025bd8deadSopenharmony_ci    dimensions the texture doesn't have).
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 3.2 Specification (Per-Fragment Operations
2065bd8deadSopenharmony_ciand the Frame Buffer)
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci    Add a new section 4.5 (Invalidating Framebuffer Contents)
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    The GL provides a means for invalidating portions of every pixel or a 
2115bd8deadSopenharmony_ci    subregion of pixels in a particular buffer, effectively leaving their 
2125bd8deadSopenharmony_ci    contents undefined.  The command
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci        void InvalidateSubFramebuffer(enum target, 
2155bd8deadSopenharmony_ci                                      sizei numAttachments, 
2165bd8deadSopenharmony_ci                                      const enum *attachments
2175bd8deadSopenharmony_ci                                      int x, int y, sizei width, sizei height);
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    effectively signals to the GL that it need not preserve all contents of
2205bd8deadSopenharmony_ci    a bound framebuffer object. <numAttachments> indicates how many 
2215bd8deadSopenharmony_ci    attachments are supplied in the <attachments> list. If <numAttachments> 
2225bd8deadSopenharmony_ci    is less than zero, the error INVALID_VALUE is generated. If an attachment
2235bd8deadSopenharmony_ci    is specified that does not exist in the framebuffer bound to <target>, it
2245bd8deadSopenharmony_ci    is ignored. <target> must be FRAMEBUFFER, DRAW_FRAMEBUFFER, or 
2255bd8deadSopenharmony_ci    READ_FRAMEBUFFER. FRAMEBUFFER is treated as DRAW_FRAMEBUFFER. <x> and <y> 
2265bd8deadSopenharmony_ci    are the origin (with lower left-hand corner at (0,0)) and <width> and 
2275bd8deadSopenharmony_ci    <height> are the width and height, respectively, of the pixel rectangle to 
2285bd8deadSopenharmony_ci    be invalidated. Any of these pixels lying outside of the window allocated 
2295bd8deadSopenharmony_ci    to the current GL context, or outside of the attachments of the currently 
2305bd8deadSopenharmony_ci    bound framebuffer object, are ignored.
2315bd8deadSopenharmony_ci    
2325bd8deadSopenharmony_ci    If a framebuffer object is bound to <target>, then elements of 
2335bd8deadSopenharmony_ci    <attachments> must be COLOR_ATTACHMENTi, DEPTH_ATTACHMENT, or 
2345bd8deadSopenharmony_ci    STENCIL_ATTACHMENT, otherwise the error INVALID_ENUM is generated. If the
2355bd8deadSopenharmony_ci    framebuffer object is not complete, InvalidateFramebuffer may be ignored.
2365bd8deadSopenharmony_ci    If <attachments> contains COLOR_ATTACHMENTm and m is greater than or equal to
2375bd8deadSopenharmony_ci    the value of MAX_COLOR_ATTACHMENTS, then the error INVALID_OPERATION is 
2385bd8deadSopenharmony_ci    generated.
2395bd8deadSopenharmony_ci
2405bd8deadSopenharmony_ci    If the default framebuffer is bound to <target>, then elements of 
2415bd8deadSopenharmony_ci    <attachments> must be any of:
2425bd8deadSopenharmony_ci
2435bd8deadSopenharmony_ci      - FRONT_LEFT, FRONT_RIGHT, BACK_LEFT, BACK_RIGHT, AUXi, and ACCUM, 
2445bd8deadSopenharmony_ci        identifying that specific buffer;
2455bd8deadSopenharmony_ci      - COLOR, which is treated as BACK_LEFT for a double-buffered context
2465bd8deadSopenharmony_ci        and FRONT_LEFT for a single-buffered context;
2475bd8deadSopenharmony_ci      - DEPTH, identifying the depth buffer;
2485bd8deadSopenharmony_ci      - STENCIL, identifying the stencil buffer;
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    otherwise the error INVALID_ENUM is generated.
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci    The command
2535bd8deadSopenharmony_ci
2545bd8deadSopenharmony_ci        void InvalidateFramebuffer(enum target, 
2555bd8deadSopenharmony_ci                                   sizei numAttachments, 
2565bd8deadSopenharmony_ci                                   const enum *attachments);
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci    is equivalent to the command InvalidateSubFramebuffer with <x>, 
2595bd8deadSopenharmony_ci    <y>, <width>, <height> equal to 0, 0, <MAX_VIEWPORT_DIMS[0]>, 
2605bd8deadSopenharmony_ci    <MAX_VIEWPORT_DIMS[1]> respectively.
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci
2635bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 3.2 Specification (Special Functions)
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci    None.
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 3.2 Specification (State and
2685bd8deadSopenharmony_ciState Requests)
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci    None.
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ciAdditions to the OpenGL Shading Language Specification
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci    None.
2755bd8deadSopenharmony_ci
2765bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    None.
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ciErrors
2815bd8deadSopenharmony_ci
2825bd8deadSopenharmony_ci    XXX TODO
2835bd8deadSopenharmony_ci
2845bd8deadSopenharmony_ci
2855bd8deadSopenharmony_ciDependencies on OpenGL ES 2.0
2865bd8deadSopenharmony_ci
2875bd8deadSopenharmony_ci    If this extension is implemented on OpenGL ES 2.0, the following
2885bd8deadSopenharmony_ci    simplifications apply:
2895bd8deadSopenharmony_ci    
2905bd8deadSopenharmony_ci    - Only COLOR_ATTACHMENT0, DEPTH_ATTACHMENT, STENCIL_ATTACHMENT, COLOR_EXT,
2915bd8deadSopenharmony_ci      DEPTH_EXT, and STENCIL_EXT are accepted in InvalidateSubFramebuffer and 
2925bd8deadSopenharmony_ci      InvalidateFramebuffer. COLOR_EXT, DEPTH_EXT, and STENCIL_EXT are defined
2935bd8deadSopenharmony_ci      by EXT_discard_framebuffer.
2945bd8deadSopenharmony_ci
2955bd8deadSopenharmony_ci    - Bordered textures are not supported, so the subregion in 
2965bd8deadSopenharmony_ci      InvalidateTexSubImage must be between 0 and <dim>.
2975bd8deadSopenharmony_ci
2985bd8deadSopenharmony_ci    - 3D textures are not supported, so that language in InvalidateTexSubImage
2995bd8deadSopenharmony_ci      doesn't apply.
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    - MapBuffer(Range) are not supported, so that error check is removed from
3025bd8deadSopenharmony_ci      InvalidateBufferSubData and InvalidateBufferData.
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci    - READ_FRAMEBUFFER/DRAW_FRAMEBUFFER are not accepted by 
3055bd8deadSopenharmony_ci      Invalidate(Sub)Framebuffer.
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ciNew State
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci    None.
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ciNew Implementation Dependent State
3125bd8deadSopenharmony_ci
3135bd8deadSopenharmony_ci    None.
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ciExamples
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    XXX TODO
3185bd8deadSopenharmony_ci
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ciIssues
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci    (1) Should these commands use <target> or <name> to specify the object?
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ci    RESOLVED: Use <name> for textures and buffers, to avoid requiring the 
3255bd8deadSopenharmony_ci    application to disturb any bindings in order to use it. 
3265bd8deadSopenharmony_ci    Invalidate(Sub)Framebuffer only applies to the currently bound draw or 
3275bd8deadSopenharmony_ci    read framebuffers.
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci    (2) Should Invalidate(Sub)Framebuffer have any accommodations for 
3305bd8deadSopenharmony_ci    invalidating a range in the z-dimension for a 3D or layered texture?
3315bd8deadSopenharmony_ci
3325bd8deadSopenharmony_ci    RESOLVED: No, all layers are invalidated, the same behavior as a Clear.
3335bd8deadSopenharmony_ci    An application can use InvalidateTexSubImage to invalidate a subregion in 
3345bd8deadSopenharmony_ci    the z-dimension.
3355bd8deadSopenharmony_ci
3365bd8deadSopenharmony_ci    (3) Should Invalidate(Sub)Framebuffer be able to use the READ_FRAMEBUFFER
3375bd8deadSopenharmony_ci    binding?
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci    RESOLVED: Yes. One common use case for Invalidate(Sub)Framebuffer is to 
3405bd8deadSopenharmony_ci    invalidate the contents of a multisample buffer immediately after using 
3415bd8deadSopenharmony_ci    BlitFramebuffer to resolve it. At this point, the multisample buffer will
3425bd8deadSopenharmony_ci    be attached to the current READ_FRAMEBUFFER, so invalidating it is as easy 
3435bd8deadSopenharmony_ci    as
3445bd8deadSopenharmony_ci    
3455bd8deadSopenharmony_ci        InvalidateFramebuffer(READ_FRAMEBUFFER, 1, [COLOR_ATTACHMENTi]);
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci    This is a superset of the EXT_discard_framebuffer extension which only 
3485bd8deadSopenharmony_ci    allowed FRAMEBUFFER since GLES 2.0 does not support separate read/draw
3495bd8deadSopenharmony_ci    targets.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci    (4) Should there be special handling for mapped buffers or buffers in use
3525bd8deadSopenharmony_ci    by transform feedback? These are two cases where a buffer is being 
3535bd8deadSopenharmony_ci    written to over a period of time.
3545bd8deadSopenharmony_ci
3555bd8deadSopenharmony_ci    RESOLVED: Raise an error for Invalidate on mapped buffers, but not for 
3565bd8deadSopenharmony_ci    transform feedback.
3575bd8deadSopenharmony_ci
3585bd8deadSopenharmony_ci    For mapped buffers, the GL doesn't know the order of the CPU writes
3595bd8deadSopenharmony_ci    versus the invalidate. i.e. it can't distinguish between "write then 
3605bd8deadSopenharmony_ci    Invalidate then Unmap" vs "Invalidate then write then Unmap". Trying to order
3615bd8deadSopenharmony_ci    Invalidates against CPU writes would additionally require Invalidates to be
3625bd8deadSopenharmony_ci    processed synchronously. Mapped buffers already provide a means to 
3635bd8deadSopenharmony_ci    invalidate via the ARB_map_buffer_range extension.
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci    For transform feedback, the GL is in control of when writes occur to the
3665bd8deadSopenharmony_ci    attached buffers, and therefore knows when writes occur relative to the
3675bd8deadSopenharmony_ci    Invalidate commands. So Invalidates are well-defined in this case. It's 
3685bd8deadSopenharmony_ci    desirable to have this resolved in the same way as textures bound to an 
3695bd8deadSopenharmony_ci    FBO, which we also leave as well-defined.
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    (5) Should we have a way to invalidate renderbuffers by name?
3725bd8deadSopenharmony_ci
3735bd8deadSopenharmony_ci    RESOLVED: No. 
3745bd8deadSopenharmony_ci    
3755bd8deadSopenharmony_ci    OpenGL 3.2 adds support for multisample textures, so there isn't any 
3765bd8deadSopenharmony_ci    reason for renderbuffers to exist anymore. However, some GL ES
3775bd8deadSopenharmony_ci    implementations may wish to implement this extension in an environment 
3785bd8deadSopenharmony_ci    where ARB_texture_multisample is not supported and renderbuffers are the
3795bd8deadSopenharmony_ci    only way to get a multisample image. There are multiple options here:
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci    - Add a new command for invalidating contents of a renderbuffer.
3825bd8deadSopenharmony_ci
3835bd8deadSopenharmony_ci    - Add a <target> parameter to Invalidate*Image to distinguish between 
3845bd8deadSopenharmony_ci      texture names and renderbuffer names.
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci    - Hope that Invalidate(Sub)Framebuffer is sufficient, which it is at 
3875bd8deadSopenharmony_ci      least for the use case described in issue (3).
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci    We choose the third option, and recommend using multisample textures 
3905bd8deadSopenharmony_ci    going forward.
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci    (6) Should the subregion for InvalidateSubFramebuffer be explicitly 
3935bd8deadSopenharmony_ci    specified, or re-use the Scissor?
3945bd8deadSopenharmony_ci
3955bd8deadSopenharmony_ci    RESOLVED: Explicitly specified in coordinates similar to Scissor, but 
3965bd8deadSopenharmony_ci    not reusing the Scissor state. The Scissor is a fragment operation and 
3975bd8deadSopenharmony_ci    InvalidateSubFramebuffer does not generate fragments, so it's more 
3985bd8deadSopenharmony_ci    logical to have a separate rectangle.
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci    (7) Do we need Sub/non-Sub versions of InvalidateFramebuffer?
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci    RESOLVED: Yes, to make this extension a superset of 
4035bd8deadSopenharmony_ci    EXT_discard_framebuffer. Strictly speaking the answer is "no", because 
4045bd8deadSopenharmony_ci    an application can use values of (0,0,maxViewport[0],maxViewport[1]) to 
4055bd8deadSopenharmony_ci    invalidate entire images. This is in contrast to the buffer and texture 
4065bd8deadSopenharmony_ci    commands that error-check the parameters against the size of the data 
4075bd8deadSopenharmony_ci    store. 
4085bd8deadSopenharmony_ci    
4095bd8deadSopenharmony_ci    Since window-system framebuffers can change size asynchronously, we don't
4105bd8deadSopenharmony_ci    want to error-check the parameters of InvalidateSubFramebuffer. However, 
4115bd8deadSopenharmony_ci    InvalidateBufferSubData and InvalidateTexSubImage should error-check to 
4125bd8deadSopenharmony_ci    be consistent with MapBufferRange and TexSubImage.
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ciRevision History
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
4185bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------
4195bd8deadSopenharmony_ci    1     10/01/10  jbolz     Internal revisions.
4205bd8deadSopenharmony_ci    2     01/12/12  jbolz     Updates to match ES.
4215bd8deadSopenharmony_ci    3     04/16/12  pbrown    Fix the error for <level>!=0 on rectangle,
4225bd8deadSopenharmony_ci                              buffer and multisample textures to refer to
4235bd8deadSopenharmony_ci                              the target of <texture> instead of a <target>
4245bd8deadSopenharmony_ci                              parameter.
4255bd8deadSopenharmony_ci    4     05/08/12  pbrown    Fix typo in spec language describing the
4265bd8deadSopenharmony_ci                              interpretation of <zoffset> for cube maps.
4275bd8deadSopenharmony_ci    5     07/30/12  jbolz     Add missing error for <buffer>==0.
4285bd8deadSopenharmony_ci
429