Parser: Precise: Recognize 'precise', tag types, and do related semantic checking.

This partly overlaps pull request #222, we have divided the work on this one.
This commit is contained in:
John Kessenich 2016-05-04 12:36:14 -06:00
parent 758bb5520d
commit 17f0786418
15 changed files with 797 additions and 742 deletions

View File

@ -100,3 +100,6 @@ void foop()
patch out pinbn {
int a;
} pinbi;
invariant precise out vec4 badOrder[]; // ERROR, precise must appear first
void badp(out precise float f); // ERROR, precise must appear first

View File

@ -229,7 +229,10 @@ ERROR: 0:74: 'in' : type must be an array: ina
ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized
ERROR: 0:83: 'location' : overlapping use of location 4
ERROR: 0:87: 'location' : overlapping use of location 4
ERROR: 18 compilation errors. No code generated.
ERROR: 0:104: '' : precise qualifier must appear first
ERROR: 0:105: '' : precise qualifier must appear first
ERROR: 0:105: '' : precise qualifier must appear first
ERROR: 21 compilation errors. No code generated.
Shader version: 400
@ -391,20 +394,20 @@ ERROR: node is still EOpNull!
0:91 Function Parameters:
0:? Sequence
0:95 multiply second child into first child (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:96 move second child to first child (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 fma (global 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:97 move second child to first child (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 fma (global double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:? Linker Objects
0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance})
0:? 'outa' (global 4-element array of int)
@ -420,8 +423,9 @@ ERROR: node is still EOpNull!
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (temp 3-component vector of float)
0:? 'pv3' (noContraction temp 3-component vector of float)
0:? 'pinbi' (patch out block{out int a})
0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float)
400.tese
Warning, version 400 is not yet complete; most version-specific features are present, but some are missing.
@ -1169,20 +1173,20 @@ vertices = 4
0:91 Function Parameters:
0:? Sequence
0:95 multiply second child into first child (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:96 move second child to first child (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 fma (global 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:97 move second child to first child (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 fma (global double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:8 Function Definition: main( (global void)
0:8 Function Parameters:
0:15 Function Definition: main( (global void)
@ -1294,8 +1298,9 @@ vertices = 4
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (temp 3-component vector of float)
0:? 'pv3' (noContraction temp 3-component vector of float)
0:? 'pinbi' (patch out block{out int a})
0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float)
0:? 'a' (out 3-element array of int)
0:? 'outb' (out 5-element array of int)
0:? 'outc' (out 4-element array of int)

View File

@ -3,7 +3,7 @@ ERROR: 0:8: 'varying' : Reserved word.
ERROR: 0:8: 'varying' : no longer supported in es profile; removed in version 300
ERROR: 0:9: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:10: '' : precision qualifier must appear as last qualifier
ERROR: 0:11: '' : invariant qualifier must appear first
ERROR: 0:11: '' : invariant qualifier must appear before interpolation, storage, and precision qualifiers
ERROR: 0:12: '' : Auxiliary qualifiers (centroid, patch, and sample) must appear before storage and precision qualifiers
ERROR: 0:12: '' : vertex input cannot be further qualified
ERROR: 0:13: '' : interpolation qualifiers must appear before storage and precision qualifiers

View File

@ -45,6 +45,7 @@ ERROR: 0:143: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCoun
ERROR: 0:149: '[]' : scalar integer expression required
ERROR: 0:166: 'precision' : can only apply highp to atomic_uint
ERROR: 0:168: 'precise' : Reserved word.
ERROR: 0:168: 'precise' : not supported for this version or the enabled extensions
ERROR: 0:170: 'dmat2x4' : Reserved word.
ERROR: 0:170: 'double matrix' : not supported with this profile: es
ERROR: 0:171: 'samplerCubeArray' : Reserved word.
@ -78,7 +79,7 @@ ERROR: 0:227: 'input block' : not supported in this stage: compute
ERROR: 0:231: 'output block' : not supported in this stage: compute
WARNING: 0:235: 't__' : identifiers containing consecutive underscores ("__") are reserved
WARNING: 0:238: '#define' : names containing consecutive underscores are reserved: __D
ERROR: 76 compilation errors. No code generated.
ERROR: 77 compilation errors. No code generated.
Shader version: 310
@ -484,7 +485,7 @@ ERROR: node is still EOpNull!
0:? 'i' (uniform highp int)
0:? 'atomi' (shared highp int)
0:? 'atomu' (shared highp uint)
0:? 'pfoo' (temp highp int)
0:? 'pfoo' (noContraction temp highp int)
0:? 'dm' (global 2X4 matrix of double)
0:? 'sca' (uniform mediump samplerCubeArray)
0:? 'i2dr' (uniform mediump iimage2DRect)
@ -911,7 +912,7 @@ ERROR: node is still EOpNull!
0:? 'i' (uniform highp int)
0:? 'atomi' (shared highp int)
0:? 'atomu' (shared highp uint)
0:? 'pfoo' (temp highp int)
0:? 'pfoo' (noContraction temp highp int)
0:? 'dm' (global 2X4 matrix of double)
0:? 'sca' (uniform mediump samplerCubeArray)
0:? 'i2dr' (uniform mediump iimage2DRect)

View File

@ -61,6 +61,7 @@ ERROR: 0:183: 'gl_PrimitiveID' : required extension not requested: Possible exte
GL_EXT_geometry_shader
GL_OES_geometry_shader
ERROR: 0:209: 'precise' : Reserved word.
ERROR: 0:209: 'precise' : not supported for this version or the enabled extensions
ERROR: 0:210: 'fma' : required extension not requested: Possible extensions include:
GL_EXT_gpu_shader5
GL_OES_gpu_shader5
@ -129,7 +130,7 @@ ERROR: 0:427: 'blend equation' : can only apply to a standalone qualifier
ERROR: 0:428: 'blend equation' : can only apply to a standalone qualifier
ERROR: 0:429: 'blend_support' : unknown blend equation
ERROR: 0:431: 'fragment-shader array-of-array output' : not supported with this profile: es
ERROR: 121 compilation errors. No code generated.
ERROR: 122 compilation errors. No code generated.
Shader version: 310
@ -431,11 +432,11 @@ ERROR: node is still EOpNull!
0:207 Function Parameters:
0:? Sequence
0:210 move second child to first child (temp mediump 2-component vector of float)
0:210 'h' (temp mediump 2-component vector of float)
0:210 'h' (noContraction temp mediump 2-component vector of float)
0:210 fma (global mediump 2-component vector of float)
0:210 'inf' (smooth in mediump 2-component vector of float)
0:210 'ing' (smooth in mediump 2-component vector of float)
0:210 'h' (temp mediump 2-component vector of float)
0:210 'h' (noContraction temp mediump 2-component vector of float)
0:211 textureGatherOffset (global highp 4-component vector of float)
0:211 direct index (temp highp sampler2D)
0:211 'sArray' (uniform 4-element array of highp sampler2D)
@ -467,11 +468,11 @@ ERROR: node is still EOpNull!
0:217 Function Parameters:
0:? Sequence
0:220 move second child to first child (temp mediump 2-component vector of float)
0:220 'h' (temp mediump 2-component vector of float)
0:220 'h' (noContraction temp mediump 2-component vector of float)
0:220 fma (global mediump 2-component vector of float)
0:220 'inf' (smooth in mediump 2-component vector of float)
0:220 'ing' (smooth in mediump 2-component vector of float)
0:220 'h' (temp mediump 2-component vector of float)
0:220 'h' (noContraction temp mediump 2-component vector of float)
0:221 textureGatherOffset (global highp 4-component vector of float)
0:221 direct index (temp highp sampler2D)
0:221 'sArray' (uniform 4-element array of highp sampler2D)
@ -1312,11 +1313,11 @@ ERROR: node is still EOpNull!
0:207 Function Parameters:
0:? Sequence
0:210 move second child to first child (temp mediump 2-component vector of float)
0:210 'h' (temp mediump 2-component vector of float)
0:210 'h' (noContraction temp mediump 2-component vector of float)
0:210 fma (global mediump 2-component vector of float)
0:210 'inf' (smooth in mediump 2-component vector of float)
0:210 'ing' (smooth in mediump 2-component vector of float)
0:210 'h' (temp mediump 2-component vector of float)
0:210 'h' (noContraction temp mediump 2-component vector of float)
0:211 textureGatherOffset (global highp 4-component vector of float)
0:211 direct index (temp highp sampler2D)
0:211 'sArray' (uniform 4-element array of highp sampler2D)
@ -1348,11 +1349,11 @@ ERROR: node is still EOpNull!
0:217 Function Parameters:
0:? Sequence
0:220 move second child to first child (temp mediump 2-component vector of float)
0:220 'h' (temp mediump 2-component vector of float)
0:220 'h' (noContraction temp mediump 2-component vector of float)
0:220 fma (global mediump 2-component vector of float)
0:220 'inf' (smooth in mediump 2-component vector of float)
0:220 'ing' (smooth in mediump 2-component vector of float)
0:220 'h' (temp mediump 2-component vector of float)
0:220 'h' (noContraction temp mediump 2-component vector of float)
0:221 textureGatherOffset (global highp 4-component vector of float)
0:221 direct index (temp highp sampler2D)
0:221 'sArray' (uniform 4-element array of highp sampler2D)

View File

@ -31,6 +31,7 @@ ERROR: 0:80: '' : array size required
ERROR: 0:86: 'location' : overlapping use of location 4
ERROR: 0:90: 'location' : overlapping use of location 4
ERROR: 0:94: 'precise' : Reserved word.
ERROR: 0:94: 'precise' : not supported for this version or the enabled extensions
ERROR: 0:95: 'fma' : required extension not requested: Possible extensions include:
GL_EXT_gpu_shader5
GL_OES_gpu_shader5
@ -45,7 +46,7 @@ ERROR: 0:145: '' : array size required
ERROR: 0:161: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID
ERROR: 0:162: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID
ERROR: 0:165: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID
ERROR: 37 compilation errors. No code generated.
ERROR: 38 compilation errors. No code generated.
Shader version: 310
@ -197,11 +198,11 @@ ERROR: node is still EOpNull!
0:92 Function Parameters:
0:? Sequence
0:95 move second child to first child (temp highp float)
0:95 'd' (temp highp float)
0:95 'd' (noContraction temp highp float)
0:95 fma (global highp float)
0:95 'd' (temp highp float)
0:95 'd' (temp highp float)
0:95 'd' (temp highp float)
0:95 'd' (noContraction temp highp float)
0:95 'd' (noContraction temp highp float)
0:95 'd' (noContraction temp highp float)
0:112 Function Definition: pointSize2( (global void)
0:112 Function Parameters:
0:114 Sequence
@ -227,20 +228,20 @@ ERROR: node is still EOpNull!
0:122 Function Parameters:
0:? Sequence
0:126 multiply second child into first child (temp highp 3-component vector of float)
0:126 'pv3' (temp highp 3-component vector of float)
0:126 'pv3' (temp highp 3-component vector of float)
0:126 'pv3' (noContraction temp highp 3-component vector of float)
0:126 'pv3' (noContraction temp highp 3-component vector of float)
0:127 move second child to first child (temp highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:127 fma (global highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:128 move second child to first child (temp highp float)
0:128 'd' (temp highp float)
0:128 'd' (noContraction temp highp float)
0:128 fma (global highp float)
0:128 'd' (temp highp float)
0:128 'd' (temp highp float)
0:128 'd' (temp highp float)
0:128 'd' (noContraction temp highp float)
0:128 'd' (noContraction temp highp float)
0:128 'd' (noContraction temp highp float)
0:131 Function Definition: bbBad( (global void)
0:131 Function Parameters:
0:133 Sequence
@ -371,7 +372,7 @@ ERROR: node is still EOpNull!
0:? 'badlay' (out 4-element array of highp float)
0:? 'misSized' (out 5-element array of highp float)
0:? 'okaySize' (out 4-element array of highp float)
0:? 'pv3' (temp highp 3-component vector of float)
0:? 'pv3' (noContraction temp highp 3-component vector of float)
0:? 'badpatchIName' (patch out implicitly-sized array of block{out highp float f})
0:? 'patchIName' (patch out 4-element array of block{out highp float f})
@ -528,11 +529,11 @@ ERROR: node is still EOpNull!
0:92 Function Parameters:
0:? Sequence
0:95 move second child to first child (temp highp float)
0:95 'd' (temp highp float)
0:95 'd' (noContraction temp highp float)
0:95 fma (global highp float)
0:95 'd' (temp highp float)
0:95 'd' (temp highp float)
0:95 'd' (temp highp float)
0:95 'd' (noContraction temp highp float)
0:95 'd' (noContraction temp highp float)
0:95 'd' (noContraction temp highp float)
0:112 Function Definition: pointSize2( (global void)
0:112 Function Parameters:
0:114 Sequence
@ -558,20 +559,20 @@ ERROR: node is still EOpNull!
0:122 Function Parameters:
0:? Sequence
0:126 multiply second child into first child (temp highp 3-component vector of float)
0:126 'pv3' (temp highp 3-component vector of float)
0:126 'pv3' (temp highp 3-component vector of float)
0:126 'pv3' (noContraction temp highp 3-component vector of float)
0:126 'pv3' (noContraction temp highp 3-component vector of float)
0:127 move second child to first child (temp highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:127 fma (global highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:127 'pv3' (noContraction temp highp 3-component vector of float)
0:128 move second child to first child (temp highp float)
0:128 'd' (temp highp float)
0:128 'd' (noContraction temp highp float)
0:128 fma (global highp float)
0:128 'd' (temp highp float)
0:128 'd' (temp highp float)
0:128 'd' (temp highp float)
0:128 'd' (noContraction temp highp float)
0:128 'd' (noContraction temp highp float)
0:128 'd' (noContraction temp highp float)
0:131 Function Definition: bbBad( (global void)
0:131 Function Parameters:
0:133 Sequence
@ -702,7 +703,7 @@ ERROR: node is still EOpNull!
0:? 'badlay' (out 4-element array of highp float)
0:? 'misSized' (out 5-element array of highp float)
0:? 'okaySize' (out 4-element array of highp float)
0:? 'pv3' (temp highp 3-component vector of float)
0:? 'pv3' (noContraction temp highp 3-component vector of float)
0:? 'badpatchIName' (patch out 1-element array of block{out highp float f})
0:? 'patchIName' (patch out 4-element array of block{out highp float f})

View File

@ -29,6 +29,7 @@ ERROR: 0:131: 'flat/smooth/noperspective' : cannot use interpolation qualifiers
ERROR: 0:135: 'centroid' : cannot use centroid qualifier on an interface block
ERROR: 0:139: 'invariant' : cannot use invariant qualifier on an interface block
ERROR: 0:155: 'precise' : Reserved word.
ERROR: 0:155: 'precise' : not supported for this version or the enabled extensions
ERROR: 0:156: 'fma' : required extension not requested: Possible extensions include:
GL_EXT_gpu_shader5
GL_OES_gpu_shader5
@ -96,7 +97,7 @@ ERROR: 0:389: 'sample' : Reserved word.
ERROR: 0:400: 'interpolateAtCentroid' : no matching overloaded function found
ERROR: 0:401: 'interpolateAtSample' : no matching overloaded function found
ERROR: 0:402: 'interpolateAtOffset' : no matching overloaded function found
ERROR: 92 compilation errors. No code generated.
ERROR: 93 compilation errors. No code generated.
Shader version: 310
@ -285,11 +286,11 @@ ERROR: node is still EOpNull!
0:153 Function Parameters:
0:? Sequence
0:156 move second child to first child (temp highp 2-component vector of float)
0:156 'h' (temp highp 2-component vector of float)
0:156 'h' (noContraction temp highp 2-component vector of float)
0:156 fma (global highp 2-component vector of float)
0:156 'inf' (in highp 2-component vector of float)
0:156 'ing' (in highp 2-component vector of float)
0:156 'h' (temp highp 2-component vector of float)
0:156 'h' (noContraction temp highp 2-component vector of float)
0:157 indirect index (temp highp sampler2D)
0:157 'sArray' (uniform 4-element array of highp sampler2D)
0:157 add (temp highp int)
@ -360,11 +361,11 @@ ERROR: node is still EOpNull!
0:171 Function Parameters:
0:? Sequence
0:174 move second child to first child (temp highp 2-component vector of float)
0:174 'h' (temp highp 2-component vector of float)
0:174 'h' (noContraction temp highp 2-component vector of float)
0:174 fma (global highp 2-component vector of float)
0:174 'inf' (in highp 2-component vector of float)
0:174 'ing' (in highp 2-component vector of float)
0:174 'h' (temp highp 2-component vector of float)
0:174 'h' (noContraction temp highp 2-component vector of float)
0:175 indirect index (temp highp sampler2D)
0:175 'sArray' (uniform 4-element array of highp sampler2D)
0:175 add (temp highp int)
@ -1216,11 +1217,11 @@ ERROR: node is still EOpNull!
0:153 Function Parameters:
0:? Sequence
0:156 move second child to first child (temp highp 2-component vector of float)
0:156 'h' (temp highp 2-component vector of float)
0:156 'h' (noContraction temp highp 2-component vector of float)
0:156 fma (global highp 2-component vector of float)
0:156 'inf' (in highp 2-component vector of float)
0:156 'ing' (in highp 2-component vector of float)
0:156 'h' (temp highp 2-component vector of float)
0:156 'h' (noContraction temp highp 2-component vector of float)
0:157 indirect index (temp highp sampler2D)
0:157 'sArray' (uniform 4-element array of highp sampler2D)
0:157 add (temp highp int)
@ -1291,11 +1292,11 @@ ERROR: node is still EOpNull!
0:171 Function Parameters:
0:? Sequence
0:174 move second child to first child (temp highp 2-component vector of float)
0:174 'h' (temp highp 2-component vector of float)
0:174 'h' (noContraction temp highp 2-component vector of float)
0:174 fma (global highp 2-component vector of float)
0:174 'inf' (in highp 2-component vector of float)
0:174 'ing' (in highp 2-component vector of float)
0:174 'h' (temp highp 2-component vector of float)
0:174 'h' (noContraction temp highp 2-component vector of float)
0:175 indirect index (temp highp sampler2D)
0:175 'sArray' (uniform 4-element array of highp sampler2D)
0:175 add (temp highp int)

View File

@ -18,7 +18,10 @@ ERROR: 0:74: 'in' : type must be an array: ina
ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized
ERROR: 0:83: 'location' : overlapping use of location 4
ERROR: 0:87: 'location' : overlapping use of location 4
ERROR: 18 compilation errors. No code generated.
ERROR: 0:104: '' : precise qualifier must appear first
ERROR: 0:105: '' : precise qualifier must appear first
ERROR: 0:105: '' : precise qualifier must appear first
ERROR: 21 compilation errors. No code generated.
Shader version: 400
@ -180,20 +183,20 @@ ERROR: node is still EOpNull!
0:91 Function Parameters:
0:? Sequence
0:95 multiply second child into first child (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:96 move second child to first child (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 fma (global 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:97 move second child to first child (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 fma (global double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:? Linker Objects
0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance})
0:? 'outa' (global 4-element array of int)
@ -209,8 +212,9 @@ ERROR: node is still EOpNull!
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (temp 3-component vector of float)
0:? 'pv3' (noContraction temp 3-component vector of float)
0:? 'pinbi' (patch out block{out int a})
0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float)
Linked tessellation control stage:
@ -375,20 +379,20 @@ ERROR: node is still EOpNull!
0:91 Function Parameters:
0:? Sequence
0:95 multiply second child into first child (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:95 'pv3' (noContraction temp 3-component vector of float)
0:96 move second child to first child (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 fma (global 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:96 'pv3' (noContraction temp 3-component vector of float)
0:97 move second child to first child (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 fma (global double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:97 'd' (noContraction temp double)
0:? Linker Objects
0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance})
0:? 'outa' (global 4-element array of int)
@ -404,6 +408,7 @@ ERROR: node is still EOpNull!
0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float)
0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float)
0:? 'pv3' (temp 3-component vector of float)
0:? 'pv3' (noContraction temp 3-component vector of float)
0:? 'pinbi' (patch out block{out int a})
0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float)

View File

@ -28,7 +28,6 @@ ERROR: 0:97: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCount
ERROR: 0:106: '' : vertex input cannot be further qualified
ERROR: 0:106: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_FrontColor
ERROR: 0:112: 'ColorIvn' : identifier not previously declared
WARNING: 0:118: '' : unknown requalification
ERROR: 0:132: 'shared' : not supported in this stage: vertex
ERROR: 0:134: '' : function does not return a value: funcA
ERROR: 0:136: '' : function does not return a value: funcB
@ -70,7 +69,7 @@ ERROR: node is still EOpNull!
0:148 Sequence
0:148 Sequence
0:148 move second child to first child (temp float)
0:148 'result' (temp float)
0:148 'result' (noContraction temp float)
0:148 add (temp float)
0:148 component-wise multiply (temp float)
0:148 'e' (in float)
@ -79,7 +78,7 @@ ERROR: node is still EOpNull!
0:148 'g' (in float)
0:148 'h' (in float)
0:150 Branch: Return with expression
0:150 'result' (temp float)
0:150 'result' (noContraction temp float)
0:153 Function Definition: func3(f1;f1;f1; (global float)
0:153 Function Parameters:
0:153 'i' (in float)
@ -112,7 +111,7 @@ ERROR: node is still EOpNull!
0:161 'd' (in 4-component vector of float)
0:162 move second child to first child (temp 3-component vector of float)
0:162 vector swizzle (temp 3-component vector of float)
0:162 'v' (smooth out 4-component vector of float)
0:162 'v' (noContraction smooth out 4-component vector of float)
0:162 Sequence
0:162 Constant:
0:162 0 (const int)
@ -125,7 +124,7 @@ ERROR: node is still EOpNull!
0:162 's' (temp 3-component vector of float)
0:163 move second child to first child (temp float)
0:163 direct index (temp float)
0:163 'v' (smooth out 4-component vector of float)
0:163 'v' (noContraction smooth out 4-component vector of float)
0:163 Constant:
0:163 3 (const int)
0:163 add (temp float)
@ -149,7 +148,7 @@ ERROR: node is still EOpNull!
0:163 3 (const int)
0:164 move second child to first child (temp float)
0:164 direct index (temp float)
0:164 'v' (smooth out 4-component vector of float)
0:164 'v' (noContraction smooth out 4-component vector of float)
0:164 Constant:
0:164 0 (const int)
0:164 Function Call: func(f1;f1;f1;f1; (global float)
@ -171,7 +170,7 @@ ERROR: node is still EOpNull!
0:164 0 (const int)
0:166 move second child to first child (temp float)
0:166 direct index (temp float)
0:166 'v' (smooth out 4-component vector of float)
0:166 'v' (noContraction smooth out 4-component vector of float)
0:166 Constant:
0:166 0 (const int)
0:166 Function Call: func2(f1;f1;f1;f1; (global float)
@ -211,7 +210,7 @@ ERROR: node is still EOpNull!
0:167 Constant:
0:167 0 (const int)
0:167 direct index (temp float)
0:167 'v' (smooth out 4-component vector of float)
0:167 'v' (noContraction smooth out 4-component vector of float)
0:167 Constant:
0:167 0 (const int)
0:169 Function Call: funcA(I21; (global 4-component vector of float)
@ -302,13 +301,13 @@ ERROR: node is still EOpNull!
0:? 'anon@5' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
0:? 'ColorInv' (smooth out 3-component vector of float)
0:? 'Color4' (invariant centroid smooth out 3-component vector of float)
0:? 'position' (smooth out 4-component vector of float)
0:? 'position' (noContraction smooth out 4-component vector of float)
0:? 'Color5' (smooth out 3-component vector of float)
0:? 'a' (in 4-component vector of float)
0:? 'b' (in 4-component vector of float)
0:? 'c' (in 4-component vector of float)
0:? 'd' (in 4-component vector of float)
0:? 'v' (smooth out 4-component vector of float)
0:? 'v' (noContraction smooth out 4-component vector of float)
0:? 'anon@6' (layout(column_major shared ) coherent buffer block{layout(column_major shared ) readonly buffer 4-component vector of float member1, layout(column_major shared ) buffer 4-component vector of float member2})
0:? 'anon@7' (layout(column_major shared ) buffer block{layout(column_major shared ) coherent readonly buffer 4-component vector of float member1A, layout(column_major shared ) coherent buffer 4-component vector of float member2A})
0:? 'shv' (shared 4-component vector of float)
@ -354,7 +353,7 @@ ERROR: node is still EOpNull!
0:148 Sequence
0:148 Sequence
0:148 move second child to first child (temp float)
0:148 'result' (temp float)
0:148 'result' (noContraction temp float)
0:148 add (temp float)
0:148 component-wise multiply (temp float)
0:148 'e' (in float)
@ -363,7 +362,7 @@ ERROR: node is still EOpNull!
0:148 'g' (in float)
0:148 'h' (in float)
0:150 Branch: Return with expression
0:150 'result' (temp float)
0:150 'result' (noContraction temp float)
0:153 Function Definition: func3(f1;f1;f1; (global float)
0:153 Function Parameters:
0:153 'i' (in float)
@ -396,7 +395,7 @@ ERROR: node is still EOpNull!
0:161 'd' (in 4-component vector of float)
0:162 move second child to first child (temp 3-component vector of float)
0:162 vector swizzle (temp 3-component vector of float)
0:162 'v' (smooth out 4-component vector of float)
0:162 'v' (noContraction smooth out 4-component vector of float)
0:162 Sequence
0:162 Constant:
0:162 0 (const int)
@ -409,7 +408,7 @@ ERROR: node is still EOpNull!
0:162 's' (temp 3-component vector of float)
0:163 move second child to first child (temp float)
0:163 direct index (temp float)
0:163 'v' (smooth out 4-component vector of float)
0:163 'v' (noContraction smooth out 4-component vector of float)
0:163 Constant:
0:163 3 (const int)
0:163 add (temp float)
@ -433,7 +432,7 @@ ERROR: node is still EOpNull!
0:163 3 (const int)
0:164 move second child to first child (temp float)
0:164 direct index (temp float)
0:164 'v' (smooth out 4-component vector of float)
0:164 'v' (noContraction smooth out 4-component vector of float)
0:164 Constant:
0:164 0 (const int)
0:164 Function Call: func(f1;f1;f1;f1; (global float)
@ -455,7 +454,7 @@ ERROR: node is still EOpNull!
0:164 0 (const int)
0:166 move second child to first child (temp float)
0:166 direct index (temp float)
0:166 'v' (smooth out 4-component vector of float)
0:166 'v' (noContraction smooth out 4-component vector of float)
0:166 Constant:
0:166 0 (const int)
0:166 Function Call: func2(f1;f1;f1;f1; (global float)
@ -495,7 +494,7 @@ ERROR: node is still EOpNull!
0:167 Constant:
0:167 0 (const int)
0:167 direct index (temp float)
0:167 'v' (smooth out 4-component vector of float)
0:167 'v' (noContraction smooth out 4-component vector of float)
0:167 Constant:
0:167 0 (const int)
0:169 Function Call: funcA(I21; (global 4-component vector of float)
@ -586,13 +585,13 @@ ERROR: node is still EOpNull!
0:? 'anon@5' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
0:? 'ColorInv' (smooth out 3-component vector of float)
0:? 'Color4' (invariant centroid smooth out 3-component vector of float)
0:? 'position' (smooth out 4-component vector of float)
0:? 'position' (noContraction smooth out 4-component vector of float)
0:? 'Color5' (smooth out 3-component vector of float)
0:? 'a' (in 4-component vector of float)
0:? 'b' (in 4-component vector of float)
0:? 'c' (in 4-component vector of float)
0:? 'd' (in 4-component vector of float)
0:? 'v' (smooth out 4-component vector of float)
0:? 'v' (noContraction smooth out 4-component vector of float)
0:? 'anon@6' (layout(column_major shared ) coherent buffer block{layout(column_major shared ) readonly buffer 4-component vector of float member1, layout(column_major shared ) buffer 4-component vector of float member2})
0:? 'anon@7' (layout(column_major shared ) buffer block{layout(column_major shared ) coherent readonly buffer 4-component vector of float member1A, layout(column_major shared ) coherent buffer 4-component vector of float member2A})
0:? 'shv' (shared 4-component vector of float)

View File

@ -390,6 +390,7 @@ public:
{
precision = EpqNone;
invariant = false;
noContraction = false;
makeTemporary();
}
@ -429,7 +430,8 @@ public:
TStorageQualifier storage : 6;
TBuiltInVariable builtIn : 8;
TPrecisionQualifier precision : 3;
bool invariant : 1;
bool invariant : 1; // require canonical treatment for cross-shader invariance
bool noContraction: 1; // prevent contraction and reassociation, e.g., for 'precise' keyword, and expressions it affects
bool centroid : 1;
bool smooth : 1;
bool flat : 1;
@ -1479,6 +1481,8 @@ public:
if (qualifier.invariant)
p += snprintf(p, end - p, "invariant ");
if (qualifier.noContraction)
p += snprintf(p, end - p, "noContraction ");
if (qualifier.centroid)
p += snprintf(p, end - p, "centroid ");
if (qualifier.smooth)

View File

@ -2703,8 +2703,10 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
(profile == EEsProfile && version < 310))
&& ! extensionTurnedOn(E_GL_ARB_shading_language_420pack)) {
// non-function parameters
if (src.noContraction && (dst.invariant || dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone))
error(loc, "precise qualifier must appear first", "", "");
if (src.invariant && (dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone))
error(loc, "invariant qualifier must appear first", "", "");
error(loc, "invariant qualifier must appear before interpolation, storage, and precision qualifiers ", "", "");
else if (src.isInterpolation() && (dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone))
error(loc, "interpolation qualifiers must appear before storage and precision qualifiers", "", "");
else if (src.isAuxiliary() && (dst.storage != EvqTemporary || dst.precision != EpqNone))
@ -2713,6 +2715,8 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
error(loc, "precision qualifier must appear as last qualifier", "", "");
// function parameters
if (src.noContraction && (dst.storage == EvqConst || dst.storage == EvqIn || dst.storage == EvqOut))
error(loc, "precise qualifier must appear first", "", "");
if (src.storage == EvqConst && (dst.storage == EvqIn || dst.storage == EvqOut))
error(loc, "in/out must appear before const", "", "");
}
@ -2743,6 +2747,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
bool repeated = false;
#define MERGE_SINGLETON(field) repeated |= dst.field && src.field; dst.field |= src.field;
MERGE_SINGLETON(invariant);
MERGE_SINGLETON(noContraction);
MERGE_SINGLETON(centroid);
MERGE_SINGLETON(smooth);
MERGE_SINGLETON(flat);
@ -3448,6 +3453,7 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
oldType.getQualifier().centroid = newType.getQualifier().centroid;
oldType.getQualifier().sample = newType.getQualifier().sample;
oldType.getQualifier().invariant = newType.getQualifier().invariant;
oldType.getQualifier().noContraction = newType.getQualifier().noContraction;
oldType.getQualifier().smooth = newType.getQualifier().smooth;
oldType.getQualifier().flat = newType.getQualifier().flat;
oldType.getQualifier().nopersp = newType.getQualifier().nopersp;
@ -3534,7 +3540,9 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali
if (qualifier.hasLayout())
error(loc, "cannot use layout qualifiers on a function parameter", "", "");
if (qualifier.invariant)
error(loc, "cannot use invariant qualifier on a function parameter", "", "");
error(loc, "cannot use invariant qualifier on a function parameter", "", "");
if (qualifier.noContraction && qualifier.storage != EvqOut && qualifier.storage != EvqInOut)
warn(loc, "qualifier has no effect on non-output parameters", "precise", "");
paramCheckFix(loc, qualifier.storage, type);
}
@ -5560,7 +5568,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q
}
}
// Do all block-declaration checking regarding its qualifers.
// Do all block-declaration checking regarding its qualifiers.
void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier, bool instanceName)
{
// The 4.5 specification says:
@ -5760,6 +5768,10 @@ void TParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qua
error(loc, "cannot change qualification after use", "invariant", "");
symbol->getWritableType().getQualifier().invariant = true;
invariantCheck(loc, symbol->getType().getQualifier());
} else if (qualifier.noContraction) {
if (intermediate.inIoAccessed(identifier))
error(loc, "cannot change qualification after use", "precise", "");
symbol->getWritableType().getQualifier().noContraction = true;
} else if (qualifier.specConstant) {
symbol->getWritableType().getQualifier().makeSpecConstant();
if (qualifier.hasSpecConstantId())
@ -5774,6 +5786,7 @@ void TParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qua
addQualifierToExisting(loc, qualifier, *identifiers[i]);
}
// Make sure 'invariant' isn't being applied to a non-allowed object.
void TParseContext::invariantCheck(const TSourceLoc& loc, const TQualifier& qualifier)
{
if (! qualifier.invariant)

View File

@ -1086,7 +1086,10 @@ layout_qualifier_id
precise_qualifier
: PRECISE {
parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
parseContext.profileRequires($1.loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise");
$$.init($1.loc);
$$.qualifier.noContraction = true;
}
;

File diff suppressed because it is too large Load Diff

View File

@ -309,6 +309,12 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
writeTypeComparison = true;
}
// Precise...
if (! crossStage && symbol.getQualifier().noContraction != unitSymbol.getQualifier().noContraction) {
error(infoSink, "Presence of precise qualifier must match:");
writeTypeComparison = true;
}
// Auxiliary and interpolation...
if (symbol.getQualifier().centroid != unitSymbol.getQualifier().centroid ||
symbol.getQualifier().smooth != unitSymbol.getQualifier().smooth ||

View File

@ -1711,6 +1711,7 @@ void HlslParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, c
bool repeated = false;
#define MERGE_SINGLETON(field) repeated |= dst.field && src.field; dst.field |= src.field;
MERGE_SINGLETON(invariant);
MERGE_SINGLETON(noContraction);
MERGE_SINGLETON(centroid);
MERGE_SINGLETON(smooth);
MERGE_SINGLETON(flat);
@ -2016,6 +2017,7 @@ void HlslParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& n
oldType.getQualifier().centroid = newType.getQualifier().centroid;
oldType.getQualifier().sample = newType.getQualifier().sample;
oldType.getQualifier().invariant = newType.getQualifier().invariant;
oldType.getQualifier().noContraction = newType.getQualifier().noContraction;
oldType.getQualifier().smooth = newType.getQualifier().smooth;
oldType.getQualifier().flat = newType.getQualifier().flat;
oldType.getQualifier().nopersp = newType.getQualifier().nopersp;
@ -3380,6 +3382,14 @@ void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier
if (intermediate.inIoAccessed(identifier))
error(loc, "cannot change qualification after use", "invariant", "");
symbol->getWritableType().getQualifier().invariant = true;
} else if (qualifier.noContraction) {
if (intermediate.inIoAccessed(identifier))
error(loc, "cannot change qualification after use", "precise", "");
symbol->getWritableType().getQualifier().noContraction = true;
} else if (qualifier.specConstant) {
symbol->getWritableType().getQualifier().makeSpecConstant();
if (qualifier.hasSpecConstantId())
symbol->getWritableType().getQualifier().layoutSpecConstantId = qualifier.layoutSpecConstantId;
} else
warn(loc, "unknown requalification", "", "");
}