15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    AMD_framebuffer_multisample_advanced
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_AMD_framebuffer_multisample_advanced
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Marek Olsak, AMD (marek.olsak 'at' amd.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciStatus
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Complete.
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciVersion
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Last Modified Date:  June 28, 2018
205bd8deadSopenharmony_ci    Revision #1
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciNumber
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    OpenGL Extension #523
255bd8deadSopenharmony_ci    OpenGL ES Extension #303
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciDependencies
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    OpenGL dependencies:
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ci        Requires GL_ARB_framebuffer_object.
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    OpenGL ES dependencies:
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci        Requires OpenGL ES 3.0.
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.5 (Core Profile)
385bd8deadSopenharmony_ci    specification.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ciOverview
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    This extension extends ARB_framebuffer_object by allowing compromises
435bd8deadSopenharmony_ci    between image quality and memory footprint of multisample
445bd8deadSopenharmony_ci    antialiasing.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    ARB_framebuffer_object introduced RenderbufferStorageMultisample
475bd8deadSopenharmony_ci    as a method of defining the parameters for a multisample render
485bd8deadSopenharmony_ci    buffer. This function takes a <samples> parameter that has strict
495bd8deadSopenharmony_ci    requirements on behavior such that no compromises in the final image
505bd8deadSopenharmony_ci    quality are allowed. Additionally, ARB_framebuffer_object requires
515bd8deadSopenharmony_ci    that all framebuffer attachments have the same number of samples.
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    This extension extends ARB_framebuffer_object by providing a new
545bd8deadSopenharmony_ci    function, RenderbufferStorageMultisampleAdvancedAMD, that
555bd8deadSopenharmony_ci    distinguishes between samples and storage samples for color
565bd8deadSopenharmony_ci    renderbuffers where the number of storage samples can be less than
575bd8deadSopenharmony_ci    the number of samples. This extension also allows non-matching sample
585bd8deadSopenharmony_ci    counts between color and depth/stencil renderbuffers.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    This extension does not require any specific combination of sample
615bd8deadSopenharmony_ci    counts to be supported.
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ciIP Status
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ci    No known IP issues.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Procedures and Functions
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    void RenderbufferStorageMultisampleAdvancedAMD(
705bd8deadSopenharmony_ci             enum target, sizei samples, sizei storageSamples,
715bd8deadSopenharmony_ci             enum internalformat, sizei width, sizei height );
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    void NamedRenderbufferStorageMultisampleAdvancedAMD(
745bd8deadSopenharmony_ci             uint renderbuffer, sizei samples, sizei storageSamples,
755bd8deadSopenharmony_ci             enum internalformat, sizei width, sizei height );
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ciNew Tokens
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetRenderbufferParameteriv:
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci        RENDERBUFFER_STORAGE_SAMPLES_AMD            0x91B2
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
845bd8deadSopenharmony_ci    GetInteger64v, GetFloatv, GetDoublev:
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ci        MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD           0x91B3
875bd8deadSopenharmony_ci        MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD   0x91B4
885bd8deadSopenharmony_ci        MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD   0x91B5
895bd8deadSopenharmony_ci        NUM_SUPPORTED_MULTISAMPLE_MODES_AMD         0x91B6
905bd8deadSopenharmony_ci        SUPPORTED_MULTISAMPLE_MODES_AMD             0x91B7
915bd8deadSopenharmony_ci
925bd8deadSopenharmony_ciAdditions to Chapter 9 of the OpenGL 4.5 (Core Profile) Specification
935bd8deadSopenharmony_ci(Framebuffers and Framebuffer Objects)
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    In section 9.2.3.1, "Multisample Queries", remove the last paragraph
965bd8deadSopenharmony_ci    beginning with "Otherwise" and add:
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    Otherwise, the value of SAMPLES is equal to the value of
995bd8deadSopenharmony_ci    RENDERBUFFER_SAMPLES or TEXTURE_SAMPLES (depending on the type of
1005bd8deadSopenharmony_ci    attachments) of color attachments if any is present. If there is no
1015bd8deadSopenharmony_ci    color attachment, SAMPLES is equal to the same value from the depth or
1025bd8deadSopenharmony_ci    stencil attachment, whichever is present.
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    An implementation may only support a subset of the possible
1055bd8deadSopenharmony_ci    combinations of sample counts of textures and renderbuffers attached
1065bd8deadSopenharmony_ci    to a framebuffer object. The number of supported combinations is
1075bd8deadSopenharmony_ci    NUM_SUPPORTED_MULTISAMPLE_MODES_AMD. SUPPORTED_MULTISAMPLE_MODES_AMD
1085bd8deadSopenharmony_ci    is an array of NUM_SUPPORTED_MULTISAMPLE_MODES_AMD triples of integers
1095bd8deadSopenharmony_ci    where each triple contains a valid combination of sample counts in
1105bd8deadSopenharmony_ci    the form {color samples, color storage samples, depth and stencil
1115bd8deadSopenharmony_ci    samples}. The first element in each triple is at least 2. The second
1125bd8deadSopenharmony_ci    and third element in each triple are at least 1 and are not greater
1135bd8deadSopenharmony_ci    than the first element.
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    In section 9.2.4, "Renderbuffer Objects", replace the description of
1165bd8deadSopenharmony_ci    (Named)RenderbufferStorageMultisample:
1175bd8deadSopenharmony_ci
1185bd8deadSopenharmony_ci    The data storage, format, dimensions, number of samples, and number of
1195bd8deadSopenharmony_ci    storage samples of a renderbuffer object’s image are established with
1205bd8deadSopenharmony_ci    the commands
1215bd8deadSopenharmony_ci
1225bd8deadSopenharmony_ci      void RenderbufferStorageMultisampleAdvancedAMD( enum target,
1235bd8deadSopenharmony_ci          sizei samples, sizei storageSamples, enum internalformat,
1245bd8deadSopenharmony_ci          sizei width, sizei height );
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci      void NamedRenderbufferStorageMultisampleAdvancedAMD(
1275bd8deadSopenharmony_ci          uint renderbuffer, sizei samples, sizei storageSamples,
1285bd8deadSopenharmony_ci          enum internalformat, sizei width, sizei height );
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    For RenderbufferStorageMultisampleAdvancedAMD, the renderbuffer object
1315bd8deadSopenharmony_ci    is that bound to <target>, which must be RENDERBUFFER.
1325bd8deadSopenharmony_ci    For NamedRenderbufferStorageMultisampleAdvancedAMD, <renderbuffer> is
1335bd8deadSopenharmony_ci    the name of the renderbuffer object.
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    <internalformat> must be color-renderable, depth-renderable, or
1365bd8deadSopenharmony_ci    stencil-renderable (as defined in section 9.4). <width> and <height>
1375bd8deadSopenharmony_ci    are the dimensions in pixels of the renderbuffer.
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    Upon success, *RenderbufferStorageMultisampleAdvancedAMD deletes any
1405bd8deadSopenharmony_ci    existing data store for the renderbuffer image, and the contents of
1415bd8deadSopenharmony_ci    the data store are undefined. RENDERBUFFER_WIDTH is set to <width>,
1425bd8deadSopenharmony_ci    RENDERBUFFER_HEIGHT is set to <height>, and RENDERBUFFER_INTERNAL_-
1435bd8deadSopenharmony_ci    FORMAT is set to <internalformat>.
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    If <samples> is zero, then <storageSamples> must be zero, and
1465bd8deadSopenharmony_ci    RENDERBUFFER_SAMPLES and RENDERBUFFER_STORAGE_SAMPLES_AMD are set to
1475bd8deadSopenharmony_ci    zero. Otherwise <samples> represents a request for a desired minimum
1485bd8deadSopenharmony_ci    number of samples and <storageSamples> represents a request for
1495bd8deadSopenharmony_ci    a desired minimum number of storage samples, where <storageSamples>
1505bd8deadSopenharmony_ci    must not be greater than <samples>. Since different implementations
1515bd8deadSopenharmony_ci    may support different sample counts for multisampled rendering,
1525bd8deadSopenharmony_ci    the actual number of samples and the actual number of storage samples
1535bd8deadSopenharmony_ci    allocated for the renderbuffer image are implementation-dependent.
1545bd8deadSopenharmony_ci    However, the resulting value for RENDERBUFFER_SAMPLES is guaranteed
1555bd8deadSopenharmony_ci    to be greater than or equal to <samples> and no more than the next
1565bd8deadSopenharmony_ci    larger sample count supported by the implementation, and the resulting
1575bd8deadSopenharmony_ci    value for RENDERBUFFER_STORAGE_SAMPLES_AMD is guaranteed to be greater
1585bd8deadSopenharmony_ci    than or equal to <storageSamples>, no more than the next larger
1595bd8deadSopenharmony_ci    storage sample count supported by the implementation, and no more than
1605bd8deadSopenharmony_ci    RENDERBUFFER_SAMPLES.
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci    A GL implementation may vary its allocation of internal component
1635bd8deadSopenharmony_ci    resolution based on any *RenderbufferStorageMultisampleAdvancedAMD
1645bd8deadSopenharmony_ci    parameter (except <target> and <renderbuffer>), but the allocation and
1655bd8deadSopenharmony_ci    chosen internal format must not be a function of any other state and
1665bd8deadSopenharmony_ci    cannot be changed once they are established.
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    Remove the first 4 errors and add these errors:
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by RenderbufferStorageMultisample-
1715bd8deadSopenharmony_ci    AdvancedAMD if <target> is not RENDERBUFFER.
1725bd8deadSopenharmony_ci
1735bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by NamedRenderbufferStorage-
1745bd8deadSopenharmony_ci    MultisampleAdvancedAMD if <renderbuffer> is not the name of
1755bd8deadSopenharmony_ci    an existing renderbuffer object.
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if <samples>, <storageSamples>,
1785bd8deadSopenharmony_ci    <width>, or <height> is negative.
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a color
1815bd8deadSopenharmony_ci    format and <samples> is greater than the implementation-dependent
1825bd8deadSopenharmony_ci    limit MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD.
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a color
1855bd8deadSopenharmony_ci    format and <storageSamples> is greater than the implementation-
1865bd8deadSopenharmony_ci    dependent limit MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <storageSamples> is greater
1895bd8deadSopenharmony_ci    than <samples>.
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a depth
1925bd8deadSopenharmony_ci    or stencil format and <samples> is greater than the maximum number of
1935bd8deadSopenharmony_ci    samples supported for <internalformat> (see GetInternalformativ
1945bd8deadSopenharmony_ci    in section 22.3).
1955bd8deadSopenharmony_ci
1965bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a depth
1975bd8deadSopenharmony_ci    or stencil format and <storageSamples> is not equal to <samples>.
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ci    Finish the section as follows:
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    The commands
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci        void RenderbufferStorageMultisample( enum target,
2045bd8deadSopenharmony_ci            sizei samples, enum internalformat, sizei width,
2055bd8deadSopenharmony_ci            sizei height );
2065bd8deadSopenharmony_ci        void RenderbufferStorage( enum target, enum internalformat,
2075bd8deadSopenharmony_ci            sizei width, sizei height );
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    are equivalent to
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ci        RenderbufferStorageMultisampleAdvancedAMD(target, samples,
2125bd8deadSopenharmony_ci            samples, internalformat, width, height);
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    and
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci        RenderbufferStorageMultisampleAdvancedAMD(target, 0, 0,
2175bd8deadSopenharmony_ci            internalformat, width, height);
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    respectively.
2205bd8deadSopenharmony_ci
2215bd8deadSopenharmony_ci    The commands
2225bd8deadSopenharmony_ci
2235bd8deadSopenharmony_ci        void NamedRenderbufferStorageMultisample( uint renderbuffer,
2245bd8deadSopenharmony_ci            sizei samples, enum internalformat, sizei width,
2255bd8deadSopenharmony_ci            sizei height );
2265bd8deadSopenharmony_ci        void NamedRenderbufferStorage( uint renderbuffer,
2275bd8deadSopenharmony_ci            enum internalformat, sizei width, sizei height );
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ci    are equivalent to
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci        NamedRenderbufferStorageMultisampleAdvancedAMD(renderbuffer,
2325bd8deadSopenharmony_ci            samples, samples, internalformat, width, height);
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci    and
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci        NamedRenderbufferStorageMultisampleAdvancedAMD(renderbuffer,
2375bd8deadSopenharmony_ci            0, 0, internalformat, width, height);
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    respectively.
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    In section 9.2.5, "Required Renderbuffer Formats", replace the last
2425bd8deadSopenharmony_ci    paragraph with:
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    Implementations must support creation of renderbuffers in these
2455bd8deadSopenharmony_ci    required formats with sample counts up to and including:
2465bd8deadSopenharmony_ci    * MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD as color renderbuffer samples
2475bd8deadSopenharmony_ci    * MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD as color renderbuffer
2485bd8deadSopenharmony_ci      storage samples
2495bd8deadSopenharmony_ci    * MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD as depth and stencil
2505bd8deadSopenharmony_ci      samples
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci    with the exception that the signed and unsigned integer formats are
2535bd8deadSopenharmony_ci    required only to support creation of renderbuffers with up to
2545bd8deadSopenharmony_ci    the value of MAX_INTEGER_SAMPLES samples and storage samples, which
2555bd8deadSopenharmony_ci    must be at least one.
2565bd8deadSopenharmony_ci
2575bd8deadSopenharmony_ci    In section 9.2.6, "Renderbuffer Object Queries", replace the paragraph
2585bd8deadSopenharmony_ci    mentioning RENDERBUFFER_SAMPLES with:
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci    If <pname> is RENDERBUFFER_WIDTH, RENDERBUFFER_HEIGHT,
2615bd8deadSopenharmony_ci    RENDERBUFFER_INTERNAL_FORMAT, RENDERBUFFER_SAMPLES, or
2625bd8deadSopenharmony_ci    RENDERBUFFER_STORAGE_SAMPLES_AMD then <params> will contain the width
2635bd8deadSopenharmony_ci    in pixels, height in pixels, internal format, number of samples, or
2645bd8deadSopenharmony_ci    number of storage samples, respectively, of the image of
2655bd8deadSopenharmony_ci    the renderbuffer object.
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci    In section 9.4.1, "Framebuffer Attachment Completeness", remove
2685bd8deadSopenharmony_ci    the bullet beginning with "If <image> has multisample samples" and
2695bd8deadSopenharmony_ci    replace the last 3 bullets about <attachment> with:
2705bd8deadSopenharmony_ci
2715bd8deadSopenharmony_ci    If <attachment> is COLOR_ATTACHMENTi, then <image> must have a color-
2725bd8deadSopenharmony_ci    renderable internal format, the sample count must be less than or
2735bd8deadSopenharmony_ci    equal to the value of the implementation-dependent limit
2745bd8deadSopenharmony_ci    MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD, and the storage sample count must
2755bd8deadSopenharmony_ci    be less than or equal to the value of the implementation-dependent
2765bd8deadSopenharmony_ci    limit MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD.
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    If <attachment> is DEPTH_ATTACHMENT, then <image> must have a depth-
2795bd8deadSopenharmony_ci    renderable internal format, and its sample count must be less than or
2805bd8deadSopenharmony_ci    equal to the value of the implementation-dependent limit
2815bd8deadSopenharmony_ci    MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD.
2825bd8deadSopenharmony_ci
2835bd8deadSopenharmony_ci    If <attachment> is STENCIL_ATTACHMENT, then <image> must have
2845bd8deadSopenharmony_ci    a stencil-renderable internal format, and its sample count must be
2855bd8deadSopenharmony_ci    less than or equal to the value of the implementation-dependent limit
2865bd8deadSopenharmony_ci    MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD.
2875bd8deadSopenharmony_ci
2885bd8deadSopenharmony_ci    In section 9.4.2, replace the bullet mentioning RENDERBUFFER_SAMPLES
2895bd8deadSopenharmony_ci    with:
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci    * The value of RENDERBUFFER_SAMPLES of a color attachment defines its
2925bd8deadSopenharmony_ci    <number of color samples>; the value of RENDERBUFFER_STORAGE_SAMPLES
2935bd8deadSopenharmony_ci    of a color attachment defines its <number of color storage samples>;
2945bd8deadSopenharmony_ci    the value of RENDERBUFFER_SAMPLES of a depth or stencil attachment
2955bd8deadSopenharmony_ci    defines its <number of depth-stencil samples> for each separately;
2965bd8deadSopenharmony_ci    the value of TEXTURE_SAMPLES of a color attachment defines both its
2975bd8deadSopenharmony_ci    <number of color samples> and its <number of color storage samples>;
2985bd8deadSopenharmony_ci    the value of TEXTURE_SAMPLES of a depth or stencil attachment defines
2995bd8deadSopenharmony_ci    its <number of depth-stencil samples> for each separately. If any of
3005bd8deadSopenharmony_ci    the defined values is 0, it is treated as 1. Any undefined value is
3015bd8deadSopenharmony_ci    treated as equal to any number. For all attachment values that are
3025bd8deadSopenharmony_ci    defined, all values of <number of color samples> must be equal, all
3035bd8deadSopenharmony_ci    values of <number of color storage samples> must be equal, all values
3045bd8deadSopenharmony_ci    of <number of depth-stencil samples> must be equal, and the triple
3055bd8deadSopenharmony_ci    {<number of color samples>, <number of color storage samples>, <number
3065bd8deadSopenharmony_ci    of depth-stencil samples>} must be in SUPPORTED_MULTISAMPLE_MODES_AMD
3075bd8deadSopenharmony_ci    or must be equal to {1, 1, 1}.
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci    { FRAMEBUFFER_INCOMPLETE_MULTISAMPLE }
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ciAdditions to Chapter 17 of the OpenGL 4.5 (Core Profile) Specification
3125bd8deadSopenharmony_ci(Writing Fragments and Samples to the Framebuffer)
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci    In section 17.3.10, "Additional Multisample Fragment Operations", add
3155bd8deadSopenharmony_ci    this paragraph after the "If MULTISAMPLE is enabled" paragraph:
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    If there are fewer color storage samples (see section 9.2.4) than
3185bd8deadSopenharmony_ci    the value of SAMPLES, the number of color storage samples determines
3195bd8deadSopenharmony_ci    the number of unique color values that can be stored per pixel.
3205bd8deadSopenharmony_ci    The implementation must determine which samples within a pixel share
3215bd8deadSopenharmony_ci    the same color value, write that value into 1 color storage sample,
3225bd8deadSopenharmony_ci    and remember a mapping between color samples and color storage
3235bd8deadSopenharmony_ci    samples to be able to map color storage samples back to color samples.
3245bd8deadSopenharmony_ci    The color value equality determination is done in an implementation-
3255bd8deadSopenharmony_ci    specific manner, but the implementation must at least recognize a set
3265bd8deadSopenharmony_ci    of color samples coming from the same primitive as 1 storage sample if
3275bd8deadSopenharmony_ci    sample shading (see section 14.3.1.1) is disabled. If there are not
3285bd8deadSopenharmony_ci    enough color storage samples per pixel to store all incoming color
3295bd8deadSopenharmony_ci    values, the excessive color values are not stored and the color samples
3305bd8deadSopenharmony_ci    with unstored values are marked as having an unknown value. Color
3315bd8deadSopenharmony_ci    samples with an unknown value will not contribute to the final color
3325bd8deadSopenharmony_ci    value of the pixel when all color samples are resolved by
3335bd8deadSopenharmony_ci    BlitFramebuffer (see section 18.3.1).
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci    If there are fewer depth and stencil samples than the value of SAMPLES
3365bd8deadSopenharmony_ci    and implementation-specific optimizations are unable to represent more
3375bd8deadSopenharmony_ci    depth and stencil samples within the given storage, the missing depth
3385bd8deadSopenharmony_ci    and stencil values should be pulled from or derived from the nearest
3395bd8deadSopenharmony_ci    existing depth and stencil samples within the same pixel. The mapping
3405bd8deadSopenharmony_ci    from missing to existing depth and stencil samples is implementation-
3415bd8deadSopenharmony_ci    specific, but the mapping must be at least:
3425bd8deadSopenharmony_ci    * injective if missing samples < existing samples
3435bd8deadSopenharmony_ci    * bijective if missing samples = existing samples
3445bd8deadSopenharmony_ci    * surjective if missing samples > existing samples
3455bd8deadSopenharmony_ci    Depth and stencil tests operate as if the number of depth and stencil
3465bd8deadSopenharmony_ci    samples was equal to the value of SAMPLES.
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ciErrors
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ci    An INVALID_ENUM error is generated by RenderbufferStorageMultisample-
3515bd8deadSopenharmony_ci    AdvancedAMD if <target> is not RENDERBUFFER.
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated by NamedRenderbufferStorage-
3545bd8deadSopenharmony_ci    MultisampleAdvancedAMD if <renderbuffer> is not the name of
3555bd8deadSopenharmony_ci    an existing renderbuffer object.
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci    An INVALID_VALUE error is generated if <samples>, <storageSamples>,
3585bd8deadSopenharmony_ci    <width>, or <height> is negative.
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a color
3615bd8deadSopenharmony_ci    format and <samples> is greater than the implementation-dependent
3625bd8deadSopenharmony_ci    limit MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD.
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a color
3655bd8deadSopenharmony_ci    format and <storageSamples> is greater than the implementation-
3665bd8deadSopenharmony_ci    dependent limit MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD.
3675bd8deadSopenharmony_ci
3685bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <storageSamples> is greater
3695bd8deadSopenharmony_ci    than <samples>.
3705bd8deadSopenharmony_ci
3715bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a depth
3725bd8deadSopenharmony_ci    or stencil format and <samples> is greater than the maximum number of
3735bd8deadSopenharmony_ci    samples supported for <internalformat> (see GetInternalformativ
3745bd8deadSopenharmony_ci    in section 22.3).
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ci    An INVALID_OPERATION error is generated if <internalformat> is a depth
3775bd8deadSopenharmony_ci    or stencil format and <storageSamples> is not equal to <samples>.
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ciNew State
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ci    Add to Table 23.27, "Renderbuffer (state per renderbuffer object)"
3825bd8deadSopenharmony_ci                                                                        Initial
3835bd8deadSopenharmony_ci    Get Value                         Type  Get Command                 Value    Description             Section
3845bd8deadSopenharmony_ci    --------------------------------  ----  --------------------------  -------  ----------------------  -------
3855bd8deadSopenharmony_ci    RENDERBUFFER_STORAGE_SAMPLES_AMD   Z+   GetRenderbufferParameteriv  0        No. of storage samples  9.2.4
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ciNew Implementation Dependent Values
3885bd8deadSopenharmony_ci                                                                       Minimum
3895bd8deadSopenharmony_ci    Get Value                                 Type        Get Command  Value    Description                             Section
3905bd8deadSopenharmony_ci    ----------------------------------------  ----------  -----------  -------  ---------------------------------------  -------
3915bd8deadSopenharmony_ci    MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD             Z+      GetIntegerv  4        Max. no. of color samples supported by   9.2.4
3925bd8deadSopenharmony_ci                                                                                framebuffer objects.
3935bd8deadSopenharmony_ci    MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD     Z+      GetIntegerv  4        Max. no. of color storage samples        9.2.4
3945bd8deadSopenharmony_ci                                                                                supported by framebuffer objects.
3955bd8deadSopenharmony_ci    MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD     Z+      GetIntegerv  4        Max. no. of depth and stencil samples    9.2.4
3965bd8deadSopenharmony_ci                                                                                supported by framebuffer objects.
3975bd8deadSopenharmony_ci    NUM_SUPPORTED_MULTISAMPLE_MODES_AMD           Z+      GetIntegerv  1        No. of supported combinations of color   9.2.4
3985bd8deadSopenharmony_ci                                                                                samples, color storage samples, and
3995bd8deadSopenharmony_ci                                                                                depth-stencil samples by framebuffer
4005bd8deadSopenharmony_ci                                                                                objects.
4015bd8deadSopenharmony_ci    SUPPORTED_MULTISAMPLE_MODES_AMD           n * 3 x Z+  GetIntegerv  -        NUM_SUPPORTED_MULTISAMPLE_MODES_AMD (n)  9.2.4
4025bd8deadSopenharmony_ci                                                                                triples of integers. Each triple is
4035bd8deadSopenharmony_ci                                                                                a unique combination of color samples,
4045bd8deadSopenharmony_ci                                                                                color storage samples, and depth-stencil
4055bd8deadSopenharmony_ci                                                                                samples supported by framebuffer objects.
4065bd8deadSopenharmony_ci
4075bd8deadSopenharmony_ciAMD Implementation Details
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    The following multisample modes are supported by AMD's open source
4105bd8deadSopenharmony_ci    OpenGL driver:
4115bd8deadSopenharmony_ci
4125bd8deadSopenharmony_ci                 Color    Depth &
4135bd8deadSopenharmony_ci        Color    storage  stencil
4145bd8deadSopenharmony_ci        samples  samples  samples
4155bd8deadSopenharmony_ci        =======  =======  =======
4165bd8deadSopenharmony_ci        16       8        8
4175bd8deadSopenharmony_ci        16       4        8
4185bd8deadSopenharmony_ci        16       2        8
4195bd8deadSopenharmony_ci        16       4        4
4205bd8deadSopenharmony_ci        16       2        4
4215bd8deadSopenharmony_ci        16       2        2
4225bd8deadSopenharmony_ci        -------  -------  -------
4235bd8deadSopenharmony_ci        8        8        8
4245bd8deadSopenharmony_ci        8        4        8
4255bd8deadSopenharmony_ci        8        2        8
4265bd8deadSopenharmony_ci        8        4        4
4275bd8deadSopenharmony_ci        8        2        4
4285bd8deadSopenharmony_ci        8        2        2
4295bd8deadSopenharmony_ci        -------  -------  -------
4305bd8deadSopenharmony_ci        4        4        4
4315bd8deadSopenharmony_ci        4        2        4
4325bd8deadSopenharmony_ci        4        2        2
4335bd8deadSopenharmony_ci        -------  -------  -------
4345bd8deadSopenharmony_ci        2        2        2
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ciIssues
4375bd8deadSopenharmony_ci
4385bd8deadSopenharmony_ci    None.
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ciRevision History
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
4435bd8deadSopenharmony_ci    ----  --------  --------  --------------------------------------------
4445bd8deadSopenharmony_ci     1    06/28/18  mareko    Initial version
445