Implement conservative depth layout qualifiers. Based partly on a submission.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27758 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2014-08-18 21:27:53 +00:00
parent d6c72a44ab
commit d1888f83f6
9 changed files with 124 additions and 15 deletions

12
Test/420.frag Normal file
View File

@@ -0,0 +1,12 @@
#version 420 core
layout(depth_any) out float gl_FragDepth;
layout(depth_greater) out float gl_FragDepth; // ERROR: redeclaration with different qualifier
void main()
{
gl_FragDepth = 0.3;
}
layout(depth_less) in float depth; // ERROR: depth_less only applies to gl_FragDepth
layout(depth_any) out float gl_FragDepth; // ERROR, done after use

View File

@@ -0,0 +1,42 @@
420.frag
Warning, version 420 is not yet complete; most version-specific features are present, but some are missing.
ERROR: 0:4: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth
ERROR: 0:11: 'layout qualifier' : can only apply depth layout to gl_FragDepth
ERROR: 0:12: 'gl_FragDepth' : cannot redeclare after use
ERROR: 3 compilation errors. No code generated.
Shader version: 420
using depth_any
ERROR: node is still EOpNull!
0:6 Function Definition: main( (void)
0:6 Function Parameters:
0:8 Sequence
0:8 move second child to first child (float)
0:8 'gl_FragDepth' (gl_FragDepth float)
0:8 Constant:
0:8 0.300000
0:? Linker Objects
0:? 'gl_FragDepth' (gl_FragDepth float)
0:? 'gl_FragDepth' (gl_FragDepth float)
0:? 'depth' (smooth in float)
Linked fragment stage:
Shader version: 420
using depth_any
ERROR: node is still EOpNull!
0:6 Function Definition: main( (void)
0:6 Function Parameters:
0:8 Sequence
0:8 move second child to first child (float)
0:8 'gl_FragDepth' (gl_FragDepth float)
0:8 Constant:
0:8 0.300000
0:? Linker Objects
0:? 'gl_FragDepth' (gl_FragDepth float)
0:? 'gl_FragDepth' (gl_FragDepth float)
0:? 'depth' (smooth in float)

View File

@@ -16,11 +16,9 @@ ERROR: 0:100: 'local_size_x' : there is no such layout identifier for this stage
ERROR: 0:102: 'color' : redefinition
ERROR: 0:103: 'index' : there is no such layout identifier for this stage taking an assigned value
ERROR: 0:104: 'location' : overlapping use of location 3
ERROR: 0:106: 'depth_greater' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)
ERROR: 0:112: 'depth_any' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)
ERROR: 0:115: 'depth_greater' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)
ERROR: 0:118: 'depth_less' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)
ERROR: 0:121: 'depth_unchanged' : unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)
ERROR: 0:112: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth
ERROR: 0:118: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth
ERROR: 0:121: 'redeclaration' : all redeclarations must use the same depth layout on gl_FragDepth
ERROR: 0:150: 'constructor' : constructing from a non-dereferenced array
ERROR: 0:150: '=' : cannot convert from 'const float' to '3-element array of 4-component vector of float'
ERROR: 0:152: 'constructor' : cannot convert parameter 1 from 'const 2-element array of 4-component vector of float' to '4-component vector of float'
@@ -45,7 +43,7 @@ ERROR: 0:226: 'in' : not allowed in nested scope
ERROR: 0:227: 'in' : not allowed in nested scope
ERROR: 0:228: 'in' : not allowed in nested scope
ERROR: 0:232: 'out' : not allowed in nested scope
ERROR: 45 compilation errors. No code generated.
ERROR: 43 compilation errors. No code generated.
Shader version: 430
@@ -53,6 +51,7 @@ Requested GL_3DL_array_objects
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
using early_fragment_tests
using depth_greater
ERROR: node is still EOpNull!
0:5 Sequence
0:5 move second child to first child (int)
@@ -306,6 +305,7 @@ Requested GL_3DL_array_objects
gl_FragCoord pixel center is integer
gl_FragCoord origin is upper left
using early_fragment_tests
using depth_greater
ERROR: node is still EOpNull!
0:5 Sequence
0:5 move second child to first child (int)

View File

@@ -53,6 +53,7 @@ tokenLength.vert
110scope.vert
300scope.vert
400.frag
420.frag
420.vert
420.geom
420_size_gl_in.geom