15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    ARB_internalformat_query
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_ARB_internalformat_query
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Jan-Harald Fredriksen (jan-harald.fredriksen 'at' arm.com)
125bd8deadSopenharmony_ci    Daniel Koch (daniel 'at' transgaming 'dot' com)
135bd8deadSopenharmony_ci
145bd8deadSopenharmony_ciContributors
155bd8deadSopenharmony_ci
165bd8deadSopenharmony_ci    Bruce Merry, ARM
175bd8deadSopenharmony_ci    Daniel Koch, Transgaming
185bd8deadSopenharmony_ci    Acorn Pooley, NVIDIA
195bd8deadSopenharmony_ci    Christophe Riccio, Imagination Technologies
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciNotice
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Copyright (c) 2011-2013 The Khronos Group Inc. Copyright terms at
245bd8deadSopenharmony_ci        http://www.khronos.org/registry/speccopyright.html
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciSpecification Update Policy
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Khronos-approved extension specifications are updated in response to
295bd8deadSopenharmony_ci    issues and bugs prioritized by the Khronos OpenGL Working Group. For
305bd8deadSopenharmony_ci    extensions which have been promoted to a core Specification, fixes will
315bd8deadSopenharmony_ci    first appear in the latest version of that core Specification, and will
325bd8deadSopenharmony_ci    eventually be backported to the extension document. This policy is
335bd8deadSopenharmony_ci    described in more detail at
345bd8deadSopenharmony_ci        https://www.khronos.org/registry/OpenGL/docs/update_policy.php
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ciStatus
375bd8deadSopenharmony_ci
385bd8deadSopenharmony_ci    Complete. Approved by the ARB on 2011/06/20.
395bd8deadSopenharmony_ci    Approved by the Khronos Promoters on 2011/07/29.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciVersion
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    Last Modified Date: June 13, 2011
445bd8deadSopenharmony_ci    Revision: 7 
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ciNumber
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ci    ARB Extension #112
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciDependencies
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    OpenGL 3.0 or ARB_framebuffer_object is required.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.1 (Core Profile)
555bd8deadSopenharmony_ci    Specification (July 25, 2010).
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    ARB_texture_multisample affects the definition of this extension.
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ciOverview
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    OpenGL 4.1 has a number of queries to indicate the maximum number of
625bd8deadSopenharmony_ci    samples available for different formats. These give a coarse-grained
635bd8deadSopenharmony_ci    query mechanism e.g. an implementation can expose different sample
645bd8deadSopenharmony_ci    counts for integer and floating-point formats, but not for different
655bd8deadSopenharmony_ci    floating-point formats. There is also no convenient way for the user
665bd8deadSopenharmony_ci    to determine the granularity of sample counts available, only the
675bd8deadSopenharmony_ci    maximum.
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    This extension adds a query mechanism that allows the user to
705bd8deadSopenharmony_ci    determine which sample counts are available for a specific internal
715bd8deadSopenharmony_ci    format.
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ciIP Status
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    No known IP claims.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ciNew Procedures and Functions
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    void GetInternalformativ(enum target, enum internalformat,
805bd8deadSopenharmony_ci                             enum pname, sizei bufSize, int *params);
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ciNew Types
835bd8deadSopenharmony_ci
845bd8deadSopenharmony_ci    None.
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ciNew Tokens
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci    Accepted by the <target> parameter of GetInternalformativ:
895bd8deadSopenharmony_ci
905bd8deadSopenharmony_ci        RENDERBUFFER
915bd8deadSopenharmony_ci        TEXTURE_2D_MULTISAMPLE
925bd8deadSopenharmony_ci        TEXTURE_2D_MULTISAMPLE_ARRAY
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetInternalformativ:
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci        SAMPLES
975bd8deadSopenharmony_ci        NUM_SAMPLE_COUNTS                          0x9380
985bd8deadSopenharmony_ci
995bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.1 (Core Profile) Specification
1005bd8deadSopenharmony_ci(OpenGL Operation)
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    None.
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 4.1 (Core Profile) Specification
1055bd8deadSopenharmony_ci(Rasterization)
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    In section 3.8.6 (Multisample Textures), replace the bulleted
1085bd8deadSopenharmony_ci    list of error conditions (for exceeding MAX_*_SAMPLES) and the
1095bd8deadSopenharmony_ci    preceeding sentence with:
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci        "The error INVALID_OPERATION will be generated if <samples> is
1125bd8deadSopenharmony_ci        greater than the maximum number of samples supported for this
1135bd8deadSopenharmony_ci        <target> and <internalformat>, which can be determined by
1145bd8deadSopenharmony_ci        calling GetInternalformativ with a <pname> of SAMPLES (see
1155bd8deadSopenharmony_ci        section 6.X)."
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    In the following paragraph, remove "or if samples is greater
1185bd8deadSopenharmony_ci    than MAX_SAMPLES".
1195bd8deadSopenharmony_ci
1205bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 4.1 (Core Profile) Specification
1215bd8deadSopenharmony_ci(Per-Fragment Operations and the Frame Buffer)
1225bd8deadSopenharmony_ci
1235bd8deadSopenharmony_ci    In section 4.4.2 (Attaching Images to Framebuffer Objects), under
1245bd8deadSopenharmony_ci    the description of RenderbufferStorageMultisample:
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci    Replace
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci        "If either <width> or <height> is greater than the value of
1295bd8deadSopenharmony_ci        MAX_RENDERBUFFER_SIZE, or if <samples> is greater than the value
1305bd8deadSopenharmony_ci        of MAX_SAMPLES, then the error INVALID_VALUE is generated. If
1315bd8deadSopenharmony_ci        <internalformat> is a signed or unsigned integer format and
1325bd8deadSopenharmony_ci        <samples> is greater than the value of MAX_INTEGER_SAMPLES, then
1335bd8deadSopenharmony_ci        the error INVALID_OPERATION is generated (see ``Required
1345bd8deadSopenharmony_ci        Renderbuffer Formats'' below)."
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    with
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci        "If either <width> or <height> is greater than the value of
1395bd8deadSopenharmony_ci        MAX_RENDERBUFFER_SIZE then the error INVALID_VALUE is
1405bd8deadSopenharmony_ci        generated. If <samples> is greater than the maximum number of
1415bd8deadSopenharmony_ci        samples supported for <internalformat> then the error
1425bd8deadSopenharmony_ci        INVALID_OPERATION is generated (see GetInternalformativ in
1435bd8deadSopenharmony_ci        section 6.X)."
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 4.1 (Compatibility Profile)
1465bd8deadSopenharmony_ciSpecification (Special Functions)
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci    Add GetInternalformativ to the list of commands not included in
1495bd8deadSopenharmony_ci    display lists.
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 4.1 (Core Profile) Specification
1525bd8deadSopenharmony_ci(State and State Requests)
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    Add a new section 6.1.X "Internalformat queries"
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    Information about implementation-dependent support for internal
1575bd8deadSopenharmony_ci    formats can be queried with the command
1585bd8deadSopenharmony_ci
1595bd8deadSopenharmony_ci    void GetInternalformativ(enum target, enum internalformat,
1605bd8deadSopenharmony_ci                             enum pname, sizei bufSize, int *params);
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci    <internalformat> must be color-renderable, depth-renderable or
1635bd8deadSopenharmony_ci    stencil-renderable (as defined in section 4.4.4).
1645bd8deadSopenharmony_ci
1655bd8deadSopenharmony_ci    <target> indicates the usage of the <internalformat>, and must be
1665bd8deadSopenharmony_ci    one of RENDERBUFFER, TEXTURE_2D_MULTISAMPLE, or
1675bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE_ARRAY, corresponding to usage as a
1685bd8deadSopenharmony_ci    renderbuffer, 2D multisample texture, or 2D multisample array
1695bd8deadSopenharmony_ci    texture.
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    No more than <bufSize> integers will be written into <params>. If
1725bd8deadSopenharmony_ci    more data are available, they will be ignored and no error will be
1735bd8deadSopenharmony_ci    generated.
1745bd8deadSopenharmony_ci
1755bd8deadSopenharmony_ci    <pname> indicates the information to query, and is one of the
1765bd8deadSopenharmony_ci    following:
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci    - SAMPLES: The sample counts supported for this <format> and
1795bd8deadSopenharmony_ci      <target> are written into <params>, in descending order. Only
1805bd8deadSopenharmony_ci      positive values are returned.
1815bd8deadSopenharmony_ci    - NUM_SAMPLE_COUNTS: The number of sample counts that would be
1825bd8deadSopenharmony_ci      returned by querying SAMPLES is returned in <params>.
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    Note that querying SAMPLES with a <bufSize> of 1 will return just
1855bd8deadSopenharmony_ci    the maximum supported number of samples for this format.
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ci    The maximum value in SAMPLES is guaranteed to be at least the lowest
1885bd8deadSopenharmony_ci    of the following:
1895bd8deadSopenharmony_ci    - The value of GetIntegerv(MAX_INTEGER_SAMPLES), if <internalformat>
1905bd8deadSopenharmony_ci      is a signed or unsigned integer format.
1915bd8deadSopenharmony_ci    - The value of GetIntegerv(MAX_DEPTH_TEXTURE_SAMPLES), if
1925bd8deadSopenharmony_ci      <internalformat> is a depth/stencil-renderable format and <target>
1935bd8deadSopenharmony_ci      is TEXTURE_2D_MULTISAMPLE or TEXTURE_2D_MULTISAMPLE_ARRAY.
1945bd8deadSopenharmony_ci    - The value of GetIntegerv(MAX_COLOR_TEXTURE_SAMPLES), if
1955bd8deadSopenharmony_ci      <internalformat> is a color-renderable format and <target> is
1965bd8deadSopenharmony_ci      TEXTURE_2D_MULTISAMPLE or TEXTURE_2D_MULTISAMPLE_ARRAY.
1975bd8deadSopenharmony_ci    - The value of GetIntegerv(MAX_SAMPLES).
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 4.1 (Core Profile) Specification
2005bd8deadSopenharmony_ci(Invariance)
2015bd8deadSopenharmony_ci
2025bd8deadSopenharmony_ci    None.
2035bd8deadSopenharmony_ci
2045bd8deadSopenharmony_ciAdditions to Appendix D of the OpenGL 4.1 (Core Profile) Specification
2055bd8deadSopenharmony_ci(Shared Objects and Multiple Contexts)
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    None.
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ciGLX Protocol
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci    XXX - TODO.
2125bd8deadSopenharmony_ci
2135bd8deadSopenharmony_ciDependencies on ARB_texture_multisample
2145bd8deadSopenharmony_ci
2155bd8deadSopenharmony_ci    If OpenGL 3.2 or ARB_texture_multisample is not supported, then
2165bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE and TEXTURE_2D_MULTISAMPLE_ARRAY are not
2175bd8deadSopenharmony_ci    supported <target> parameters to GetInternalformativ.
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ciDependencies on OpenGL ES
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    If implemented on OpenGL ES (together with an extension adding
2225bd8deadSopenharmony_ci    RenderbufferStorageMultisample), then this extension behaves as
2235bd8deadSopenharmony_ci    specified, except:
2245bd8deadSopenharmony_ci
2255bd8deadSopenharmony_ci    - Ignore all references to multisample textures and display lists.
2265bd8deadSopenharmony_ci    - Ignore all references to MAX_COLOR_TEXTURE_SAMPLES,
2275bd8deadSopenharmony_ci      MAX_DEPTH_TEXTURE_SAMPLES, MAX_INTEGER_SAMPLES and MAX_SAMPLES.
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ciErrors
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci    If the <internalformat> parameter to GetInternalformativ is not
2325bd8deadSopenharmony_ci    color-, depth- or stencil-renderable, then an INVALID_ENUM error is
2335bd8deadSopenharmony_ci    generated.
2345bd8deadSopenharmony_ci
2355bd8deadSopenharmony_ci    If the <target> parameter to GetInternalformativ is not one of
2365bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE, TEXTURE_2D_MULTISAMPLE_ARRAY or RENDERBUFFER
2375bd8deadSopenharmony_ci    then an INVALID_ENUM error is generated.
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    If the <pname> parameter to GetInternalformativ is not SAMPLES
2405bd8deadSopenharmony_ci    or NUM_SAMPLE_COUNTS, then an INVALID_ENUM error is generated.
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci    If the <bufSize> parameter to GetInternalformativ is negative,
2435bd8deadSopenharmony_ci    then an INVALID_VALUE error is generated.
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    If the <samples> parameter to TexImage2DMultisample,
2465bd8deadSopenharmony_ci    TexImage3DMultisample or RenderbufferStorageMultisample is greater
2475bd8deadSopenharmony_ci    than the maximum number of samples supported for the target and
2485bd8deadSopenharmony_ci    internalformat, an INVALID_OPERATION error is generated.
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    An INVALID_VALUE error is no longer generated if the <samples>
2515bd8deadSopenharmony_ci    argument to TexImage2DMultisample, TexImage3DMultisample or
2525bd8deadSopenharmony_ci    RenderbufferStorageMultisample is greater than the value of
2535bd8deadSopenharmony_ci    GetIntegerv(MAX_SAMPLES).
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ciNew State
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    None.
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ciNew Implementation Dependent State
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    Changes to table 6.52, p. 393 (Implementation Dependent Values)
2625bd8deadSopenharmony_ci
2635bd8deadSopenharmony_ci                                                                Minimum
2645bd8deadSopenharmony_ci    Get Value                  Type    Get Command              Value    Description                            Sec.
2655bd8deadSopenharmony_ci    ---------                  ----    -----------              -------  ------------------------------------   -----
2665bd8deadSopenharmony_ci    MAX_DEPTH_TEXTURE_SAMPLES  Z+      GetIntegerv               1       Maximum number of samples supported    6.1.X
2675bd8deadSopenharmony_ci                                                                         for all depth/stencil formats in a
2685bd8deadSopenharmony_ci                                                                         multisample texture
2695bd8deadSopenharmony_ci    MAX_COLOR_TEXTURE_SAMPLES  Z+      GetIntegerv               1       Maximum number of samples supported    6.1.X
2705bd8deadSopenharmony_ci                                                                         for all color formats in a
2715bd8deadSopenharmony_ci                                                                         multisample texture
2725bd8deadSopenharmony_ci    MAX_INTEGER_SAMPLES        Z+      GetIntegerv               1       Maximum number of samples supported    6.1.X
2735bd8deadSopenharmony_ci                                                                         for all integer format multisample
2745bd8deadSopenharmony_ci                                                                         buffers
2755bd8deadSopenharmony_ci
2765bd8deadSopenharmony_ci    (only the description and section numbers change)
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    Changes to table 6.54, p. 395 (Framebuffer Dependent Values)
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci                                                                Minimum
2815bd8deadSopenharmony_ci    Get Value                  Type    Get Command              Value    Description                            Sec.
2825bd8deadSopenharmony_ci    ---------                  ----    -----------              -------  ------------------------------------   -----
2835bd8deadSopenharmony_ci    MAX_SAMPLES                Z+      GetIntegerv               4       Maximum number of samples supported    6.1.X
2845bd8deadSopenharmony_ci                                                                         for all non-integer formats
2855bd8deadSopenharmony_ci
2865bd8deadSopenharmony_ci    (only the description and section number change - note this query should
2875bd8deadSopenharmony_ci    probably be in table 6.52 to start with)
2885bd8deadSopenharmony_ci
2895bd8deadSopenharmony_ci    Add new table 6.X Internalformat-specific Implementation Dependent Values after 6.52
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci                                                                Minimum
2925bd8deadSopenharmony_ci    Get Value                  Type    Get Command              Value    Description                            Sec.
2935bd8deadSopenharmony_ci    ---------                  ----    -----------              -------  ------------------------------------   -----
2945bd8deadSopenharmony_ci    SAMPLES                    0*xZ+   GetInternalformativ       fn1     Supported sample counts                6.X
2955bd8deadSopenharmony_ci    NUM_SAMPLE_COUNTS          Z+      GetInternalformativ       1       Number of supported sample counts      6.X
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ci    fn1: see section 6.X.
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ciSample Code
3005bd8deadSopenharmony_ci
3015bd8deadSopenharmony_ci    To determine all the sample counts available for a specific
3025bd8deadSopenharmony_ci    renderbuffer format:
3035bd8deadSopenharmony_ci
3045bd8deadSopenharmony_ci    GLint *samples;
3055bd8deadSopenharmony_ci    GLint samples_length, i;
3065bd8deadSopenharmony_ci
3075bd8deadSopenharmony_ci    glGetInternalformativ(GL_RENDERBUFFER, format,
3085bd8deadSopenharmony_ci                          GL_NUM_SAMPLE_COUNTS, 1, &samples_length);
3095bd8deadSopenharmony_ci    samples = malloc(samples_length * sizeof(GLint));
3105bd8deadSopenharmony_ci    glGetInternalformativ(GL_RENDERBUFFER, format,
3115bd8deadSopenharmony_ci                          GL_SAMPLES, samples_length, samples);
3125bd8deadSopenharmony_ci    for (i = 0; i < samples_length; i++)
3135bd8deadSopenharmony_ci    {
3145bd8deadSopenharmony_ci        printf("Format %#x supports %d samples\n", samples[i]);
3155bd8deadSopenharmony_ci    }
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    To determine the maximum sample count available for a specific
3185bd8deadSopenharmony_ci    renderbuffer format:
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ci    GLint max_samples;
3215bd8deadSopenharmony_ci    glGetInternalformativ(GL_RENDERBUFFER, format,
3225bd8deadSopenharmony_ci                          GL_SAMPLES, 1, &max_samples);
3235bd8deadSopenharmony_ci
3245bd8deadSopenharmony_ciConformance Tests
3255bd8deadSopenharmony_ci
3265bd8deadSopenharmony_ci    1. Test each of the error conditions described in Errors.
3275bd8deadSopenharmony_ci
3285bd8deadSopenharmony_ci    2. For each format that is not color-, depth- or stencil-renderable
3295bd8deadSopenharmony_ci    (if any), test that INVALID_ENUM is generated if passed to
3305bd8deadSopenharmony_ci    GetInternalformativ (e.g. LUMINANCE_ALPHA).
3315bd8deadSopenharmony_ci
3325bd8deadSopenharmony_ci    3. Call GetInternalformativ for each <pname> in turn with a
3335bd8deadSopenharmony_ci    <bufSize> of zero; check that <params> is not modified and that no
3345bd8deadSopenharmony_ci    error results.
3355bd8deadSopenharmony_ci
3365bd8deadSopenharmony_ci    4. For each color-, depth- or stencil-renderable format and each
3375bd8deadSopenharmony_ci    target:
3385bd8deadSopenharmony_ci       4.1. Query NUM_SAMPLE_COUNTS and verify that it is greater than
3395bd8deadSopenharmony_ci       zero.
3405bd8deadSopenharmony_ci       4.2. Query SAMPLES, using a larger-than-necessary buffer, and
3415bd8deadSopenharmony_ci       check that only NUM_SAMPLE_COUNTS values are written.
3425bd8deadSopenharmony_ci       4.3. Check that the values returned by SAMPLES are all positive
3435bd8deadSopenharmony_ci       and strictly decreasing.
3445bd8deadSopenharmony_ci       4.4. Query MAX_SAMPLES and check that it matches the first value
3455bd8deadSopenharmony_ci       returned by SAMPLES.
3465bd8deadSopenharmony_ci       4.5. Check that MAX_SAMPLES is at least the lower bound computed
3475bd8deadSopenharmony_ci       from MAX_SAMPLES, MAX_INTEGER_SAMPLES, MAX_COLOR_TEXTURE_SAMPLES
3485bd8deadSopenharmony_ci       and MAX_DEPTH_TEXTURE_SAMPLES.
3495bd8deadSopenharmony_ci       4.6. Check that MAX_SAMPLE_MASK_WORDS is at least
3505bd8deadSopenharmony_ci       ceil(MAX_SAMPLES / 32).
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ciIssues
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci    1) Should we have the MAX_SAMPLES query as well as the SAMPLES
3555bd8deadSopenharmony_ci    query? It's syntactic sugar (since you can just take the largest
3565bd8deadSopenharmony_ci    value in the SAMPLES array), but very convenient sugar since you
3575bd8deadSopenharmony_ci    don't have to allocate a dynamically-sized array. It also simplifies
3585bd8deadSopenharmony_ci    the specification.
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci    RESOLVED: no, we don't need it. Passing a <bufSize> of 1 when
3615bd8deadSopenharmony_ci    querying SAMPLES gives the same effect.
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci    2) Should we explicitly include 0 in the list of sample counts
3645bd8deadSopenharmony_ci    (meaning "not multisampled")? It might allow one to indicate that certain
3655bd8deadSopenharmony_ci    formats are flat-out unsupported with certain targets but supported with
3665bd8deadSopenharmony_ci    others.
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci    RESOLVED: no, we would rather layer on a separate <pname> later.
3695bd8deadSopenharmony_ci
3705bd8deadSopenharmony_ci    3) For multisample textures, is a per-target query too fine-grained?
3715bd8deadSopenharmony_ci    Should the <target> just be TEXTURE instead of
3725bd8deadSopenharmony_ci    TEXTURE_2D_MULTISAMPLE[_ARRAY]?
3735bd8deadSopenharmony_ci
3745bd8deadSopenharmony_ci    RESOLVED: Keep the per-target query as it may useful to distinguish
3755bd8deadSopenharmony_ci    results for some future values of <pname>.
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    4) What should the new command be called?
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci    RESOLVED: GetInternalformativ
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci    GetInternalformativ is potentially confusing, but consistent with
3825bd8deadSopenharmony_ci    GL precedent such as GetQueryiv (which returns information such as
3835bd8deadSopenharmony_ci    the number of bits supported for a specific query target).
3845bd8deadSopenharmony_ci
3855bd8deadSopenharmony_ci    5) What should the query of the number of samples counts be called?
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci    RESOLVED: NUM_SAMPLE_COUNTS
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci    The original proposal was NUM_SAMPLES, which is consistent with
3905bd8deadSopenharmony_ci    NUM_COMPRESSED_TEXTURE_FORMATS. However, it's confusing because what
3915bd8deadSopenharmony_ci    is being queried is not the number of samples (whereas
3925bd8deadSopenharmony_ci    NUM_COMPRESSED_TEXTURE_FORMATS is the number of compressed texture
3935bd8deadSopenharmony_ci    formats). NUM_SAMPLE_COUNTS is also consistent with the
3945bd8deadSopenharmony_ci    NUM_COMPRESSED_TEXTURE_FORMATS precedent and the description of this
3955bd8deadSopenharmony_ci    value.
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci    Another proposal was SAMPLES_LENGTH, but this is misleading
3985bd8deadSopenharmony_ci    because in OpenGL LENGTH is only used for string length.
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci    6) What should GetIntegerv(MAX_INTEGER_SAMPLES) and similar queries
4015bd8deadSopenharmony_ci    return (excluding MAX_SAMPLES - see next issue)?
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci    Discussion: there are (at least) two options:
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci    A. Querying MAX_INTEGER_SAMPLES returns a count that is guaranteed
4065bd8deadSopenharmony_ci    to be supported for all integer formats, but some integer formats
4075bd8deadSopenharmony_ci    may support more samples and the existing errors are relaxed to
4085bd8deadSopenharmony_ci    allow this.
4095bd8deadSopenharmony_ci
4105bd8deadSopenharmony_ci    B. Require that all integer formats support the same maximum number
4115bd8deadSopenharmony_ci    of samples, and GetInternalformativ becomes an alternative
4125bd8deadSopenharmony_ci    interface to the same set of limits.
4135bd8deadSopenharmony_ci
4145bd8deadSopenharmony_ci    RESOLVED: option A.
4155bd8deadSopenharmony_ci
4165bd8deadSopenharmony_ci    7) What should GetIntegerv(MAX_SAMPLES) return?
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ci    In OpenGL 4.1, MAX_SAMPLES serves two purposes.
4195bd8deadSopenharmony_ci    A. An upper bound on the number of samples supported for any format.
4205bd8deadSopenharmony_ci    This manifests in INVALID_VALUE errors when trying to use more than
4215bd8deadSopenharmony_ci    this number.
4225bd8deadSopenharmony_ci    B. A number of samples that is guaranteed to be supported for all
4235bd8deadSopenharmony_ci    formats that don't fall into certain classes (such as integer
4245bd8deadSopenharmony_ci    formats).
4255bd8deadSopenharmony_ci
4265bd8deadSopenharmony_ci    Backwards compatibility would suggest that it should return option
4275bd8deadSopenharmony_ci    B in future, although this leaves no way to determine the maximum
4285bd8deadSopenharmony_ci    number of samples supported for any format unless a new query is
4295bd8deadSopenharmony_ci    introduced.
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci    RESOLVED: option B.
4325bd8deadSopenharmony_ci
4335bd8deadSopenharmony_ci    8) Does this extension make the MAX_SAMPLES query unnecessary?
4345bd8deadSopenharmony_ci
4355bd8deadSopenharmony_ci    RESOLVED: MAX_SAMPLES will need to be retained in API versions where
4365bd8deadSopenharmony_ci    it already exists (for backwards compatibilities), but there is no
4375bd8deadSopenharmony_ci    need to add it as this query provides more accurate information and
4385bd8deadSopenharmony_ci    it is expected that shipping hardware will support different numbers
4395bd8deadSopenharmony_ci    of samples for different formats.
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci    9) Can we query additional properties supported for an internal format
4425bd8deadSopenharmony_ci    in addition to multisample-related information with this API?
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci    RESOLVED: DEFERRED. Yes this API is suitable for that, but the 
4455bd8deadSopenharmony_ci    specification is left for a layered extension.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    Other possible <pnames> include:
4485bd8deadSopenharmony_ci      MAX_WIDTH
4495bd8deadSopenharmony_ci        - maximum width of object
4505bd8deadSopenharmony_ci      MAX_HEIGHT
4515bd8deadSopenharmony_ci        - maximum height of object
4525bd8deadSopenharmony_ci      MAX_DEPTH   
4535bd8deadSopenharmony_ci        - maximum depth/# of layers of object
4545bd8deadSopenharmony_ci      MAX_COMBINED_SIZE   
4555bd8deadSopenharmony_ci        - maximum size of object (w*h*d) (due to implementation-specific
4565bd8deadSopenharmony_ci          limitations)
4575bd8deadSopenharmony_ci      FRAMEBUFFER_RENDERABLE  
4585bd8deadSopenharmony_ci        - can be rendered to via FBO attachment
4595bd8deadSopenharmony_ci      FRAMEBUFFER_RENDERABLE_BLEND    
4605bd8deadSopenharmony_ci        - can be rendered to via FBO attachment when blending is enabled
4615bd8deadSopenharmony_ci      MIPMAPS 
4625bd8deadSopenharmony_ci        - more than one mipmap can be supported
4635bd8deadSopenharmony_ci      GENERATE_MIPMAPS    
4645bd8deadSopenharmony_ci        - is generate mipmaps supported
4655bd8deadSopenharmony_ci      READPIXEL   
4665bd8deadSopenharmony_ci        - framebuffers with this internal format can be read directly with 
4675bd8deadSopenharmony_ci          an appropriate format/type by ReadPixels
4685bd8deadSopenharmony_ci      FILTER_LINEAR   
4695bd8deadSopenharmony_ci        - can the MIN/MAG filter be set to LINEAR values? Are filters other 
4705bd8deadSopenharmony_ci          than NEAREST supported?
4715bd8deadSopenharmony_ci      SRGB_READ   
4725bd8deadSopenharmony_ci        - texture reads from this internalformat occur in SRGB colorspace
4735bd8deadSopenharmony_ci      SRGB_WRITE  
4745bd8deadSopenharmony_ci        - framebuffers with this internalformat can be rendered to with 
4755bd8deadSopenharmony_ci          FRAMEBUFFER_SRGB enabled
4765bd8deadSopenharmony_ci      SRGB_DECODE 
4775bd8deadSopenharmony_ci        - textures of this format support toggling TEXTURE_SRGB_DECODE 
4785bd8deadSopenharmony_ci          (ie EXT_texture_sRGB_decode)
4795bd8deadSopenharmony_ci      VERTEX_TEXTURE  
4805bd8deadSopenharmony_ci        - textures with this internalformat can be sampled from vertex shaders
4815bd8deadSopenharmony_ci      TESS_CONTROL_TEXTURE    
4825bd8deadSopenharmony_ci        - textures with this internalformat can be sampled from tessellation
4835bd8deadSopenharmony_ci          control shaders
4845bd8deadSopenharmony_ci      TESS_EVALUATION_TEXTURE 
4855bd8deadSopenharmony_ci        - textures with this internalformat can be sampled from tessellation
4865bd8deadSopenharmony_ci          evaluation shaders
4875bd8deadSopenharmony_ci      GEOMETRY_TEXTURE    
4885bd8deadSopenharmony_ci        - textures with this internalformat can be sampled from geometry shaders
4895bd8deadSopenharmony_ci      FRAGMENT_TEXTURE    
4905bd8deadSopenharmony_ci        - textures with this internalformat can be sampled from fragment shaders
4915bd8deadSopenharmony_ci      TEXTURE_SHADOW  
4925bd8deadSopenharmony_ci        - textures with this internalformat support shadow samplers
4935bd8deadSopenharmony_ci      TEXTURE_GATHER  
4945bd8deadSopenharmony_ci        - textures with this internalformat support texture gather operations
4955bd8deadSopenharmony_ci      TEXTURE_GATHER_SHADOW   
4965bd8deadSopenharmony_ci        - textures with this internalformat support texture gather operations
4975bd8deadSopenharmony_ci          with shadow samplers
4985bd8deadSopenharmony_ci      SHADER_IMAGE_LOAD   
4995bd8deadSopenharmony_ci        - textures with this internalformat support image load operations
5005bd8deadSopenharmony_ci          from shaders
5015bd8deadSopenharmony_ci      SHADER_IMAGE_STORE  
5025bd8deadSopenharmony_ci        - textures with this internalformat support image store operations
5035bd8deadSopenharmony_ci          from shaders
5045bd8deadSopenharmony_ci      SHADER_IMAGE_ATOMIC 
5055bd8deadSopenharmony_ci        - textures with this internalformat support atomic memory operations
5065bd8deadSopenharmony_ci          from shaders
5075bd8deadSopenharmony_ci      FORMAT_SUPPORTED    
5085bd8deadSopenharmony_ci        - the requested internal format is known and supported for at least
5095bd8deadSopenharmony_ci          some subset of the possible operations
5105bd8deadSopenharmony_ci      ACTUAL_INTERNALFORMAT   
5115bd8deadSopenharmony_ci        - the actual internalformat used by the implementation when the
5125bd8deadSopenharmony_ci          specified internalformat is requested
5135bd8deadSopenharmony_ci      PERFORMANCE_HINT    
5145bd8deadSopenharmony_ci        - an indication that this format will or may operate at reduced
5155bd8deadSopenharmony_ci          performance in some cases (should this be a bitfield, array, 
5165bd8deadSopenharmony_ci          or a specific bit on each of the other queries?)
5175bd8deadSopenharmony_ci
5185bd8deadSopenharmony_ci    Possible values for some of the above pnames:
5195bd8deadSopenharmony_ci        - HARDWARE (or SUPPORTED), SOFTWARE (or CAVEAT), UNSUPPORTED.
5205bd8deadSopenharmony_ci
5215bd8deadSopenharmony_ci    Additional Values for <target> that would be valid for 
5225bd8deadSopenharmony_ci      TEXTURE_1D
5235bd8deadSopenharmony_ci      TEXTURE_1D_ARRAY
5245bd8deadSopenharmony_ci      TEXTURE_2D
5255bd8deadSopenharmony_ci      TEXTURE_2D_ARRAY
5265bd8deadSopenharmony_ci      TEXTURE_3D
5275bd8deadSopenharmony_ci      TEXTURE_CUBE_MAP
5285bd8deadSopenharmony_ci      TEXTURE_CUBE_MAP_ARRAY
5295bd8deadSopenharmony_ci      TEXTURE_RECTANGLE
5305bd8deadSopenharmony_ci      TEXTURE_BUFFER
5315bd8deadSopenharmony_ci    Could also consider meta targets such as: 
5325bd8deadSopenharmony_ci      ALL
5335bd8deadSopenharmony_ci      ANY
5345bd8deadSopenharmony_ci      TEXTURE
5355bd8deadSopenharmony_ci
5365bd8deadSopenharmony_ci
5375bd8deadSopenharmony_ci    10) Is the <target> parameter required?  If so, should it be the first or
5385bd8deadSopenharmony_ci    second parameter?
5395bd8deadSopenharmony_ci
5405bd8deadSopenharmony_ci    RESOLVED: 
5415bd8deadSopenharmony_ci    a) Yes. It is possible that in some implementations and for some of the possible
5425bd8deadSopenharmony_ci    uses of this query, that the results will depend on the texture target.
5435bd8deadSopenharmony_ci    b) First parameter. All other entry points that take a <target> have it as the
5445bd8deadSopenharmony_ci    first parameter. 
5455bd8deadSopenharmony_ci
5465bd8deadSopenharmony_ciRevision History
5475bd8deadSopenharmony_ci    
5485bd8deadSopenharmony_ci    Revision 7, 2011/06/13 dgkoch
5495bd8deadSopenharmony_ci      - recast as ARB extension
5505bd8deadSopenharmony_ci
5515bd8deadSopenharmony_ci    Revision 6, 2011/05/19 dgkoch
5525bd8deadSopenharmony_ci      - resolved issue 3, 9 per F2F.
5535bd8deadSopenharmony_ci
5545bd8deadSopenharmony_ci    Revision 5, 2011/05/16 dgkoch
5555bd8deadSopenharmony_ci      - resolved issue 10 per F2F. Keep target; as the first parameter.
5565bd8deadSopenharmony_ci      - fix extension name
5575bd8deadSopenharmony_ci      - updates to Issue 9
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci    Revision 4, 2011/05/11 dgkoch
5605bd8deadSopenharmony_ci      - also fix the formal paramter in the New Functions area
5615bd8deadSopenharmony_ci      - updates to issue 9, added issue 10
5625bd8deadSopenharmony_ci
5635bd8deadSopenharmony_ci    Revision 3, 2011/05/05 dgkoch
5645bd8deadSopenharmony_ci      - rename the formal parameter from 'format' to 'internalformat' 
5655bd8deadSopenharmony_ci        to match the spec body.
5665bd8deadSopenharmony_ci      - changed SAMPLES_LENGTH to NUM_SAMPLE_COUNTS
5675bd8deadSopenharmony_ci      - added issue 9
5685bd8deadSopenharmony_ci
5695bd8deadSopenharmony_ci    Revision 2, 2011/04/21 bmerry
5705bd8deadSopenharmony_ci      - Fix typo InternalFormat -> Internalformat
5715bd8deadSopenharmony_ci      - Removed per-format MAX_SAMPLES query
5725bd8deadSopenharmony_ci      - Marked issues 1, 2, and 4-7 as resolved
5735bd8deadSopenharmony_ci
5745bd8deadSopenharmony_ci    Revision 1, 2011/04/13 bmerry
5755bd8deadSopenharmony_ci      - First draft.
576