15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_texture_storage_multisample
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_texture_storage_multisample
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Graham Sellers (graham.sellers 'at' amd.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciNotice
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Copyright (c) 2012-2014 The Khronos Group Inc. Copyright terms at
165bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciSpecification Update Policy
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
215bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
225bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
235bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
245bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
255bd8deadSopenharmony_ci    described in more detail at
265bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ciStatus
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ci    Complete.
315bd8deadSopenharmony_ci    Approved by the ARB on 2012/06/12.
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ciVersion
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    Last Modified Date: April 21, 2015
365bd8deadSopenharmony_ci    Version: 9
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ciNumber
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    ARB Extension #141
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ciDependencies
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    OpenGL 4.2 or ARB_texture_storage is required.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    EXT_direct_state_access affects the definition of this extension.
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.2 (Core) Specification.
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciOverview
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    The ARB_texture_storage extension and OpenGL 4.2 introduced the concept
535bd8deadSopenharmony_ci    of immutable texture objects. With these objects, once their data store
545bd8deadSopenharmony_ci    has been sized and allocated, it could not be resized for the lifetime
555bd8deadSopenharmony_ci    of the objects (although its content could be updated). OpenGL
565bd8deadSopenharmony_ci    implementations may be able to take advantage of the knowledge that the
575bd8deadSopenharmony_ci    underlying data store of certain objects cannot be deleted or otherwise
585bd8deadSopenharmony_ci    reallocated without destruction of the whole object (normally, a much
595bd8deadSopenharmony_ci    heavier weight and less frequent operation). Immutable storage
605bd8deadSopenharmony_ci    for all types of textures besides multisample and buffer textures was
615bd8deadSopenharmony_ci    introduced by ARB_texture_storage. For completeness, this extension
625bd8deadSopenharmony_ci    introduces immutable storage for multisampled textures.
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ciIP Status
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    No known IP claims.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ciNew Procedures and Functions
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci        void TexStorage2DMultisample(enum target,
715bd8deadSopenharmony_ci                                     sizei samples,
725bd8deadSopenharmony_ci                                     enum internalformat,
735bd8deadSopenharmony_ci                                     sizei width,
745bd8deadSopenharmony_ci                                     sizei height,
755bd8deadSopenharmony_ci                                     boolean fixedsamplelocations);
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci        void TexStorage3DMultisample(enum target,
785bd8deadSopenharmony_ci                                     sizei samples,
795bd8deadSopenharmony_ci                                     enum internalformat,
805bd8deadSopenharmony_ci                                     sizei width,
815bd8deadSopenharmony_ci                                     sizei height,
825bd8deadSopenharmony_ci                                     sizei depth,
835bd8deadSopenharmony_ci                                     boolean fixedsamplelocations);
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci        (the following two functions are provided if and only if
865bd8deadSopenharmony_ci         EXT_direct_state_access is supported)
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci        void TextureStorage2DMultisampleEXT(uint texture,
895bd8deadSopenharmony_ci                                            enum target,
905bd8deadSopenharmony_ci                                            sizei samples,
915bd8deadSopenharmony_ci                                            enum internalformat,
925bd8deadSopenharmony_ci                                            sizei width,
935bd8deadSopenharmony_ci                                            sizei height,
945bd8deadSopenharmony_ci                                            boolean fixedsamplelocations);
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci        void TextureStorage3DMultisampleEXT(uint texture,
975bd8deadSopenharmony_ci                                            enum target,
985bd8deadSopenharmony_ci                                            sizei samples,
995bd8deadSopenharmony_ci                                            enum internalformat,
1005bd8deadSopenharmony_ci                                            sizei width,
1015bd8deadSopenharmony_ci                                            sizei height,
1025bd8deadSopenharmony_ci                                            sizei depth,
1035bd8deadSopenharmony_ci                                            boolean fixedsamplelocations);
1045bd8deadSopenharmony_ci
1055bd8deadSopenharmony_ciNew Tokens
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    None.
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.2 (Core Profile) Specification
1105bd8deadSopenharmony_ci(OpenGL Operation)
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci    None.
1135bd8deadSopenharmony_ci
1145bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 4.2 (Core Profile) Specification
1155bd8deadSopenharmony_ci(Rasterization)
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    Modifications to Section 3.9.8, "Texture Parameters":
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    Add TEXTURE_2D_MULTISAMPLE and TEXTURE_2D_MULTISAMPLE_ARRAY to the
1205bd8deadSopenharmony_ci    texture targets accepted by TexParameter*.
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci    At the end of Section 3.9.8, modify the last sentence to be:
1235bd8deadSopenharmony_ci
1245bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if TEXTURE_BASE_LEVEL is set
1255bd8deadSopenharmony_ci    to any value other than zero.
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    Add the following paragraph to the end of Section 3.9.8:
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    When <target> is TEXTURE_2D_MULTISAMPLE or
1305bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE_ARRAY, certain texture parameters may not be
1315bd8deadSopenharmony_ci    specified. In this case, an INVALID_OPERATION error is generated if the
1325bd8deadSopenharmony_ci    parameter is any sampler state value from table 6.18. An
1335bd8deadSopenharmony_ci    INVALID_OPERATION error is generated if TEXTURE_BASE_LEVEL is set to any
1345bd8deadSopenharmony_ci    value other than zero.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    In Subsection 3.9.16, "Immutable-Format Texture Images", add the following,
1375bd8deadSopenharmony_ci    after the discussion of TexStorage3D on p. 260:
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci        void TexStorage2DMultisample(enum target,
1405bd8deadSopenharmony_ci                                     sizei samples,
1415bd8deadSopenharmony_ci                                     enum internalformat,
1425bd8deadSopenharmony_ci                                     sizei width,
1435bd8deadSopenharmony_ci                                     sizei height,
1445bd8deadSopenharmony_ci                                     boolean fixedsamplelocations);
1455bd8deadSopenharmony_ci
1465bd8deadSopenharmony_ci    specifies a two-dimensional multisample texture (or proxy). <target> must
1475bd8deadSopenharmony_ci    be TEXTURE_2D_MULTISAMPLE or PROXY_TEXTURE_2D_MULTISAMPLE. The
1485bd8deadSopenharmony_ci    pseudo-code is equivalent to calling TexImage2DMultisample with the
1495bd8deadSopenharmony_ci    equivalently named parameters set to the same values.
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci        void TexStorage3DMultisample(enum target,
1525bd8deadSopenharmony_ci                                     sizei samples,
1535bd8deadSopenharmony_ci                                     enum internalformat,
1545bd8deadSopenharmony_ci                                     sizei width,
1555bd8deadSopenharmony_ci                                     sizei height,
1565bd8deadSopenharmony_ci                                     sizei depth,
1575bd8deadSopenharmony_ci                                     boolean fixedsamplelocations);
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci    specifies a two-dimensional multisample array texture (or proxy). <target>
1605bd8deadSopenharmony_ci    must be TEXTURE_2D_MULTISAMPLE_ARRAY or PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY.
1615bd8deadSopenharmony_ci    The pseudo-code is equivalent to calling TexImage3DMultisample with the
1625bd8deadSopenharmony_ci    equivalently named parameters set to the same values.
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    The functions
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci        void TextureStorage2DMultisampleEXT(uint texture,
1675bd8deadSopenharmony_ci                                            enum target,
1685bd8deadSopenharmony_ci                                            sizei samples,
1695bd8deadSopenharmony_ci                                            enum internalformat,
1705bd8deadSopenharmony_ci                                            sizei width,
1715bd8deadSopenharmony_ci                                            sizei height,
1725bd8deadSopenharmony_ci                                            boolean fixedsamplelocations);
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    and
1755bd8deadSopenharmony_ci
1765bd8deadSopenharmony_ci        void TextureStorage3DMultisampleEXT(uint texture,
1775bd8deadSopenharmony_ci                                            enum target,
1785bd8deadSopenharmony_ci                                            sizei samples,
1795bd8deadSopenharmony_ci                                            enum internalformat,
1805bd8deadSopenharmony_ci                                            sizei width,
1815bd8deadSopenharmony_ci                                            sizei height,
1825bd8deadSopenharmony_ci                                            sizei depth,
1835bd8deadSopenharmony_ci                                            boolean fixedsamplelocations);
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    behave similarly to TexStorage2DMultisample and TexStorage3DMultisample,
1865bd8deadSopenharmony_ci    respectively, except that the texture whose storage to allocate is given
1875bd8deadSopenharmony_ci    by the <texture> parameter rather than being retrieved from the binding of the
1885bd8deadSopenharmony_ci    active texture unit specified by <target>. <name> must be a name previously
1895bd8deadSopenharmony_ci    reserved by a call to GenTextures and not subsequently deleted. If
1905bd8deadSopenharmony_ci    <texture> is not the name of an existing texture object, then one is
1915bd8deadSopenharmony_ci    created with that name.
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 4.2 (Core Profile) Specification
1945bd8deadSopenharmony_ci(Per-Fragment Operations and the Frame Buffer)
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    None.
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 4.2 (Core Profile) Specification
1995bd8deadSopenharmony_ci(Special Functions)
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    None.
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 4.2 (Core Profile) Specification
2045bd8deadSopenharmony_ci(State and State Requests)
2055bd8deadSopenharmony_ci
2065bd8deadSopenharmony_ci    Modifications to Section 6.1.3, "Enumerated Queries"
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ci    Modify the paragraph describing the <target> parameter to of
2095bd8deadSopenharmony_ci    GetTexParameter* as follows:
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    <target> may be one of TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
2125bd8deadSopenharmony_ci    TEXTURE_1D_ARRAY, TEXTURE_2D_ARRAY, TEXTURE_RECTANGLE, TEXTURE_CUBE_MAP,
2135bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP_ARRAY, TEXTURE_2D_MULTISAMPLE or
2145bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE_ARRAY, indicating the currently bound one-, two-,
2155bd8deadSopenharmony_ci    three-dimensional, one- or two-dimensional array, rectangular, cube map,
2165bd8deadSopenharmony_ci    cube map array, two-dimensional multisample, or two-dimensional
2175bd8deadSopenharmony_ci    multisample array texture object, respectively.
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ciErrors
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TexStorage2DMultisample and
2225bd8deadSopenharmony_ci    TexStorage3DMultisample if <samples> is greater than the maximum number
2235bd8deadSopenharmony_ci    of samples supported for the specified <target> and <internalformat>
2245bd8deadSopenharmony_ci    combination.
2255bd8deadSopenharmony_ci
2265bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TexStorage2DMultisample or
2275bd8deadSopenharmony_ci    TexStorage3DMultisample if the value of TEXTURE_IMMUTABLE_FORMAT for the
2285bd8deadSopenharmony_ci    texture currently bound to <target> on the active texture unit is TRUE.
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TextureStorage2DMultisampleEXT and
2315bd8deadSopenharmony_ci    TextureStorage3DMultisampleEXT if <target> does not match the target
2325bd8deadSopenharmony_ci    of the texture object named by the <texture> parameter.
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci    INVALID_VALUE is generated by TexStorage2DMultisample and
2355bd8deadSopenharmony_ci    TexStorage3DMultisample if <width> or <height> is greater than the value
2365bd8deadSopenharmony_ci    of MAX_TEXTURE_SIZE.
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    INVALID_VALUE is generated by TexStorage3DMultisample if <depth> is
2395bd8deadSopenharmony_ci    greater than the value of MAX_ARRAY_TEXTURE_LAYERS.
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TexParameter* if <target> is
2425bd8deadSopenharmony_ci    TEXTURE_RECTANGLE, <pname> is TEXTURE_BASE_LEVEL, and <value> is not
2435bd8deadSopenharmony_ci    zero.
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TexParameter* if <target> is either
2465bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE or TEXTURE_2D_MULTISAMPLE_ARRAY, <pname> is
2475bd8deadSopenharmony_ci    TEXTURE_BASE_LEVEL, and <value> is not zero.
2485bd8deadSopenharmony_ci
2495bd8deadSopenharmony_ci    INVALID_ENUM is generated by TexStorage2DMultisample if <target> is not
2505bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE or PROXY_TEXTURE_2D_MULTISAMPLE.
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci    INVALID_ENUM is generated by TexStorage3DMultisample if <target> is not
2535bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE_ARRAY or PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY.
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    INVALID_OPERATION is generated by TexParameter* if <target> is either
2565bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE or TEXTURE_2D_MULTISAMPLE_ARRAY and <pname>
2575bd8deadSopenharmony_ci    is sampler state value from table 6.18.
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ciNew State
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    None.
2625bd8deadSopenharmony_ci
2635bd8deadSopenharmony_ciConformance Tests
2645bd8deadSopenharmony_ci
2655bd8deadSopenharmony_ci    TBD
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ciDependencies on EXT_direct_state_access
2685bd8deadSopenharmony_ci
2695bd8deadSopenharmony_ci    If the EXT_direct_state_access extension is not supported, remove all
2705bd8deadSopenharmony_ci    references to TextureStorage2DMultisampleEXT and TextureStorage3DMultisampleEXT.
2715bd8deadSopenharmony_ci
2725bd8deadSopenharmony_ciIssues
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci    1) Should TexStorage3DMultisample generate INVALID_VALUE if the
2755bd8deadSopenharmony_ci       <depth> parameter exceeds the allowed limits? Which limit to use?
2765bd8deadSopenharmony_ci
2775bd8deadSopenharmony_ci       DISCUSSION: We do generate errors if <width> or <height> are
2785bd8deadSopenharmony_ci       greater than the value of MAX_TEXTURE_SIZE but it is unclear
2795bd8deadSopenharmony_ci       whether MAX_3D_TEXTURE_SIZE or MAX_ARRAY_TEXTURE_LAYERS should
2805bd8deadSopenharmony_ci       be used. Currently, only MAX_ARRAY_TEXTURE_LAYERS would make
2815bd8deadSopenharmony_ci       sense, but we can also specify the error checking behavior to
2825bd8deadSopenharmony_ci       be based on the <target> parameter.
2835bd8deadSopenharmony_ci       On the other hand, TexImage3DMultisample does not generate
2845bd8deadSopenharmony_ci       any errors based on the value of the <depth> parameter.
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci       RESOLVED: Match the behavior of TexImage3DMultisample.
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ciRevision History
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    Rev.  Date        Author    Changes
2915bd8deadSopenharmony_ci    ----  ----------  --------  ------------------------------------------------
2925bd8deadSopenharmony_ci     9    04/21/2015  Jon Leech Change texture size limits for <depth> parameter
2935bd8deadSopenharmony_ci                                of TexImage3DMultisample to the value of
2945bd8deadSopenharmony_ci                                MAX_ARRAY_TEXTURE_LAYERS (Bug 11135).
2955bd8deadSopenharmony_ci     8    02/28/2014  Jon Leech Change texture size limits for
2965bd8deadSopenharmony_ci                                TexImage3DMultisample to the value of
2975bd8deadSopenharmony_ci                                MAX_3D_TEXTURE_SIZE (Bugs 11134, 11135).
2985bd8deadSopenharmony_ci     7    06/28/2012  pdaniell  Update the error conditions again based on
2995bd8deadSopenharmony_ci                                our agreement in today's ARB meeting.
3005bd8deadSopenharmony_ci     6    06/27/2012  Jon Leech Clean up new error conditions for 2D MS
3015bd8deadSopenharmony_ci                                targets with TexParameter*.
3025bd8deadSopenharmony_ci     5    06/21/2012  gsellers  Allow multisample targets to be used with
3035bd8deadSopenharmony_ci                                TexParameter* and GetTexParameter*.
3045bd8deadSopenharmony_ci     4    05/29/2012  Jon Leech Finish fixing typos with <fixedsamplelocations>.
3055bd8deadSopenharmony_ci     3    05/14/2012  pbrown    Fix typos in <internalformat> parameter names;
3065bd8deadSopenharmony_ci                                change the <internalformat> and
3075bd8deadSopenharmony_ci                                <fixedsamplelocations> parameters to use lower
3085bd8deadSopenharmony_ci                                case for consistency with existing APIs.
3095bd8deadSopenharmony_ci     2    05/02/2012  drakos    Added EXT suffix to TextureStorage*Multisample
3105bd8deadSopenharmony_ci                                where it was missing.
3115bd8deadSopenharmony_ci                                Added issue #1.
3125bd8deadSopenharmony_ci                                Removed error condition based on the value
3135bd8deadSopenharmony_ci                                of <depth>.
3145bd8deadSopenharmony_ci     1    04/19/2012  gsellers  Initial draft
315