15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_explicit_multisample
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_explicit_multisample
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Eric Werness, NVIDIA Corporation
125bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation
135bd8deadSopenharmony_ci    Jamie Gennis, NVIDIA Corporation
145bd8deadSopenharmony_ci    Nacho Sanz-Pastor, Aechelon
155bd8deadSopenharmony_ci    Mark Kilgard, NVIDIA Corporation
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciContact
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Eric Werness, NVIDIA Corporation (ewerness 'at' nvidia.com)
205bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
215bd8deadSopenharmony_ci
225bd8deadSopenharmony_ciStatus
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ci    Shipping in NVIDIA's Release 180 drivers (October 2008)
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciVersion
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    Last Modified Date:         10/27/08
295bd8deadSopenharmony_ci    Revision:                   1
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciNumber
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    357
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ciDependencies
365bd8deadSopenharmony_ci
375bd8deadSopenharmony_ci    OpenGL 2.0 is required.
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    ARB_multisample is required.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    EXT_framebuffer_multisample affects the definition of this extension.
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    NV_gpu_program4 affects the definition of this extension.
445bd8deadSopenharmony_ci
455bd8deadSopenharmony_ci    EXT_gpu_shader4 affects the definition of this extension.
465bd8deadSopenharmony_ci
475bd8deadSopenharmony_ci    EXT_timer_query affects the definition of this extension.
485bd8deadSopenharmony_ci
495bd8deadSopenharmony_ci    This extension is written against the OpenGL 2.0 specification.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ciOverview
525bd8deadSopenharmony_ci
535bd8deadSopenharmony_ci    In traditional multisample specs, the API only allows access to the samples
545bd8deadSopenharmony_ci    indirectly through methods such as coverage values and downsampled
555bd8deadSopenharmony_ci    readbacks. NV_explicit_multisample adds a set of new capabilities to allow
565bd8deadSopenharmony_ci    more precise control over the use of multisamples. Specifically, it adds:
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ci     * A query in the API to query the location of samples within the pixel
595bd8deadSopenharmony_ci
605bd8deadSopenharmony_ci     * An explicit control for the multisample sample mask to augment the
615bd8deadSopenharmony_ci       control provided by SampleCoverage
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci     * A new texture target to wrap a renderbuffer and allow a restricted class
645bd8deadSopenharmony_ci       of accesses to the samples
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci     * The ability to fetch a specific sample from a multisampled texture from
675bd8deadSopenharmony_ci       within a shader
685bd8deadSopenharmony_ci
695bd8deadSopenharmony_ci     * A program option to enable the new behavior
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ciNew Procedures and Functions
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    void GetBooleanIndexedvEXT(enum value, uint index, boolean *data);
745bd8deadSopenharmony_ci
755bd8deadSopenharmony_ci    void GetIntegerIndexedvEXT(enum value, uint index, int *data);
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ci    void GetMultisamplefvNV(enum pname, uint index, float *val);
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    void SampleMaskIndexedNV(uint index, bitfield mask);
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci    void TexRenderbufferNV(enum target, uint renderbuffer);
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciNew Tokens
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetMultisamplefvNV:
865bd8deadSopenharmony_ci    
875bd8deadSopenharmony_ci        SAMPLE_POSITION_NV                          0x8E50
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, and by
905bd8deadSopenharmony_ci    the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
915bd8deadSopenharmony_ci    GetDoublev:
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci        SAMPLE_MASK_NV                              0x8E51
945bd8deadSopenharmony_ci
955bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanIndexedvEXT and
965bd8deadSopenharmony_ci    GetIntegerIndexedvEXT:
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci        SAMPLE_MASK_VALUE_NV                        0x8E52
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci    Accepted by the <pname> parameter of GetBooleanv, GetDoublev, GetIntegerv,
1015bd8deadSopenharmony_ci    and GetFloatv:
1025bd8deadSopenharmony_ci
1035bd8deadSopenharmony_ci        TEXTURE_BINDING_RENDERBUFFER_NV             0x8E53
1045bd8deadSopenharmony_ci        TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV  0x8E54
1055bd8deadSopenharmony_ci        MAX_SAMPLE_MASK_WORDS_NV                    0x8E59
1065bd8deadSopenharmony_ci
1075bd8deadSopenharmony_ci    Accepted by the <target> parameter of BindTexture, and TexRenderbufferNV:
1085bd8deadSopenharmony_ci
1095bd8deadSopenharmony_ci        TEXTURE_RENDERBUFFER_NV                     0x8E55
1105bd8deadSopenharmony_ci
1115bd8deadSopenharmony_ci    Returned by the <type> parameter of GetActiveUniform:
1125bd8deadSopenharmony_ci
1135bd8deadSopenharmony_ci        SAMPLER_RENDERBUFFER_NV                     0x8E56
1145bd8deadSopenharmony_ci        INT_SAMPLER_RENDERBUFFER_NV                 0x8E57
1155bd8deadSopenharmony_ci        UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV        0x8E58
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 2.0 Specification (OpenGL Operation)
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ci    Modify Section 2.X.2, Program Grammar
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    If a program specifies the NV_explicit_multisample program option, the
1225bd8deadSopenharmony_ci    <texTarget> rule is modified to add the texture target RENDERBUFFER and the
1235bd8deadSopenharmony_ci    <TEXop> rule is modified to add the instruction TXFMS.
1245bd8deadSopenharmony_ci
1255bd8deadSopenharmony_ci    Add to section 2.15.4.1, Shader Only Texturing
1265bd8deadSopenharmony_ci
1275bd8deadSopenharmony_ci    Multisample Texel Fetches
1285bd8deadSopenharmony_ci
1295bd8deadSopenharmony_ci    Multisample texel fetches are very similar to standard texel fetches. Since
1305bd8deadSopenharmony_ci    multisample buffers can't have mipmaps, there is no LOD parameter. Instead,
1315bd8deadSopenharmony_ci    there is an integer parameter which selects the sample number to be fetched
1325bd8deadSopenharmony_ci    from the buffer. The number identifying the sample is the same as the value
1335bd8deadSopenharmony_ci    used to query the sample location using GetMultisamplefvNV.
1345bd8deadSopenharmony_ci
1355bd8deadSopenharmony_ci    Additionally, this fetch may only be performed on a texture renderbuffer
1365bd8deadSopenharmony_ci    sampler. No other sample or fetch commands may be performed on a texture
1375bd8deadSopenharmony_ci    renderbuffer sampler.
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    Add to section 2.X.4.4, Program Texture Access
1405bd8deadSopenharmony_ci
1415bd8deadSopenharmony_ci    Add row to table X.17
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci                                                     coordinates used
1445bd8deadSopenharmony_ci      texTarget          Texture Type               s t r  layer  shadow
1455bd8deadSopenharmony_ci      ----------------   ---------------------      -----  -----  ------
1465bd8deadSopenharmony_ci      RENDERBUFFER       TEXTURE_RENDERBUFFER_NV      <not supported>
1475bd8deadSopenharmony_ci
1485bd8deadSopenharmony_ci
1495bd8deadSopenharmony_ci    Add row to table X.18
1505bd8deadSopenharmony_ci
1515bd8deadSopenharmony_ci                                      coordinates used
1525bd8deadSopenharmony_ci      texTarget          supported      i j k  layer  lod
1535bd8deadSopenharmony_ci      ----------------   ---------      -----  -----  ---
1545bd8deadSopenharmony_ci      RENDERBUFFER          no          - - -    -     -
1555bd8deadSopenharmony_ci
1565bd8deadSopenharmony_ci    Add after the discussion of TexelFetch
1575bd8deadSopenharmony_ci
1585bd8deadSopenharmony_ci    The TXFMS instruction provides the ability to extract a single sample from a
1595bd8deadSopenharmony_ci    specified RENDERBUFFER texture image using the function
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci      result_t_vec TexelFetchMultisample(int_vec coord, int_vec offset);
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    The extracted texel is converted to an (R,G,B,A) vector according to Table
1645bd8deadSopenharmony_ci    3.21.  The result vector is interpreted as floating-point, signed integer,
1655bd8deadSopenharmony_ci    or unsigned integer, according to the data type modifier of the
1665bd8deadSopenharmony_ci    instruction.  If the internal format of the texture is not compatible with
1675bd8deadSopenharmony_ci    the instruction's data type modifier, the extracted texel value is
1685bd8deadSopenharmony_ci    undefined.
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ci    <coord> is a four-component signed integer vector used to identify the
1715bd8deadSopenharmony_ci    single sample accessed. Since a renderbuffer must be 2D with no mipmaps, the
1725bd8deadSopenharmony_ci    x and y components are always used to select the pixel and the fourth
1735bd8deadSopenharmony_ci    component is used to select the sample. All of the restrictions of
1745bd8deadSopenharmony_ci    TexelFetch apply to TexelFetchMultisample, with the additional requirement
1755bd8deadSopenharmony_ci    that it must be called on a RENDERBUFFER texture target. If the sample number
1765bd8deadSopenharmony_ci    is greater than or equal to the value of SAMPLES for the render buffer
1775bd8deadSopenharmony_ci    associated with the renderbuffer texture, the results are undefined. 
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 2.0 Specification (Rasterization)
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci    (Insert into section 3.2.1, Multisampling after the discussion of the query
1825bd8deadSopenharmony_ci    for SAMPLES)
1835bd8deadSopenharmony_ci
1845bd8deadSopenharmony_ci    To query the location of a given sample, the function
1855bd8deadSopenharmony_ci
1865bd8deadSopenharmony_ci        void GetMultisamplefvNV(enum pname, uint index, float *val);
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci    is used with a pname of SAMPLE_POSITION_NV and an index corresponding to the
1895bd8deadSopenharmony_ci    sample for which the location should be returned. The sample location is
1905bd8deadSopenharmony_ci    returned as two floating point values each between 0 and 1 corresponding to
1915bd8deadSopenharmony_ci    the x and y locations respectively in GL pixel space of that sample. The
1925bd8deadSopenharmony_ci    error INVALID_OPERATION is generated if <index> is greater than or equal to
1935bd8deadSopenharmony_ci    the value of SAMPLES.
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ci    (Insert new Section 3.8.4, Renderbuffer Textures.  Renumber subsequent
1965bd8deadSopenharmony_ci    sections.)
1975bd8deadSopenharmony_ci
1985bd8deadSopenharmony_ci    In addition to one-, two-, and three-dimensional and cube map textures
1995bd8deadSopenharmony_ci    described in previous sections, one additional type of texture is supported.
2005bd8deadSopenharmony_ci    A renderbuffer texture is similar to a two-dimensional texture.  However,
2015bd8deadSopenharmony_ci    unlike other texture types, the texel array is not stored as part of the
2025bd8deadSopenharmony_ci    texture.  Instead, a renderbuffer object is attached to a renderbuffer
2035bd8deadSopenharmony_ci    texture and the texel array is taken from the data store of the attached
2045bd8deadSopenharmony_ci    renderbuffer object.  When the contents of a renderbuffer are modified,
2055bd8deadSopenharmony_ci    those changes are reflected in the contents of any renderbuffer texture to
2065bd8deadSopenharmony_ci    which the buffer object is attached.  Also unlike other textures,
2075bd8deadSopenharmony_ci    renderbuffer textures do not have multiple image levels; only a single data
2085bd8deadSopenharmony_ci    store is available.
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    The command
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ci      void TexRenderbufferNV(enum target, uint renderbuffer);
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    attaches the renderbuffer object named <renderbuffer> to the active
2155bd8deadSopenharmony_ci    renderbuffer texture. If <renderbuffer> is zero, any renderbuffer object
2165bd8deadSopenharmony_ci    attached to the buffer texture is detached, and no new renderbuffer object
2175bd8deadSopenharmony_ci    is attached.  If <renderbuffer> is non-zero, but is not the name of an
2185bd8deadSopenharmony_ci    existing renderbuffer object, the error INVALID_OPERATION is generated.
2195bd8deadSopenharmony_ci    <target> must be TEXTURE_RENDERBUFFER_NV.  The name of the renderbuffer
2205bd8deadSopenharmony_ci    object that is bound as the data store of the active renderbuffer texture
2215bd8deadSopenharmony_ci    can be queried by calling GetIntegerv with <value> set to
2225bd8deadSopenharmony_ci    TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV.
2235bd8deadSopenharmony_ci
2245bd8deadSopenharmony_ci    When a renderbuffer texture is accessed in a shader, the access takes one
2255bd8deadSopenharmony_ci    vector of integers describing which pixel to fetch and an integer
2265bd8deadSopenharmony_ci    corresponding to the sample numbers described in section 3.2.1 describing
2275bd8deadSopenharmony_ci    which sample within the pixel to fetch. No standard sampling instructions
2285bd8deadSopenharmony_ci    are allowed to the renderbuffer texture target.
2295bd8deadSopenharmony_ci
2305bd8deadSopenharmony_ci    Modify Section 3.8.10, Texture Completeness (p. 177)
2315bd8deadSopenharmony_ci
2325bd8deadSopenharmony_ci    (insert after second paragraph of section, p.177)
2335bd8deadSopenharmony_ci
2345bd8deadSopenharmony_ci    For renderbuffer textures, a texture is <complete> if a renderbuffer object
2355bd8deadSopenharmony_ci    is attached to it, and each dimension of that renderbuffer is positive.
2365bd8deadSopenharmony_ci
2375bd8deadSopenharmony_ci    Modify Section 3.8.11, Texture State and Proxy State (p. 178)
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ci    (insert into the first paragraph of the section, p. 178) ... a zero
2405bd8deadSopenharmony_ci    compressed size, and zero-sized components).  The renderbuffer texture
2415bd8deadSopenharmony_ci    target contains an integer identifying the renderbuffer object that
2425bd8deadSopenharmony_ci    provides the data store for the texture, initially zero.  Next, there are
2435bd8deadSopenharmony_ci    the two sets of texture properties; ...
2445bd8deadSopenharmony_ci
2455bd8deadSopenharmony_ci    Modify Section 3.8.12, Texture Objects (p. 180)
2465bd8deadSopenharmony_ci
2475bd8deadSopenharmony_ci    (modify first paragraphs of section, p. 180, simply adding references to
2485bd8deadSopenharmony_ci     renderbuffer textures, which are treated as texture objects)
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    In addition to the default textures TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
2515bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP, and TEXTURE_RENDERBUFFER_NV, named one-, two-, and
2525bd8deadSopenharmony_ci    three-dimensional, cube map, and renderbuffer texture objects can be created
2535bd8deadSopenharmony_ci    and operated upon. The name space for texture objects is the unsigned
2545bd8deadSopenharmony_ci    integers, with zero reserved by the GL.
2555bd8deadSopenharmony_ci
2565bd8deadSopenharmony_ci    A texture object is created by binding an unused name to TEXTURE_1D,
2575bd8deadSopenharmony_ci    TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, or TEXTURE_RENDERBUFFER_NV. The
2585bd8deadSopenharmony_ci    binding is effected by calling
2595bd8deadSopenharmony_ci
2605bd8deadSopenharmony_ci      void BindTexture( enum target, uint texture );
2615bd8deadSopenharmony_ci
2625bd8deadSopenharmony_ci    with target set to the desired texture target and texture set to the unused
2635bd8deadSopenharmony_ci    name.  The resulting texture object is a new state vector, comprising all
2645bd8deadSopenharmony_ci    the state values listed in section 3.8.11, set to the same initial
2655bd8deadSopenharmony_ci    values. If the new texture object is bound to TEXTURE_1D, TEXTURE_2D,
2665bd8deadSopenharmony_ci    TEXTURE_3D, TEXTURE_CUBE_MAP, or TEXTURE_RENDERBUFFER_NV, it is and remains
2675bd8deadSopenharmony_ci    a one-, two-, three-dimensional, cube map, or renderbuffer texture
2685bd8deadSopenharmony_ci    respectively until it is deleted.
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci    BindTexture may also be used to bind an existing texture object to either
2715bd8deadSopenharmony_ci    TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, or
2725bd8deadSopenharmony_ci    TEXTURE_RENDERBUFFER_NV. The error INVALID_OPERATION is generated if an
2735bd8deadSopenharmony_ci    attempt is made to bind a texture object of different dimensionality than
2745bd8deadSopenharmony_ci    the specified target. If the bind is successful no change is made to the
2755bd8deadSopenharmony_ci    state of the bound texture object, and any previous binding to target is
2765bd8deadSopenharmony_ci    broken.
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    ...
2795bd8deadSopenharmony_ci
2805bd8deadSopenharmony_ci    In the initial state, TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP,
2815bd8deadSopenharmony_ci    and TEXTURE_RENDERBUFFER_NV have one-, two-, three-dimensional, cube map,
2825bd8deadSopenharmony_ci    and renderbuffer texture state vectors respectively associated with them. In
2835bd8deadSopenharmony_ci    order that access to these initial textures not be lost, they are treated as
2845bd8deadSopenharmony_ci    texture objects all of whose names are 0. The initial one-, two-,
2855bd8deadSopenharmony_ci    three-dimensional, cube map, and renderbuffer texture is therefore operated
2865bd8deadSopenharmony_ci    upon, queried, and applied as TEXTURE_1D, TEXTURE_2D, TEXTURE_3D,
2875bd8deadSopenharmony_ci    TEXTURE_CUBE_MAP, or TEXTURE_RENDERBUFFER_NV respectively while 0 is bound
2885bd8deadSopenharmony_ci    to the corresponding targets.
2895bd8deadSopenharmony_ci
2905bd8deadSopenharmony_ci    Texture objects are deleted by calling
2915bd8deadSopenharmony_ci
2925bd8deadSopenharmony_ci      void DeleteTextures( sizei n, uint *textures );
2935bd8deadSopenharmony_ci
2945bd8deadSopenharmony_ci    textures contains n names of texture objects to be deleted. After a texture
2955bd8deadSopenharmony_ci    object is deleted, it has no contents or dimensionality, and its name is
2965bd8deadSopenharmony_ci    again unused. If a texture that is currently bound to one of the targets
2975bd8deadSopenharmony_ci    TEXTURE_1D, TEXTURE_2D, TEXTURE_3D, TEXTURE_CUBE_MAP, or
2985bd8deadSopenharmony_ci    TEXTURE_RENDERBUFFER_NV is deleted, it is as though BindTexture had been
2995bd8deadSopenharmony_ci    executed with the same target and texture zero. Unused names in textures are
3005bd8deadSopenharmony_ci    silently ignored, as is the value zero.
3015bd8deadSopenharmony_ci
3025bd8deadSopenharmony_ci    (modify second paragraph, p. 182, adding buffer textures, plus cube map
3035bd8deadSopenharmony_ci    textures, which is an oversight in the core specification)
3045bd8deadSopenharmony_ci
3055bd8deadSopenharmony_ci    The texture object name space, including the initial one-, two-, and
3065bd8deadSopenharmony_ci    three-dimensional, cube map, and renderbuffer texture objects, is shared
3075bd8deadSopenharmony_ci    among all texture units. A texture object may be bound to more than one
3085bd8deadSopenharmony_ci    texture unit simultaneously. After a texture object is bound, any GL
3095bd8deadSopenharmony_ci    operations on that target object affect any other texture units to which the
3105bd8deadSopenharmony_ci    same texture object is bound.
3115bd8deadSopenharmony_ci
3125bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 2.0 Specification (Per-Fragment Operations
3135bd8deadSopenharmony_ciand the Frame Buffer)
3145bd8deadSopenharmony_ci
3155bd8deadSopenharmony_ci    Modify Section 4.1.3, Multisample Fragment Operations
3165bd8deadSopenharmony_ci
3175bd8deadSopenharmony_ci    Modify the first paragraph to include SAMPLE_MASK and SAMPLE_MASK_VALUE on
3185bd8deadSopenharmony_ci    the list of values the coverage value is modified based on.
3195bd8deadSopenharmony_ci
3205bd8deadSopenharmony_ci    Modify the discussion of SAMPLE_COVERAGE to start with "Next" instead of
3215bd8deadSopenharmony_ci    "Finally"
3225bd8deadSopenharmony_ci
3235bd8deadSopenharmony_ci    Add after the discussion of SAMPLE_COVERAGE:
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci    Finally, if SAMPLE_MASK is enabled, the fragment coverage is ANDed with the
3265bd8deadSopenharmony_ci    coverage value SAMPLE_MASK_VALUE. The value of SAMPLE_MASK_VALUE is
3275bd8deadSopenharmony_ci    specified using
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci        void SampleMaskIndexedNV(GLuint index, GLbitfield mask);
3305bd8deadSopenharmony_ci    
3315bd8deadSopenharmony_ci    with <mask> set to the desired mask for <maskNumber>. SAMPLE_MASK_VALUE is
3325bd8deadSopenharmony_ci    queried by calling GetIntegerIndexedv with <pname> set to SAMPLE_MASK_VALUE
3335bd8deadSopenharmony_ci    and the index set to <maskNumber>. Bit B of mask M corresponds to sample
3345bd8deadSopenharmony_ci    32*M+B as described in Section 3.2.1. The error INVALID_OPERATION is
3355bd8deadSopenharmony_ci    generated if the mask word indexed is greater than or equal to
3365bd8deadSopenharmony_ci    MAX_SAMPLE_MASK_WORDS.
3375bd8deadSopenharmony_ci
3385bd8deadSopenharmony_ci
3395bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 2.0 Specification (Special Functions)
3405bd8deadSopenharmony_ci
3415bd8deadSopenharmony_ci    On p. 241, add the following to the list of commands not compiled into a
3425bd8deadSopenharmony_ci    display list: GetMultisamplefvNV, TexRenderbufferNV.
3435bd8deadSopenharmony_ci
3445bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 2.0 Specification (State and
3455bd8deadSopenharmony_ciState Requests)
3465bd8deadSopenharmony_ci
3475bd8deadSopenharmony_ci    Modify the second paragraph of section 6.1.1 (Simple Queries)
3485bd8deadSopenharmony_ci    p244 to read as follows:
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ci    ...<data> is a pointer to a scalar or array of the indicated
3515bd8deadSopenharmony_ci    type in which to place the returned data.
3525bd8deadSopenharmony_ci
3535bd8deadSopenharmony_ci        void GetBooleanIndexedvEXT(enum target, uint index, boolean *data);
3545bd8deadSopenharmony_ci        void GetIntegerIndexedvEXT(enum target, uint index, int *data);
3555bd8deadSopenharmony_ci
3565bd8deadSopenharmony_ci    are used to query indexed state.  <target> is the name of 
3575bd8deadSopenharmony_ci    the indexed state and <index> is the index of the particular
3585bd8deadSopenharmony_ci    element being queried.  <data> is a pointer to a scalar or array
3595bd8deadSopenharmony_ci    of the indicated type in which to place the returned data. In addition ...
3605bd8deadSopenharmony_ci
3615bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
3625bd8deadSopenharmony_ci
3635bd8deadSopenharmony_ci    None
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ciGLX Protocol
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci    The following rendering command is sent to the server as part of
3685bd8deadSopenharmony_ci    a glXRender request:
3695bd8deadSopenharmony_ci
3705bd8deadSopenharmony_ci    SampleMaskIndexedNV
3715bd8deadSopenharmony_ci
3725bd8deadSopenharmony_ci        2      12              rendering command length
3735bd8deadSopenharmony_ci        2      XXXX            rendering command opcode
3745bd8deadSopenharmony_ci        4      CARD32          index
3755bd8deadSopenharmony_ci        4      BITFIELD        mask
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    TexRenderbufferNV
3785bd8deadSopenharmony_ci
3795bd8deadSopenharmony_ci        2      12              rendering command length
3805bd8deadSopenharmony_ci        2      XXXX            rendering command opcode
3815bd8deadSopenharmony_ci        4      ENUM            target
3825bd8deadSopenharmony_ci        4      CARD32          renderbuffer
3835bd8deadSopenharmony_ci   
3845bd8deadSopenharmony_ci        
3855bd8deadSopenharmony_ci    The following new non-rendering commands are added:
3865bd8deadSopenharmony_ci
3875bd8deadSopenharmony_ci    GetMultisamplefvNV
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci        1      CARD8           opcode(X assigned)                                    
3905bd8deadSopenharmony_ci        1      XXX             GLX opcode
3915bd8deadSopenharmony_ci        2      4               request length
3925bd8deadSopenharmony_ci        4      GLX_CONTEXT_TAG context tag      
3935bd8deadSopenharmony_ci        4      ENUM            pname
3945bd8deadSopenharmony_ci        4      CARD32          index
3955bd8deadSopenharmony_ci    =>  
3965bd8deadSopenharmony_ci        1      1               reply
3975bd8deadSopenharmony_ci        1                      unused
3985bd8deadSopenharmony_ci        2      CARD16          sequence number
3995bd8deadSopenharmony_ci        4      0               reply length
4005bd8deadSopenharmony_ci        8                      unused
4015bd8deadSopenharmony_ci        4      FLOAT32         val[0]
4025bd8deadSopenharmony_ci        4      FLOAT32         val[1]
4035bd8deadSopenharmony_ci        8                      unused
4045bd8deadSopenharmony_ci  
4055bd8deadSopenharmony_ci  
4065bd8deadSopenharmony_ci       
4075bd8deadSopenharmony_ciDependencies on EXT_framebuffer_multisample
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    If EXT_framebuffer_multisample is not available, all discussion involving
4105bd8deadSopenharmony_ci    textures and renderbuffers is deleted. This only leaves the ability to query
4115bd8deadSopenharmony_ci    the sample parameters of the current framebuffer.
4125bd8deadSopenharmony_ci
4135bd8deadSopenharmony_ciDependencies on EXT_timer_query
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci    If EXT_timer_query is not available, include its discussion of int64EXT and
4165bd8deadSopenharmony_ci    uint64EXT.
4175bd8deadSopenharmony_ci
4185bd8deadSopenharmony_ciDependencies on NV_gpu_program4 and EXT_gpu_shader4
4195bd8deadSopenharmony_ci
4205bd8deadSopenharmony_ci    If NV_gpu_program4 and EXT_gpu_shader4 are not supported, and no other
4215bd8deadSopenharmony_ci    mechanism is provided to perform texture lookups into renderbuffer textures,
4225bd8deadSopenharmony_ci    this extension is pointless, given that it provides no fixed-function
4235bd8deadSopenharmony_ci    mechanism to access renderbuffer textures.
4245bd8deadSopenharmony_ci
4255bd8deadSopenharmony_ci    If EXT_gpu_shader4 is supported, the language below describes the
4265bd8deadSopenharmony_ci    modifications to the shading language to support renderbuffer textures. If
4275bd8deadSopenharmony_ci    not, the language below and in Chapter 2 should be removed.
4285bd8deadSopenharmony_ci
4295bd8deadSopenharmony_ciErrors
4305bd8deadSopenharmony_ci
4315bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by GetBooleanIndexedvEXT and
4325bd8deadSopenharmony_ci    GetIntegerIndexedvEXT if target is SAMPLE_MASK_VALUE_NV and index is greater
4335bd8deadSopenharmony_ci    than or equal to MAX_SAMPLE_MASK_WORDS_NV.
4345bd8deadSopenharmony_ci
4355bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by SampleMaskIndexedNV if index is greater
4365bd8deadSopenharmony_ci    than or equal to MAX_SAMPLE_MASK_WORDS_NV.
4375bd8deadSopenharmony_ci
4385bd8deadSopenharmony_ci
4395bd8deadSopenharmony_ciNew State
4405bd8deadSopenharmony_ci
4415bd8deadSopenharmony_ci    Get Value                       Get Command    Type    Initial Value    Attribute
4425bd8deadSopenharmony_ci    ---------                       -----------    ----    -------------    ---------
4435bd8deadSopenharmony_ci    SAMPLE_MASK_NV                  IsEnabled      B       FALSE            multisample/enable
4445bd8deadSopenharmony_ci    SAMPLE_MASK_VALUE_NV            GetInteger-    nxZ+    ~0               multisample
4455bd8deadSopenharmony_ci                                    IndexedvEXT
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci    Where n is the number of sample mask words (the value of
4485bd8deadSopenharmony_ci    MAX_SAMPLE_MASK_WORDS_NV) the implementation supports.
4495bd8deadSopenharmony_ci
4505bd8deadSopenharmony_ci    (add to table 6.15, Texture State Per Texture Unit/Binding Point p. 276)
4515bd8deadSopenharmony_ci
4525bd8deadSopenharmony_ci                                                            Initial
4535bd8deadSopenharmony_ci    Get Value                           Type    Get Command  Value  Description                 Sec.    Attribute
4545bd8deadSopenharmony_ci    ---------------------------------   ----    ----------- ------- --------------------------- ------  ---------
4555bd8deadSopenharmony_ci    TEXTURE_BINDING_RENDERBUFFER_NV     2*xZ+   GetIntegerv    0    Texture object bound to     3.8.12  texture
4565bd8deadSopenharmony_ci                                                                    TEXTURE_RENDERBUFFER_EXT
4575bd8deadSopenharmony_ci
4585bd8deadSopenharmony_ci    (add to table 6.16, Texture State Per Texture Object, p. 276)
4595bd8deadSopenharmony_ci
4605bd8deadSopenharmony_ci                                                            Initial
4615bd8deadSopenharmony_ci    Get Value                           Type    Get Command  Value  Description                 Sec.    Attribute
4625bd8deadSopenharmony_ci    ---------------------------------   ----    ----------- ------- --------------------------- ------  ---------
4635bd8deadSopenharmony_ci    TEXTURE_RENDERBUFFER_DATA_STORE_    nxZ+    GetIntegerv    0    Renderbuffer object bound   3.8.4   texture
4645bd8deadSopenharmony_ci      BINDING_NV                                                    as the data store for the
4655bd8deadSopenharmony_ci                                                                    active image unit's
4665bd8deadSopenharmony_ci                                                                    renderbuffer texture
4675bd8deadSopenharmony_ci
4685bd8deadSopenharmony_ci    (add to table 9.nnn "Framebuffer dependent Values" introduced by
4695bd8deadSopenharmony_ci    the EXT_framebuffer_object specification)
4705bd8deadSopenharmony_ci
4715bd8deadSopenharmony_ci                                                        Initial
4725bd8deadSopenharmony_ci    Get Value           Type        Get Command         Value           Description      Sec.    Attribute
4735bd8deadSopenharmony_ci    ------------------  ----------  ------------------  --------------  ---------------  ------  ---------
4745bd8deadSopenharmony_ci    SAMPLE_POSITION_NV  N*2*R[0,1]  GetMultisamplefvNV  implementation  Explicit sample  3.2.1   -
4755bd8deadSopenharmony_ci                                                        dependent       positions
4765bd8deadSopenharmony_ci
4775bd8deadSopenharmony_ci    Where N is the number of samples (the value of SAMPLES) the framebuffer supports.
4785bd8deadSopenharmony_ci
4795bd8deadSopenharmony_ciNew Implementation Dependent State
4805bd8deadSopenharmony_ci
4815bd8deadSopenharmony_ci                                                      Minimum
4825bd8deadSopenharmony_ci    Get Value                    Type    Get Command  Value   Description       Sec.    Attribute
4835bd8deadSopenharmony_ci    ---------                    ------- -----------  ------- ----------------  ------  ---------
4845bd8deadSopenharmony_ci    MAX_SAMPLE_MASK_WORDS_NV     Z       GetIntegerv  1       maximum number    x.x.x   -
4855bd8deadSopenharmony_ci                                                              of sample mask
4865bd8deadSopenharmony_ci                                                              words
4875bd8deadSopenharmony_ci
4885bd8deadSopenharmony_ciModifications to the OpenGL Shading Language Specification, Version 1.10.59
4895bd8deadSopenharmony_ci
4905bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the language
4915bd8deadSopenharmony_ci    featured described in this extension:
4925bd8deadSopenharmony_ci
4935bd8deadSopenharmony_ci      #extension GL_NV_explicit_multisample : <behavior>
4945bd8deadSopenharmony_ci
4955bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.3.
4965bd8deadSopenharmony_ci
4975bd8deadSopenharmony_ci    A new preprocessor #define is added to the OpenGL Shading Language:
4985bd8deadSopenharmony_ci
4995bd8deadSopenharmony_ci      #define GL_NV_explicit_multisample 1
5005bd8deadSopenharmony_ci
5015bd8deadSopenharmony_ci    Add to section 3.6 "Keywords"
5025bd8deadSopenharmony_ci
5035bd8deadSopenharmony_ci    The following new sampler types are added:
5045bd8deadSopenharmony_ci
5055bd8deadSopenharmony_ci      samplerRenderbuffer, isamplerRenderbuffer, usamplerRenderbuffer
5065bd8deadSopenharmony_ci
5075bd8deadSopenharmony_ci    Add to section 4.1 "Basic Types"
5085bd8deadSopenharmony_ci
5095bd8deadSopenharmony_ci    Add the following sampler type to the "default sampler types" table:
5105bd8deadSopenharmony_ci
5115bd8deadSopenharmony_ci      samplerRenderbuffer        handle for accessing a renderbuffer texture
5125bd8deadSopenharmony_ci
5135bd8deadSopenharmony_ci    Add the following sampler type to the "unsigned integer sampler types"
5145bd8deadSopenharmony_ci    table:
5155bd8deadSopenharmony_ci
5165bd8deadSopenharmony_ci      isamplerRenderbuffer       handle for accessing an integer renderbuffer texture
5175bd8deadSopenharmony_ci
5185bd8deadSopenharmony_ci    Add the following sampler type to the "integer sampler types" table:
5195bd8deadSopenharmony_ci
5205bd8deadSopenharmony_ci      usamplerRenderbuffer       handle for accessing an unsigned integer renderbuffer texture
5215bd8deadSopenharmony_ci
5225bd8deadSopenharmony_ci    Add to section 8.7 "Texture Lookup Functions"
5235bd8deadSopenharmony_ci
5245bd8deadSopenharmony_ci    Add new functions to the set of allowed texture lookup functions:
5255bd8deadSopenharmony_ci
5265bd8deadSopenharmony_ci    Syntax:
5275bd8deadSopenharmony_ci
5285bd8deadSopenharmony_ci      vec4 texelFetchRenderbuffer(samplerRenderbuffer sampler, ivec2 coord, int sample)
5295bd8deadSopenharmony_ci
5305bd8deadSopenharmony_ci    Description:
5315bd8deadSopenharmony_ci
5325bd8deadSopenharmony_ci      Use integer texture coordinate <coord> to lookup a single sample <sample>
5335bd8deadSopenharmony_ci      on the texture bound to <sampler> as described in section 2.15.4.1 of the
5345bd8deadSopenharmony_ci      OpenGL specification "Multisample Texel Fetches".
5355bd8deadSopenharmony_ci
5365bd8deadSopenharmony_ci    Syntax:
5375bd8deadSopenharmony_ci
5385bd8deadSopenharmony_ci      ivec2 textureSizeRenderbuffer(samplerRenderbuffer sampler)
5395bd8deadSopenharmony_ci      ivec2 textureSizeRenderbuffer(isamplerRenderbuffer sampler)
5405bd8deadSopenharmony_ci      ivec2 textureSizeRenderbuffer(usamplerRenderbuffer sampler)
5415bd8deadSopenharmony_ci
5425bd8deadSopenharmony_ci    Description:
5435bd8deadSopenharmony_ci
5445bd8deadSopenharmony_ci      Returns the dimensions, width and height of level 0 for the texture bound
5455bd8deadSopenharmony_ci      to <sampler>, as described in section 2.15.4.1 of the OpenGL specification
5465bd8deadSopenharmony_ci      section "Texture Size Query".
5475bd8deadSopenharmony_ci
5485bd8deadSopenharmony_ciExamples
5495bd8deadSopenharmony_ci
5505bd8deadSopenharmony_ciIssues
5515bd8deadSopenharmony_ci
5525bd8deadSopenharmony_ci    (1) Should the NUMBER_OF_SAMPLES parameter reuse an existing enum?
5535bd8deadSopenharmony_ci
5545bd8deadSopenharmony_ci      RESOLVED. Just use SAMPLES_ARB.
5555bd8deadSopenharmony_ci
5565bd8deadSopenharmony_ci    (2) How should we deal with sample patterns of more than
5575bd8deadSopenharmony_ci        sizeof(GLbitfield)*8 bits for the sample mask?
5585bd8deadSopenharmony_ci
5595bd8deadSopenharmony_ci      RESOLVED. The API uses indexed calls to allow indefinite extension of the
5605bd8deadSopenharmony_ci      number of samples exposed.
5615bd8deadSopenharmony_ci
5625bd8deadSopenharmony_ci    (3) What's the interaction between sample mask, sample coverage, and alpha
5635bd8deadSopenharmony_ci        to coverage?
5645bd8deadSopenharmony_ci
5655bd8deadSopenharmony_ci      UNRESOLVED. In the hardware there's just one method for doing overall
5665bd8deadSopenharmony_ci      coverage, so we can combine the two API states into the methods as we see
5675bd8deadSopenharmony_ci      fit. The more interesting question is the interaction between the shader
5685bd8deadSopenharmony_ci      sample mask from GPU_program4_1 and the API-level masks, which we should
5695bd8deadSopenharmony_ci      try to keep similar to the API-level interface.
5705bd8deadSopenharmony_ci
5715bd8deadSopenharmony_ci    (4) Should we expose the CSAA weights in this API?
5725bd8deadSopenharmony_ci
5735bd8deadSopenharmony_ci      RESOLVED. Not in this extension. For now, only maskable samples can be
5745bd8deadSopenharmony_ci      queried. A future extension can allow this functionality.
5755bd8deadSopenharmony_ci
5765bd8deadSopenharmony_ci    (5) What should the default value of SAMPLE_MASK be? 0? ~0?
5775bd8deadSopenharmony_ci
5785bd8deadSopenharmony_ci      RESOLVED. ~0 to match with other state like stencil mask. 
5795bd8deadSopenharmony_ci
5805bd8deadSopenharmony_ci    (6) Should the sample position query work for non-multisample?
5815bd8deadSopenharmony_ci      
5825bd8deadSopenharmony_ci      RESOLVED. The value of SAMPLES for non-multisample is zero, so the sample
5835bd8deadSopenharmony_ci      position query will return an error for all index values in this case.
5845bd8deadSopenharmony_ci
5855bd8deadSopenharmony_ci    (7) Integer/unsigned integer renderbuffer sampler types?
5865bd8deadSopenharmony_ci     
5875bd8deadSopenharmony_ci      RESOLVED. There are integer/unsigned integer renderbuffer sampler types.
5885bd8deadSopenharmony_ci
5895bd8deadSopenharmony_ci    (8) Do we need a program option to enable the new behavior?
5905bd8deadSopenharmony_ci
5915bd8deadSopenharmony_ci      RESOLVED. Yes.
5925bd8deadSopenharmony_ci
5935bd8deadSopenharmony_ci    (9) What should TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV be if the
5945bd8deadSopenharmony_ci        renderbuffer object it refers to has been deleted?
5955bd8deadSopenharmony_ci
5965bd8deadSopenharmony_ci      RESOLVED.  TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV remains unchanged
5975bd8deadSopenharmony_ci      when the renderbuffer is deleted.
5985bd8deadSopenharmony_ci
5995bd8deadSopenharmony_ci    (10) Do renderbuffer textures support texture parameters
6005bd8deadSopenharmony_ci         (TexParameter) or queries (GetTexParameter,
6015bd8deadSopenharmony_ci         GetTexLevelParameter, GetTexImage)?
6025bd8deadSopenharmony_ci
6035bd8deadSopenharmony_ci      RESOLVED: No.  None of the existing parameters apply to renderbuffer
6045bd8deadSopenharmony_ci      textures, and this extension doesn't introduce the need for any new ones.
6055bd8deadSopenharmony_ci      Renderbuffer textures have no levels, and the size in texels is implicit
6065bd8deadSopenharmony_ci      (based on the data store).  Given that the texels themselves are obtained
6075bd8deadSopenharmony_ci      from a renderbuffer object, it seems more appropriate to retrieve such
6085bd8deadSopenharmony_ci      data with renderbuffer queries.
6095bd8deadSopenharmony_ci
6105bd8deadSopenharmony_ci      Note that the spec edits above don't add explicit error language for any
6115bd8deadSopenharmony_ci      of these cases.  That is because each of the functions enumerate the set
6125bd8deadSopenharmony_ci      of valid <target> parameters.  Not editing the spec to allow
6135bd8deadSopenharmony_ci      TEXTURE_RENDERBUFFER_NV in these cases means that target is not legal, and
6145bd8deadSopenharmony_ci      an INVALID_ENUM error should be generated.
6155bd8deadSopenharmony_ci
6165bd8deadSopenharmony_ci    (11) What is the behavior of TexelFetchMultisample when given an
6175bd8deadSopenharmony_ci         out-of-bounds value?
6185bd8deadSopenharmony_ci
6195bd8deadSopenharmony_ci      RESOLVED: Undefined. This spec explicitly lists the behavior as undefined
6205bd8deadSopenharmony_ci      when given a sample number greater than SAMPLES-1 and inherits the
6215bd8deadSopenharmony_ci      undefined behavior specified for TexelFetch when the normal
6225bd8deadSopenharmony_ci      two-dimensional coordinate is outside the range of the texture.
6235bd8deadSopenharmony_ci
6245bd8deadSopenharmony_ci
6255bd8deadSopenharmony_ciRevision History
6265bd8deadSopenharmony_ci
6275bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
6285bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------
6295bd8deadSopenharmony_ci
6305bd8deadSopenharmony_ci    1     7/22/08   ewerness  First revision.
631