15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    EXT_raster_multisample
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_EXT_raster_multisample
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Jeff Bolz, NVIDIA Corporation (jbolz 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Pat Brown, NVIDIA
165bd8deadSopenharmony_ci    Mathias Heyer, NVIDIA
175bd8deadSopenharmony_ci
185bd8deadSopenharmony_ciStatus
195bd8deadSopenharmony_ci
205bd8deadSopenharmony_ci    Shipping
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciVersion
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Last Modified Date:         March 27, 2015
255bd8deadSopenharmony_ci    Revision:                   2
265bd8deadSopenharmony_ci
275bd8deadSopenharmony_ciNumber
285bd8deadSopenharmony_ci
295bd8deadSopenharmony_ci    OpenGL Extension #462
305bd8deadSopenharmony_ci    OpenGL ES Extension #226
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ciDependencies
335bd8deadSopenharmony_ci
345bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.3 (Compatibility Profile)
355bd8deadSopenharmony_ci    specification.
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    This extension requires OpenGL ES 3.0.3 (December 18, 2013) in an
385bd8deadSopenharmony_ci    OpenGL ES implementation.
395bd8deadSopenharmony_ci
405bd8deadSopenharmony_ci    This extension interacts with NV_fragment_coverage_to_color.
415bd8deadSopenharmony_ci
425bd8deadSopenharmony_ci    This extension interacts with EXT_depth_bounds_test.
435bd8deadSopenharmony_ci
445bd8deadSopenharmony_ci    This extension interacts with OES_sample_shading.
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    This extension interacts with OES_sample_variables.
475bd8deadSopenharmony_ci
485bd8deadSopenharmony_ciOverview
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ci    This extension allows rendering to a non-multisample color buffer while
515bd8deadSopenharmony_ci    rasterizing with more than one sample. The result of rasterization
525bd8deadSopenharmony_ci    (coverage) is available in the gl_SampleMaskIn[] fragment shader input,
535bd8deadSopenharmony_ci    multisample rasterization is enabled for all primitives, and several per-
545bd8deadSopenharmony_ci    fragment operations operate at the raster sample rate.
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    When using the functionality provided by this extension, depth, stencil,
575bd8deadSopenharmony_ci    and depth bounds tests must be disabled, and a multisample draw
585bd8deadSopenharmony_ci    framebuffer must not be used.
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci    A fragment's "coverage", or "effective raster samples" is considered to
615bd8deadSopenharmony_ci    have "N bits" (as opposed to "one bit" corresponding to the single color
625bd8deadSopenharmony_ci    sample) through the fragment shader, in the sample mask output, through
635bd8deadSopenharmony_ci    the multisample fragment operations and occlusion query, until the coverage
645bd8deadSopenharmony_ci    is finally "reduced" to a single bit in a new "Coverage Reduction" stage
655bd8deadSopenharmony_ci    that occurs before blending.
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ciNew Procedures and Functions
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci    void RasterSamplesEXT(uint samples, boolean fixedsamplelocations);
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciNew Tokens
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Enable, Disable, IsEnabled:
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci        RASTER_MULTISAMPLE_EXT                          0x9327
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetDoublev,
785bd8deadSopenharmony_ci    GetIntegerv, and GetFloatv:
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci        RASTER_SAMPLES_EXT                              0x9328
815bd8deadSopenharmony_ci        MAX_RASTER_SAMPLES_EXT                          0x9329
825bd8deadSopenharmony_ci        RASTER_FIXED_SAMPLE_LOCATIONS_EXT               0x932A
835bd8deadSopenharmony_ci        MULTISAMPLE_RASTERIZATION_ALLOWED_EXT           0x932B
845bd8deadSopenharmony_ci        EFFECTIVE_RASTER_SAMPLES_EXT                    0x932C
855bd8deadSopenharmony_ci
865bd8deadSopenharmony_ciAdditions to Chapter 14 of the OpenGL 4.3 (Compatibility Profile) Specification
875bd8deadSopenharmony_ci(Rasterization)
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    Modify Section 14.3.1 (Multisampling), p. 477
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    (replace the introductory language at the beginning of the section to
925bd8deadSopenharmony_ci     account for the new ability to use multisample rasterization without
935bd8deadSopenharmony_ci     having multisample storage)
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    Multisampling is a mechanism to antialias all GL primitives: points,
965bd8deadSopenharmony_ci    lines, polygons, bitmaps, and images. The technique is to sample all
975bd8deadSopenharmony_ci    primitives multiple times at each pixel. The color sample values are
985bd8deadSopenharmony_ci    resolved to a single, displayable color. For window system-provided
995bd8deadSopenharmony_ci    framebuffers, this occurs each time a pixel is updated, so the
1005bd8deadSopenharmony_ci    antialiasing appears to be automatic at the application level. For
1015bd8deadSopenharmony_ci    application-created framebuffers, this must be requested by calling
1025bd8deadSopenharmony_ci    the BlitFramebuffer command (see section 18.3.1). Because each sample
1035bd8deadSopenharmony_ci    includes color, depth, and stencil information, the color (including
1045bd8deadSopenharmony_ci    texture operation), depth, and stencil functions perform
1055bd8deadSopenharmony_ci    equivalently to the single-sample mode.
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    When the framebuffer includes a multisample buffer, separate color, depth,
1085bd8deadSopenharmony_ci    and stencil values are stored in this buffer for each sample location.
1095bd8deadSopenharmony_ci    Samples contain separate color values for each fragment color.
1105bd8deadSopenharmony_ci    Framebuffers including a multisample buffer do not include non-multisample
1115bd8deadSopenharmony_ci    depth or stencil buffers, even if the multisample buffer does not store
1125bd8deadSopenharmony_ci    depth or stencil values.  Color buffers do coexist with the multisample
1135bd8deadSopenharmony_ci    buffer, however.
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    The color sample values are resolved to a single, displayable color each
1165bd8deadSopenharmony_ci    time a pixel is updated, so the antialiasing appears to be automatic at
1175bd8deadSopenharmony_ci    the application level. Because each sample includes color, depth, and
1185bd8deadSopenharmony_ci    stencil information, the color (including texture operation), depth, and
1195bd8deadSopenharmony_ci    stencil functions perform equivalently to the single-sample mode.
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    Multisample antialiasing is most valuable for rendering polygons, because
1225bd8deadSopenharmony_ci    it requires no sorting for hidden surface elimination, and it correctly
1235bd8deadSopenharmony_ci    handles adjacent polygons, object silhouettes, and even intersecting
1245bd8deadSopenharmony_ci    polygons. If only points or lines are being rendered, the "smooth"
1255bd8deadSopenharmony_ci    antialiasing mechanism provided by the base GL may result in a higher
1265bd8deadSopenharmony_ci    quality image. This mechanism is designed to allow multisample and smooth
1275bd8deadSopenharmony_ci    antialiasing techniques to be alternated during the rendering of a single
1285bd8deadSopenharmony_ci    scene.
1295bd8deadSopenharmony_ci
1305bd8deadSopenharmony_ci    If the value of MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is TRUE, the
1315bd8deadSopenharmony_ci    rasterization of all primitives is changed, and is referred to as
1325bd8deadSopenharmony_ci    multisample rasterization. Otherwise, primitive rasterization is
1335bd8deadSopenharmony_ci    referred to as single-sample rasterization. The value of MULTISAMPLE-
1345bd8deadSopenharmony_ci    _RASTERIZATION_ALLOWED_EXT is queried by calling GetIntegerv
1355bd8deadSopenharmony_ci    with pname set to MULTISAMPLE_RASTERIZATION_ALLOWED_EXT.
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    During multisample rendering the contents of a pixel fragment are changed
1385bd8deadSopenharmony_ci    in two ways. First, each fragment includes a coverage value with
1395bd8deadSopenharmony_ci    EFFECTIVE_RASTER_SAMPLES_EXT bits.  The value of EFFECTIVE_RASTER_-
1405bd8deadSopenharmony_ci    SAMPLES_EXT is an implementation-dependent constant, and
1415bd8deadSopenharmony_ci    is queried by calling GetIntegerv with pname set to EFFECTIVE_RASTER-
1425bd8deadSopenharmony_ci    _SAMPLES_EXT.
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci
1455bd8deadSopenharmony_ci    ---
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ci    Multisample rasterization may also be enabled without introducing
1485bd8deadSopenharmony_ci    additional storage for the multisample buffer, by calling Enable with a
1495bd8deadSopenharmony_ci    <target> of RASTER_MULTISAMPLE_EXT.  The command:
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci        void RasterSamplesEXT(uint samples, boolean fixedsamplelocations);
1525bd8deadSopenharmony_ci
1535bd8deadSopenharmony_ci    selects the number of samples to be used for rasterization. <samples>
1545bd8deadSopenharmony_ci    represents a request for a desired minimum number of samples. Since
1555bd8deadSopenharmony_ci    different implementations may support different sample counts, the actual
1565bd8deadSopenharmony_ci    sample pattern used is implementation-dependent. However, the resulting
1575bd8deadSopenharmony_ci    value for RASTER_SAMPLES_EXT is guaranteed to be greater than or equal to
1585bd8deadSopenharmony_ci    <samples> and no more than the next larger sample count supported by the
1595bd8deadSopenharmony_ci    implementation. If <fixedsamplelocations> is TRUE, identical sample
1605bd8deadSopenharmony_ci    locations will be used for all pixels. The sample locations chosen are a
1615bd8deadSopenharmony_ci    function of only the parameters to RasterSamplesEXT and not of any other
1625bd8deadSopenharmony_ci    state.
1635bd8deadSopenharmony_ci
1645bd8deadSopenharmony_ci    If RASTER_MULTISAMPLE_EXT is enabled, then the sample pattern chosen by
1655bd8deadSopenharmony_ci    RasterSamplesEXT will be used instead of sampling at the center of the
1665bd8deadSopenharmony_ci    pixel. The sample locations can be queried with GetMultisamplefv with a
1675bd8deadSopenharmony_ci    <pname> of SAMPLE_POSITION, similar to normal multisample sample locations.
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    The value MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is TRUE if SAMPLE_BUFFERS
1705bd8deadSopenharmony_ci    is one or if RASTER_MULTISAMPLE_EXT is enabled.  The value
1715bd8deadSopenharmony_ci    EFFECTIVE_RASTER_SAMPLES_EXT is equal to RASTER_SAMPLES_EXT if
1725bd8deadSopenharmony_ci    RASTER_MULTISAMPLE_EXT is enabled, otherwise is equal to SAMPLES.
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    Explicit multisample rasterization can not be used in conjunction with
1755bd8deadSopenharmony_ci    depth, stencil, or depth bounds tests, multisample framebuffers, or if
1765bd8deadSopenharmony_ci    RASTER_SAMPLES_EXT is zero.  If RASTER_MULTISAMPLE_EXT is enabled, the
1775bd8deadSopenharmony_ci    error INVALID_OPERATION will be generated by Draw commands if
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ci      - the value of RASTER_SAMPLES_EXT is zero
1805bd8deadSopenharmony_ci      - the depth, stencil, or depth bounds test is enabled
1815bd8deadSopenharmony_ci      - a multisample draw framebuffer is bound (SAMPLE_BUFFERS is one)
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ci    Errors
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    - An INVALID_VALUE error is generated if <samples> is greater than the
1865bd8deadSopenharmony_ci    value of MAX_RASTER_SAMPLES_EXT (the implementation-dependent maximum
1875bd8deadSopenharmony_ci    number of samples).
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ci
1905bd8deadSopenharmony_ci    Add to the end of Section 14.3.1.1 (Sample Shading), p. 479
1915bd8deadSopenharmony_ci
1925bd8deadSopenharmony_ci    If RASTER_MULTISAMPLE_EXT is enabled, the number of unique samples to
1935bd8deadSopenharmony_ci    process is implementation-dependent and need not be more than one.
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    Modify Section 14.4.3 (Point Multisample Rasterization)
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    If MULTISAMPLE is enabled and MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is
1985bd8deadSopenharmony_ci    TRUE, then points are rasterized using the following algorithm, regardless
1995bd8deadSopenharmony_ci    of whether point antialiasing (POINT_SMOOTH) is enabled or disabled.
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    Modify Section 14.5.4 (Line Multisample Rasterization)
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ci    If MULTISAMPLE is enabled and MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is
2045bd8deadSopenharmony_ci    TRUE, then lines are rasterized using the following algorithm, regardless
2055bd8deadSopenharmony_ci    of whether line antialiasing (LINE_SMOOTH) is enabled or disabled.
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci    Modify Section 14.6.6 (Polygon Multisample Rasterization)
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    If MULTISAMPLE is enabled and MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is
2105bd8deadSopenharmony_ci    TRUE, then polygons are rasterized using the following algorithm,
2115bd8deadSopenharmony_ci    regardless of whether polygon antialiasing (POLYGON_SMOOTH) is enabled or
2125bd8deadSopenharmony_ci    disabled.
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    Modify Section 14.8.0.1 (Bitmap Multisample Rasterization)
2155bd8deadSopenharmony_ci
2165bd8deadSopenharmony_ci    If MULTISAMPLE is enabled and MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is
2175bd8deadSopenharmony_ci    TRUE, then bitmaps are rasterized using the following algorithm.
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ciAdditions to Chapter 15 of the OpenGL 4.3 (Compatibility Profile) Specification
2205bd8deadSopenharmony_ci(Programmable Fragment Processing)
2215bd8deadSopenharmony_ci
2225bd8deadSopenharmony_ci    Modify Section 15.2.2 (Shader Inputs), p. 512
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    The built-in variable gl_SampleMaskIn is an integer array holding bitfields
2255bd8deadSopenharmony_ci    indicating the set of fragment samples covered by the primitive
2265bd8deadSopenharmony_ci    corresponding to the fragment shader invocation. The number of elements in
2275bd8deadSopenharmony_ci    the array is
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ci        ceil(s/32),
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci    where <s> is the maximum number of color or raster samples supported by the
2325bd8deadSopenharmony_ci    implementation. Bit <n> of element <w> in the array is set if and only if
2335bd8deadSopenharmony_ci    the raster sample numbered 32<w> + <n> is considered covered for this
2345bd8deadSopenharmony_ci    fragment shader invocation.
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    Modify Section 15.2.3 (Shader Outputs), p. 513
2375bd8deadSopenharmony_ci
2385bd8deadSopenharmony_ci    The built-in integer array gl_SampleMask can be used to change the sample
2395bd8deadSopenharmony_ci    coverage for a fragment from within the shader. The number of elements in
2405bd8deadSopenharmony_ci    the array is
2415bd8deadSopenharmony_ci
2425bd8deadSopenharmony_ci        ceil(s/32),
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci    where <s> is the maximum number of color or raster samples supported by the
2455bd8deadSopenharmony_ci    implementation.
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ciAdditions to Chapter 17 of the OpenGL 4.3 (Compatibility Profile) Specification
2485bd8deadSopenharmony_ci(Writing Fragments and Samples to the Framebuffer)
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    Modify Figure 17.1 (Per-fragment operations)
2515bd8deadSopenharmony_ci
2525bd8deadSopenharmony_ci    Add a new stage called "Coverage Reduction" between "Occlusion Query" and
2535bd8deadSopenharmony_ci    "Blending".
2545bd8deadSopenharmony_ci
2555bd8deadSopenharmony_ci    (note: If NV_fragment_coverage_to_color is supported, the "Coverage
2565bd8deadSopenharmony_ci    Reduction" stage is after the "Fragment coverage to color" stage.)
2575bd8deadSopenharmony_ci
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci    Modify Section 17.3.3 (Multisample Fragment Operations)
2605bd8deadSopenharmony_ci
2615bd8deadSopenharmony_ci    First paragraph:
2625bd8deadSopenharmony_ci    ...No changes to the fragment alpha or coverage values are made at this
2635bd8deadSopenharmony_ci    step if MULTISAMPLE is disabled or MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is
2645bd8deadSopenharmony_ci    FALSE.
2655bd8deadSopenharmony_ci
2665bd8deadSopenharmony_ci    ...
2675bd8deadSopenharmony_ci
2685bd8deadSopenharmony_ci    If SAMPLE_ALPHA_TO_COVERAGE is enabled, a temporary coverage value is
2695bd8deadSopenharmony_ci    generated where each bit is determined by the alpha value at the
2705bd8deadSopenharmony_ci    corresponding sample location. The coverage value has
2715bd8deadSopenharmony_ci    EFFECTIVE_RASTER_SAMPLES_EXT bits.
2725bd8deadSopenharmony_ci
2735bd8deadSopenharmony_ci
2745bd8deadSopenharmony_ci    Modify Section 17.3.7 (Occlusion Queries), p.538
2755bd8deadSopenharmony_ci
2765bd8deadSopenharmony_ci    When an occlusion query is started with target SAMPLES_PASSED, the samples-
2775bd8deadSopenharmony_ci    passed count maintained by the GL is set to zero. When an occlusion query
2785bd8deadSopenharmony_ci    is active, the samples-passed count is incremented for each fragment that
2795bd8deadSopenharmony_ci    passes the depth test. If MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is FALSE,
2805bd8deadSopenharmony_ci    then the samples-passed count is incremented by 1 for each fragment. If
2815bd8deadSopenharmony_ci    MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is TRUE, then the samples-passed
2825bd8deadSopenharmony_ci    count is incremented by the number of samples whose coverage bit is set.
2835bd8deadSopenharmony_ci    However, implementations, at their discretion, may instead increase the
2845bd8deadSopenharmony_ci    samples-passed count by the value of EFFECTIVE_RASTER_SAMPLES_EXT if any
2855bd8deadSopenharmony_ci    sample in the fragment is covered.  Additionally, if
2865bd8deadSopenharmony_ci    RASTER_MULTISAMPLE_EXT is enabled, implementations may instead increase
2875bd8deadSopenharmony_ci    the samples-passed count by one for the entire fragment if any sample 
2885bd8deadSopenharmony_ci    is covered.
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci    Add a new Section 17.3.Y (Coverage Reduction) after 17.3.7.
2925bd8deadSopenharmony_ci
2935bd8deadSopenharmony_ci    If RASTER_MULTISAMPLE_EXT is enabled, a fragment's coverage is reduced
2945bd8deadSopenharmony_ci    from RASTER_SAMPLES_EXT bits to a single bit, where the new "color
2955bd8deadSopenharmony_ci    coverage" is 1 if any bit in the fragment's coverage is on, and 0
2965bd8deadSopenharmony_ci    otherwise. If the color coverage is 0, then blending and writing to the
2975bd8deadSopenharmony_ci    framebuffer are not performed for that sample.
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci
3005bd8deadSopenharmony_ciAdditions to Chapter 18 of the OpenGL 4.3 (Compatibility Profile) Specification
3015bd8deadSopenharmony_ci(Drawing, Reading, and Copying Pixels)
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci    Modify Section 18.1.3 (Pixel Rectangle Multisample Rasterization)
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    If MULTISAMPLE is enabled and MULTISAMPLE_RASTERIZATION_ALLOWED_EXT is TRUE,
3065bd8deadSopenharmony_ci    then pixel rectangles are rasterized using the following algorithm.
3075bd8deadSopenharmony_ci
3085bd8deadSopenharmony_ciNew Implementation Dependent State
3095bd8deadSopenharmony_ci
3105bd8deadSopenharmony_ci                                                      Minimum
3115bd8deadSopenharmony_ci    Get Value                    Type    Get Command  Value   Description                   Sec.
3125bd8deadSopenharmony_ci    ---------                    ------- -----------  ------- ------------------------      ------
3135bd8deadSopenharmony_ci    MAX_RASTER_SAMPLES_EXT       Z+      GetIntegerv  2       Maximum number of raster      14.3.1
3145bd8deadSopenharmony_ci                                                              samples
3155bd8deadSopenharmony_ci
3165bd8deadSopenharmony_ciNew State
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci    Get Value                       Get Command    Type    Initial Value    Description                 Sec.    Attribute
3195bd8deadSopenharmony_ci    ---------                       -----------    ----    -------------    -----------                 ----    ---------
3205bd8deadSopenharmony_ci    RASTER_MULTISAMPLE_EXT          IsEnabled      B       FALSE            Multisample Rasterization   14.3.1  enable/multisample
3215bd8deadSopenharmony_ci                                                                            without multiple color
3225bd8deadSopenharmony_ci                                                                            samples
3235bd8deadSopenharmony_ci    RASTER_SAMPLES_EXT              GetIntegerv    Z+      0                Number of raster samples    14.3.1  multisample
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci    RASTER_FIXED_SAMPLE_-           GetBooleanv    B       FALSE            Require same sample         14.3.1  multisample
3265bd8deadSopenharmony_ci        LOCATIONS_EXT                                                       locations
3275bd8deadSopenharmony_ci    MULTISAMPLE_RASTERIZATION_-     GetBooleanv    B       FALSE            Whether multisample         14.3.1  -
3285bd8deadSopenharmony_ci        ALLOWED_EXT                                                         rasterization can be used
3295bd8deadSopenharmony_ci    EFFECTIVE_RASTER_SAMPLES_EXT    GetIntegerv    Z+      0                How many samples are used   14.3.1  -
3305bd8deadSopenharmony_ci                                                                            for rasterization and
3315bd8deadSopenharmony_ci                                                                            fragment operations
3325bd8deadSopenharmony_ci
3335bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
3345bd8deadSopenharmony_ci
3355bd8deadSopenharmony_ci    None.
3365bd8deadSopenharmony_ci
3375bd8deadSopenharmony_ciGLX Protocol
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ci    None.
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ciModifications to the OpenGL Shading Language Specification, Version 4.30
3425bd8deadSopenharmony_ci
3435bd8deadSopenharmony_ci    Modify Section 7.1 (Built-In Language Variables), p. 118
3445bd8deadSopenharmony_ci
3455bd8deadSopenharmony_ci    For both the input array gl_SampleMaskIn[] and the output array
3465bd8deadSopenharmony_ci    gl_SampleMask[], bit B of mask M (gl_SampleMaskIn[M] or gl_SampleMask[M])
3475bd8deadSopenharmony_ci    corresponds to sample 32*M+B. These arrays have ceil(s/32) elements, where
3485bd8deadSopenharmony_ci    s is the maximum number of color or raster samples supported by the
3495bd8deadSopenharmony_ci    implementation.
3505bd8deadSopenharmony_ci
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ciInteractions with OpenGL ES 3.0
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci    For OpenGL ES, remove references to images, bitmaps and GetDoublev.
3555bd8deadSopenharmony_ci    Disregard references to POINT_SMOOTH, LINE_SMOOTH and POLYGON_SMOOTH.
3565bd8deadSopenharmony_ci
3575bd8deadSopenharmony_ci    Omit changes to Section 14.8.0.1 (Bitmap Multisample Rasterization).
3585bd8deadSopenharmony_ci    Also, omit changes to Section 18.1.3 (Pixel Rectangle Multisample Rasterization).
3595bd8deadSopenharmony_ci
3605bd8deadSopenharmony_ci    Since OpenGL ES does not support enabling/disabling MULTISAMPLE rasterization
3615bd8deadSopenharmony_ci    via MULTISAMPLE, read all occurrences of MULTISAMPLE as if it was enabled.
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci
3645bd8deadSopenharmony_ciDependencies on OES_sample_shading
3655bd8deadSopenharmony_ci
3665bd8deadSopenharmony_ci    If this extension is implemented on OpenGL ES and OES_sample_shading
3675bd8deadSopenharmony_ci    is not supported, omit changes to Section 3.3.1 (Sample Shading).
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci
3705bd8deadSopenharmony_ciDependencies on OES_sample_variables
3715bd8deadSopenharmony_ci    If this extension is implemented on OpenGL ES and OES_sample_variables
3725bd8deadSopenharmony_ci    is not supported, omit changes to Section 3.9.2 (Shader Inputs;
3735bd8deadSopenharmony_ci    Shader Outputs).
3745bd8deadSopenharmony_ci
3755bd8deadSopenharmony_ci
3765bd8deadSopenharmony_ciDependencies on EXT_depth_bounds_test
3775bd8deadSopenharmony_ci
3785bd8deadSopenharmony_ci    If EXT_depth_bounds_test is not supported, remove the error check for the
3795bd8deadSopenharmony_ci    depth bounds test enable.
3805bd8deadSopenharmony_ci
3815bd8deadSopenharmony_ciErrors
3825bd8deadSopenharmony_ci
3835bd8deadSopenharmony_ci    INVALID_OPERATION is generated by Draw commands if RASTER_MULTISAMPLE_EXT
3845bd8deadSopenharmony_ci    is enabled and any of the following is true:
3855bd8deadSopenharmony_ci
3865bd8deadSopenharmony_ci      - the value of RASTER_SAMPLES_EXT is zero
3875bd8deadSopenharmony_ci      - the depth, stencil, or depth bounds test is enabled
3885bd8deadSopenharmony_ci      - a multisample draw framebuffer is bound (SAMPLE_BUFFERS is one)
3895bd8deadSopenharmony_ci
3905bd8deadSopenharmony_ci    INVALID_VALUE is generated by RasterSamplesEXT if <samples> is greater
3915bd8deadSopenharmony_ci    than the value of MAX_RASTER_SAMPLES_EXT.
3925bd8deadSopenharmony_ci
3935bd8deadSopenharmony_ciIssues
3945bd8deadSopenharmony_ci
3955bd8deadSopenharmony_ci    (1) What is the interaction with sample shading?
3965bd8deadSopenharmony_ci
3975bd8deadSopenharmony_ci    RESOLVED: Sample shading requires "max(ceil(mss * samples), 1)" shader
3985bd8deadSopenharmony_ci    invocations. Since <samples> must be one when using this feature, an
3995bd8deadSopenharmony_ci    implementation is still only required to shade once. However, in case this
4005bd8deadSopenharmony_ci    functionality were supported with more than one color sample, we don't
4015bd8deadSopenharmony_ci    require shading at more than one sample.
4025bd8deadSopenharmony_ci
4035bd8deadSopenharmony_ci    (2) Where are attributes sampled?
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci    RESOLVED: They are sampled as if normal multisampling were in effect with
4065bd8deadSopenharmony_ci    the same sample pattern. i.e. attributes can be sampled at the center or
4075bd8deadSopenharmony_ci    at the centroid, depending on what the shader requests.
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    (3) During multisample rasterization, what are the values of the GLSL
4105bd8deadSopenharmony_ci    built-in variables gl_SampleMaskIn[], gl_SampleMask[], gl_SampleID,
4115bd8deadSopenharmony_ci    gl_NumSamples, gl_SamplePosition?
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ci    RESOLVED: There are RASTER_SAMPLES_EXT bits in gl_SampleMaskIn and
4145bd8deadSopenharmony_ci    gl_SampleMask. gl_SampleID and gl_NumSamples continue to reflect the
4155bd8deadSopenharmony_ci    number of samples in the framebuffer.
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci    gl_SamplePosition is intended to reflect the location of the fragment being
4185bd8deadSopenharmony_ci    shaded when MIN_SAMPLE_SHADING is enabled. However, since we don't require
4195bd8deadSopenharmony_ci    MIN_SAMPLE_SHADING to work in conjunction with this extension,
4205bd8deadSopenharmony_ci    gl_SamplePosition may just contain the location of the pixel center.
4215bd8deadSopenharmony_ci
4225bd8deadSopenharmony_ci    (4) How does multisample rasterization operate?
4235bd8deadSopenharmony_ci
4245bd8deadSopenharmony_ci    RESOLVED: Point shape, point anti-aliasing, line smooth, etc. will operate
4255bd8deadSopenharmony_ci    the same when RASTER_MULTISAMPLE is enabled as they do when SAMPLE_BUFFERS
4265bd8deadSopenharmony_ci    is one in the absence of this extension.
4275bd8deadSopenharmony_ci
4285bd8deadSopenharmony_ci    (5) When using both NV_fragment_coverage_to_color and EXT_raster_multisample
4295bd8deadSopenharmony_ci    or NV_framebuffer_mixed_samples, how do these features interact?
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci    RESOLVED: Both may be used simultaneously, and the coverage_to_color
4325bd8deadSopenharmony_ci    functionality is applied before coverage reduction in the pipeline. This
4335bd8deadSopenharmony_ci    means the full raster sample mask will be written to the color buffer, not
4345bd8deadSopenharmony_ci    the reduced color sample mask.
4355bd8deadSopenharmony_ci
4365bd8deadSopenharmony_ci
4375bd8deadSopenharmony_ciRevision History
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ci    Revision 2, 2015/03/27
4405bd8deadSopenharmony_ci      - Add ES interactions
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci    Revision 1, September 12, 2014 (jbolz, pbrown, mheyer)
4435bd8deadSopenharmony_ci
4445bd8deadSopenharmony_ci      Internal spec development.
445