15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_conservative_raster_underestimation
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_conservative_raster_underestimation
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContact
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Kedarnath Thangudu, NVIDIA Corporation (kthangudu 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContributors
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Mark Kilgard, NVIDIA
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciStatus
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Shipping in NVIDIA release 388.XX drivers and up
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciVersion
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Last Modified Date:         November 15, 2017
245bd8deadSopenharmony_ci    Revision:                   1
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciNumber
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    OpenGL Extension #518
295bd8deadSopenharmony_ci
305bd8deadSopenharmony_ciDependencies
315bd8deadSopenharmony_ci
325bd8deadSopenharmony_ci    This extension is written against NV_conservative_raster as applied to
335bd8deadSopenharmony_ci    OpenGL 4.3 specification (Core Profile).
345bd8deadSopenharmony_ci
355bd8deadSopenharmony_ci    This extension interacts with NV_gpu_program4 and NV_gpu_program5.
365bd8deadSopenharmony_ci    
375bd8deadSopenharmony_ciOverview
385bd8deadSopenharmony_ci    
395bd8deadSopenharmony_ci    The extension NV_conservative_raster provides a new rasterization mode 
405bd8deadSopenharmony_ci    known as "Overestimated Conservative Rasterization", where any pixel that 
415bd8deadSopenharmony_ci    is partially covered, even if no sample location is covered, is treated as 
425bd8deadSopenharmony_ci    fully covered and a corresponding fragment will be shaded.  There is also 
435bd8deadSopenharmony_ci    an "Underestimated Conservative Rasterization" variant, where only the 
445bd8deadSopenharmony_ci    pixels that are completely covered by the primitive are rasterized. 
455bd8deadSopenharmony_ci
465bd8deadSopenharmony_ci    This extension provides the underestimated conservative rasterization 
475bd8deadSopenharmony_ci    information for each fragment in the fragment shader through a new
485bd8deadSopenharmony_ci    built-in gl_FragFullyCoveredNV.
495bd8deadSopenharmony_ci
505bd8deadSopenharmony_ciNew Procedures and Functions
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    None.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ciNew Tokens
555bd8deadSopenharmony_ci
565bd8deadSopenharmony_ci    None.
575bd8deadSopenharmony_ci
585bd8deadSopenharmony_ciAdditions to Chapter 14 of the OpenGL 4.3 (Compatibility Profile) Specification
595bd8deadSopenharmony_ci(Fixed-Function Primitive Assembly and Rasterization)
605bd8deadSopenharmony_ci
615bd8deadSopenharmony_ci    Add a new paragraph at the end of subsection 14.6.X "Conservative 
625bd8deadSopenharmony_ci    Rasterization" (added by NV_conservative_raster)
635bd8deadSopenharmony_ci
645bd8deadSopenharmony_ci    When CONSERVATIVE_RASTERIZATION_NV is enabled, the fragment shader built-in
655bd8deadSopenharmony_ci    input boolean variable gl_FragFullyCoveredNV will indicate if the fragment 
665bd8deadSopenharmony_ci    being shaded is completely covered by the primitive.
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ciAdditions to Chapter 15 of the OpenGL 4.3 (Compatibility Profile) Specification
695bd8deadSopenharmony_ci(Programmable Fragment Processing)
705bd8deadSopenharmony_ci
715bd8deadSopenharmony_ci    Add to the Section 15.2.2 (Shader Inputs)
725bd8deadSopenharmony_ci
735bd8deadSopenharmony_ci    When CONSERVATIVE_RASTERIZATION_NV is enabled, the built-in read-only 
745bd8deadSopenharmony_ci    variable gl_FragFullyCoveredNV is set to TRUE if the fragment is fully 
755bd8deadSopenharmony_ci    covered by the generating primitive, and FALSE otherwise.
765bd8deadSopenharmony_ci
775bd8deadSopenharmony_ciNew State
785bd8deadSopenharmony_ci
795bd8deadSopenharmony_ci    None.
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ci    None.
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ciGLX Protocol
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ci    None.
885bd8deadSopenharmony_ci    
895bd8deadSopenharmony_ciModifications to the OpenGL Shading Language Specification, Version 4.30
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    Including the following line in a shader can be used to control the 
925bd8deadSopenharmony_ci    language features described in this extension:
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci        #extension GL_NV_conservative_raster_underestimation : <behavior>
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ci    where <behavior> is as specified in section 3.3.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    New preprocessor #defines are added to the OpenGL Shading Language:
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ci        #define GL_NV_conservative_raster_underestimation     1
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    Modify Section 7.1 (Built-In Language Variables), p. 113
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    Add to the list of fragment shader built-ins:
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci        in bool gl_FragFullyCoveredNV;
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci    Add the following descriptions for gl_FragFullyCoveredNV:
1095bd8deadSopenharmony_ci
1105bd8deadSopenharmony_ci    The built-in variable gl_FragFullyCoveredNV is a fragment-shader input 
1115bd8deadSopenharmony_ci    variable which is set to TRUE, when CONSERVATIVE_RASTERIZATION_NV is 
1125bd8deadSopenharmony_ci    enabled and the fragment is fully covered by the generating primitive, and 
1135bd8deadSopenharmony_ci    FALSE otherwise. 
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ciErrors
1165bd8deadSopenharmony_ci
1175bd8deadSopenharmony_ci    None.
1185bd8deadSopenharmony_ci
1195bd8deadSopenharmony_ciInteractions with NV_gpu_program4 and NV_gpu_program5
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    If NV_gpu_program4 or NV_gpu_program5 is supported and the 
1225bd8deadSopenharmony_ci    "NV_conservative_raster_underestimation" program option is specified, 
1235bd8deadSopenharmony_ci    fragment programs can read the "fragment.fullycovered" attribute to 
1245bd8deadSopenharmony_ci    determine if the fragment is fully covered by the primitive.
1255bd8deadSopenharmony_ci
1265bd8deadSopenharmony_ci    (Add the following rule to the NV_fragment_program4 grammar)
1275bd8deadSopenharmony_ci
1285bd8deadSopenharmony_ci    <attribBasic>   ::= ...
1295bd8deadSopenharmony_ci                      | <fragPrefix> "fullycovered"
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    (Add the following to the Table X.X Fragment Attribute Bindings)
1325bd8deadSopenharmony_ci
1335bd8deadSopenharmony_ci    Fragment Attribute Binding  Components  Underlying State
1345bd8deadSopenharmony_ci    --------------------------  ----------  ----------------------------
1355bd8deadSopenharmony_ci    * fragment.fullycovered     (c,-,-,-)   fragment fully covered.
1365bd8deadSopenharmony_ci
1375bd8deadSopenharmony_ci    (Add the following to the Section 2.X.2, Program Grammar)
1385bd8deadSopenharmony_ci
1395bd8deadSopenharmony_ci    If a fragment attribute binding matches "fragment.fullycovered", the "x"
1405bd8deadSopenharmony_ci    component of the fragment attribute variable is set to either 0 or 1,
1415bd8deadSopenharmony_ci    depending on how the fragment is covered by the primitive.  If 
1425bd8deadSopenharmony_ci    CONSERVATIVE_RASTERIZATION is enabled and the fragment is completely 
1435bd8deadSopenharmony_ci    covered by the primitive, the fullycovered attribute is set to 1; 
1445bd8deadSopenharmony_ci    otherwise, it is set to 0.  The "y", "z", and "w" coordinates are 
1455bd8deadSopenharmony_ci    undefined.
1465bd8deadSopenharmony_ci
1475bd8deadSopenharmony_ci    If the "NV_conservative_raster_underestimation" program option is not 
1485bd8deadSopenharmony_ci    specified, "fragment.fullycovered" binding is unavailable.
1495bd8deadSopenharmony_ci
1505bd8deadSopenharmony_ciIssues
1515bd8deadSopenharmony_ci
1525bd8deadSopenharmony_ci    (1) Do you need a new rasterization mode for underestimated conservative 
1535bd8deadSopenharmony_ci    rasterization?
1545bd8deadSopenharmony_ci
1555bd8deadSopenharmony_ci    RESOLVED: Enabling CONSERVATIVE_RASTERIZATION will compute both 
1565bd8deadSopenharmony_ci    overestimated and underestimated coverage for a primitive. A fragment will 
1575bd8deadSopenharmony_ci    be shaded for each pixel that is covered under overestimation and the 
1585bd8deadSopenharmony_ci    underestimation information is provided as a fragment shader input.  By 
1595bd8deadSopenharmony_ci    simply discarding fragments that are not fully covered in the fragment 
1605bd8deadSopenharmony_ci    shader, an application can achieve underestimated rasterization of a 
1615bd8deadSopenharmony_ci    primitive in the final image.
1625bd8deadSopenharmony_ci
1635bd8deadSopenharmony_ci    (2) Should the y, z, and w components of the fragment.fullycovered
1645bd8deadSopenharmony_ci    state for NV_gpu_program4 and NV_gpu_program5 be undefined?
1655bd8deadSopenharmony_ci
1665bd8deadSopenharmony_ci    RESOLVED: Yes.
1675bd8deadSopenharmony_ci
1685bd8deadSopenharmony_ci    The (c,-,-,-) is consistent with all the other scalar attributes in
1695bd8deadSopenharmony_ci    NV_gpu_program*.
1705bd8deadSopenharmony_ci
1715bd8deadSopenharmony_ci    This undefined behavior is limited to the assembly interface and
1725bd8deadSopenharmony_ci    not exposed in GLSL.
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ci    (3) How does having CONSERVATIVE_RASTERIZATION enabled affect the sample 
1755bd8deadSopenharmony_ci    mask (gl_SampleMask) visible in the fragment shader?
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci    RESOLVED: When you have CONSERVATIVE_RASTERIZATION enabled on, the 
1785bd8deadSopenharmony_ci    gl_SampleMask will unconditionally show all 1's for valid samples.
1795bd8deadSopenharmony_ci
1805bd8deadSopenharmony_ci    Even with all 1's in gl_SampleMask doesn't imply that a fragment is
1815bd8deadSopenharmony_ci    fully covered.
1825bd8deadSopenharmony_ci    
1835bd8deadSopenharmony_ciRevision History
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    Revision 1
1865bd8deadSopenharmony_ci      - Internal revisions.
187