Backward incompatible: Turn on PureOperatorBuiltins: use only enum-based built-in functions in the AST.

If this breaks your AST consumer, best is to modify it to test
against the enum values instead of doing string comparisons on
built-in function names.  This is the reason the change was made.

If you need the old behavior, you should be able to get it back by changing
PureOperatorBuiltins to be false instead of true.  This path will work for
a while, but is marked deprecated.

Also, the old behavior is tagged as release 2.4.
This commit is contained in:
John Kessenich
2015-08-19 13:34:18 -06:00
parent a32d8f620d
commit fc51d284aa
41 changed files with 1092 additions and 967 deletions

View File

@@ -6,6 +6,7 @@ ERROR: 0:31: 'sampler2D' : sampler/image types can only be used in uniform varia
ERROR: 0:32: 'uint' : cannot apply precision statement to this type; use 'float', 'int' or a sampler type
ERROR: 0:39: 'structure' : non-uniform struct contains a sampler or image: badout
ERROR: 0:60: 'texel offset' : argument must be compile-time constant
ERROR: 0:62: 'texel offset' : argument must be compile-time constant
ERROR: 0:63: 'texel offset' : argument must be compile-time constant
ERROR: 0:64: 'texel offset' : argument must be compile-time constant
ERROR: 0:66: 'texel offset' : argument must be compile-time constant
@@ -41,7 +42,7 @@ ERROR: 0:157: 'invariant' : can only apply to an output
ERROR: 0:158: 'invariant' : can only apply to an output
ERROR: 0:160: 'imageBuffer' : Reserved word.
ERROR: 0:160: '' : syntax error
ERROR: 42 compilation errors. No code generated.
ERROR: 43 compilation errors. No code generated.
Shader version: 300
@@ -52,37 +53,37 @@ ERROR: node is still EOpNull!
0:? Sequence
0:57 move second child to first child (temp lowp 4-component vector of float)
0:57 'v' (temp lowp 4-component vector of float)
0:57 Function Call: texture(s21;vf2; (global lowp 4-component vector of float)
0:57 texture (global lowp 4-component vector of float)
0:57 's2D' (uniform lowp sampler2D)
0:57 'c2D' (smooth in lowp 2-component vector of float)
0:58 move second child to first child (temp lowp 4-component vector of float)
0:58 'v' (temp lowp 4-component vector of float)
0:58 Function Call: textureProj(s31;vf4; (global lowp 4-component vector of float)
0:58 textureProj (global lowp 4-component vector of float)
0:58 's3D' (uniform lowp sampler3D)
0:58 'c4D' (smooth temp lowp 4-component vector of float)
0:59 move second child to first child (temp lowp 4-component vector of float)
0:59 'v' (temp lowp 4-component vector of float)
0:59 Function Call: textureLod(sA21;vf3;f1; (global lowp 4-component vector of float)
0:59 textureLod (global lowp 4-component vector of float)
0:59 's2DArray' (uniform lowp sampler2DArray)
0:59 'c3D' (smooth in lowp 3-component vector of float)
0:59 Constant:
0:59 1.200000
0:60 move second child to first child (temp lowp float)
0:60 'f' (temp lowp float)
0:60 Function Call: textureOffset(sS21;vf3;vi2;f1; (global lowp float)
0:60 textureOffset (global lowp float)
0:60 's2DShadow' (uniform lowp sampler2DShadow)
0:60 'c3D' (smooth in lowp 3-component vector of float)
0:60 'ic2D' (flat in mediump 2-component vector of int)
0:60 'c1D' (smooth in lowp float)
0:61 move second child to first child (temp lowp 4-component vector of float)
0:61 'v' (temp lowp 4-component vector of float)
0:61 Function Call: texelFetch(s31;vi3;i1; (global lowp 4-component vector of float)
0:61 textureFetch (global lowp 4-component vector of float)
0:61 's3D' (uniform lowp sampler3D)
0:61 'ic3D' (flat in mediump 3-component vector of int)
0:61 'ic1D' (flat in mediump int)
0:62 move second child to first child (temp lowp 4-component vector of float)
0:62 'v' (temp lowp 4-component vector of float)
0:62 Function Call: texelFetchOffset(s21;vi2;i1;vi2; (global lowp 4-component vector of float)
0:62 textureFetchOffset (global lowp 4-component vector of float)
0:62 direct index (temp lowp sampler2D)
0:62 'arrayedSampler' (uniform 5-element array of lowp sampler2D)
0:62 Constant:
@@ -93,28 +94,28 @@ ERROR: node is still EOpNull!
0:62 'ic2D' (flat in mediump 2-component vector of int)
0:63 move second child to first child (temp lowp float)
0:63 'f' (temp lowp float)
0:63 Function Call: textureLodOffset(sS21;vf3;f1;vi2; (global lowp float)
0:63 textureLodOffset (global lowp float)
0:63 's2DShadow' (uniform lowp sampler2DShadow)
0:63 'c3D' (smooth in lowp 3-component vector of float)
0:63 'c1D' (smooth in lowp float)
0:63 'ic2D' (flat in mediump 2-component vector of int)
0:64 move second child to first child (temp lowp 4-component vector of float)
0:64 'v' (temp lowp 4-component vector of float)
0:64 Function Call: textureProjLodOffset(s21;vf3;f1;vi2; (global lowp 4-component vector of float)
0:64 textureProjLodOffset (global lowp 4-component vector of float)
0:64 's2D' (uniform lowp sampler2D)
0:64 'c3D' (smooth in lowp 3-component vector of float)
0:64 'c1D' (smooth in lowp float)
0:64 'ic2D' (flat in mediump 2-component vector of int)
0:65 move second child to first child (temp lowp 4-component vector of float)
0:65 'v' (temp lowp 4-component vector of float)
0:65 Function Call: textureGrad(sC1;vf3;vf3;vf3; (global lowp 4-component vector of float)
0:65 textureGrad (global lowp 4-component vector of float)
0:65 'sCube' (uniform lowp samplerCube)
0:65 'c3D' (smooth in lowp 3-component vector of float)
0:65 'c3D' (smooth in lowp 3-component vector of float)
0:65 'c3D' (smooth in lowp 3-component vector of float)
0:66 move second child to first child (temp lowp float)
0:66 'f' (temp lowp float)
0:66 Function Call: textureGradOffset(sAS21;vf4;vf2;vf2;vi2; (global lowp float)
0:66 textureGradOffset (global lowp float)
0:66 's2DArrayShadow' (uniform lowp sampler2DArrayShadow)
0:66 'c4D' (smooth temp lowp 4-component vector of float)
0:66 'c2D' (smooth in lowp 2-component vector of float)
@@ -122,14 +123,14 @@ ERROR: node is still EOpNull!
0:66 'ic2D' (flat in mediump 2-component vector of int)
0:67 move second child to first child (temp lowp 4-component vector of float)
0:67 'v' (temp lowp 4-component vector of float)
0:67 Function Call: textureProjGrad(s31;vf4;vf3;vf3; (global lowp 4-component vector of float)
0:67 textureProjGrad (global lowp 4-component vector of float)
0:67 's3D' (uniform lowp sampler3D)
0:67 'c4D' (smooth temp lowp 4-component vector of float)
0:67 'c3D' (smooth in lowp 3-component vector of float)
0:67 'c3D' (smooth in lowp 3-component vector of float)
0:68 move second child to first child (temp lowp 4-component vector of float)
0:68 'v' (temp lowp 4-component vector of float)
0:68 Function Call: textureProjGradOffset(s21;vf3;vf2;vf2;vi2; (global lowp 4-component vector of float)
0:68 textureProjGradOffset (global lowp 4-component vector of float)
0:68 's2D' (uniform lowp sampler2D)
0:68 'c3D' (smooth in lowp 3-component vector of float)
0:68 'c2D' (smooth in lowp 2-component vector of float)
@@ -137,51 +138,51 @@ ERROR: node is still EOpNull!
0:68 'ic2D' (flat in mediump 2-component vector of int)
0:69 move second child to first child (temp lowp 4-component vector of float)
0:69 'v' (temp lowp 4-component vector of float)
0:69 Function Call: texture(s21;vf2; (global lowp 4-component vector of float)
0:69 texture (global lowp 4-component vector of float)
0:69 indirect index (temp lowp sampler2D)
0:69 'arrayedSampler' (uniform 5-element array of lowp sampler2D)
0:69 'ic1D' (flat in mediump int)
0:69 'c2D' (smooth in lowp 2-component vector of float)
0:72 move second child to first child (temp mediump 4-component vector of int)
0:72 'iv' (temp mediump 4-component vector of int)
0:72 Function Call: texture(is21;vf2; (global mediump 4-component vector of int)
0:72 texture (global mediump 4-component vector of int)
0:72 'is2D' (uniform lowp isampler2D)
0:72 'c2D' (smooth in lowp 2-component vector of float)
0:73 move second child to first child (temp mediump 4-component vector of int)
0:73 'iv' (temp mediump 4-component vector of int)
0:73 Function Call: textureProjOffset(is21;vf4;vi2; (global mediump 4-component vector of int)
0:73 textureProjOffset (global mediump 4-component vector of int)
0:73 'is2D' (uniform lowp isampler2D)
0:73 'c4D' (smooth temp lowp 4-component vector of float)
0:73 'ic2D' (flat in mediump 2-component vector of int)
0:74 move second child to first child (temp mediump 4-component vector of int)
0:74 'iv' (temp mediump 4-component vector of int)
0:74 Function Call: textureProjLod(is21;vf3;f1; (global mediump 4-component vector of int)
0:74 textureProjLod (global mediump 4-component vector of int)
0:74 'is2D' (uniform lowp isampler2D)
0:74 'c3D' (smooth in lowp 3-component vector of float)
0:74 'c1D' (smooth in lowp float)
0:75 move second child to first child (temp mediump 4-component vector of int)
0:75 'iv' (temp mediump 4-component vector of int)
0:75 Function Call: textureProjGrad(is21;vf3;vf2;vf2; (global mediump 4-component vector of int)
0:75 textureProjGrad (global mediump 4-component vector of int)
0:75 'is2D' (uniform lowp isampler2D)
0:75 'c3D' (smooth in lowp 3-component vector of float)
0:75 'c2D' (smooth in lowp 2-component vector of float)
0:75 'c2D' (smooth in lowp 2-component vector of float)
0:76 move second child to first child (temp mediump 4-component vector of int)
0:76 'iv' (temp mediump 4-component vector of int)
0:76 Function Call: texture(is31;vf3;f1; (global mediump 4-component vector of int)
0:76 texture (global mediump 4-component vector of int)
0:76 'is3D' (uniform lowp isampler3D)
0:76 'c3D' (smooth in lowp 3-component vector of float)
0:76 Constant:
0:76 4.200000
0:77 move second child to first child (temp mediump 4-component vector of int)
0:77 'iv' (temp mediump 4-component vector of int)
0:77 Function Call: textureLod(isC1;vf3;f1; (global mediump 4-component vector of int)
0:77 textureLod (global mediump 4-component vector of int)
0:77 'isCube' (uniform lowp isamplerCube)
0:77 'c3D' (smooth in lowp 3-component vector of float)
0:77 'c1D' (smooth in lowp float)
0:78 move second child to first child (temp mediump 4-component vector of int)
0:78 'iv' (temp mediump 4-component vector of int)
0:78 Function Call: texelFetch(isA21;vi3;i1; (global mediump 4-component vector of int)
0:78 textureFetch (global mediump 4-component vector of int)
0:78 'is2DArray' (uniform lowp isampler2DArray)
0:78 'ic3D' (flat in mediump 3-component vector of int)
0:78 'ic1D' (flat in mediump int)
@@ -193,7 +194,7 @@ ERROR: node is still EOpNull!
0:80 0 (const int)
0:80 Constant:
0:80 1 (const int)
0:80 Function Call: textureSize(sSC1;i1; (global highp 2-component vector of int)
0:80 textureSize (global highp 2-component vector of int)
0:80 'sCubeShadow' (uniform lowp samplerCubeShadow)
0:80 Constant:
0:80 2 (const int)
@@ -274,14 +275,14 @@ ERROR: node is still EOpNull!
0:126 Function Definition: foo23( (global void)
0:126 Function Parameters:
0:128 Sequence
0:128 Function Call: textureOffset(sS21;vf3;vi2;f1; (global lowp float)
0:128 textureOffset (global lowp float)
0:128 's2DShadow' (uniform lowp sampler2DShadow)
0:128 'c3D' (smooth in lowp 3-component vector of float)
0:128 Constant:
0:128 -8 (const int)
0:128 7 (const int)
0:128 'c1D' (smooth in lowp float)
0:129 Function Call: textureOffset(sS21;vf3;vi2;f1; (global lowp float)
0:129 textureOffset (global lowp float)
0:129 's2DShadow' (uniform lowp sampler2DShadow)
0:129 'c3D' (smooth in lowp 3-component vector of float)
0:129 Constant:
@@ -408,37 +409,37 @@ ERROR: node is still EOpNull!
0:? Sequence
0:57 move second child to first child (temp lowp 4-component vector of float)
0:57 'v' (temp lowp 4-component vector of float)
0:57 Function Call: texture(s21;vf2; (global lowp 4-component vector of float)
0:57 texture (global lowp 4-component vector of float)
0:57 's2D' (uniform lowp sampler2D)
0:57 'c2D' (smooth in lowp 2-component vector of float)
0:58 move second child to first child (temp lowp 4-component vector of float)
0:58 'v' (temp lowp 4-component vector of float)
0:58 Function Call: textureProj(s31;vf4; (global lowp 4-component vector of float)
0:58 textureProj (global lowp 4-component vector of float)
0:58 's3D' (uniform lowp sampler3D)
0:58 'c4D' (smooth temp lowp 4-component vector of float)
0:59 move second child to first child (temp lowp 4-component vector of float)
0:59 'v' (temp lowp 4-component vector of float)
0:59 Function Call: textureLod(sA21;vf3;f1; (global lowp 4-component vector of float)
0:59 textureLod (global lowp 4-component vector of float)
0:59 's2DArray' (uniform lowp sampler2DArray)
0:59 'c3D' (smooth in lowp 3-component vector of float)
0:59 Constant:
0:59 1.200000
0:60 move second child to first child (temp lowp float)
0:60 'f' (temp lowp float)
0:60 Function Call: textureOffset(sS21;vf3;vi2;f1; (global lowp float)
0:60 textureOffset (global lowp float)
0:60 's2DShadow' (uniform lowp sampler2DShadow)
0:60 'c3D' (smooth in lowp 3-component vector of float)
0:60 'ic2D' (flat in mediump 2-component vector of int)
0:60 'c1D' (smooth in lowp float)
0:61 move second child to first child (temp lowp 4-component vector of float)
0:61 'v' (temp lowp 4-component vector of float)
0:61 Function Call: texelFetch(s31;vi3;i1; (global lowp 4-component vector of float)
0:61 textureFetch (global lowp 4-component vector of float)
0:61 's3D' (uniform lowp sampler3D)
0:61 'ic3D' (flat in mediump 3-component vector of int)
0:61 'ic1D' (flat in mediump int)
0:62 move second child to first child (temp lowp 4-component vector of float)
0:62 'v' (temp lowp 4-component vector of float)
0:62 Function Call: texelFetchOffset(s21;vi2;i1;vi2; (global lowp 4-component vector of float)
0:62 textureFetchOffset (global lowp 4-component vector of float)
0:62 direct index (temp lowp sampler2D)
0:62 'arrayedSampler' (uniform 5-element array of lowp sampler2D)
0:62 Constant:
@@ -449,28 +450,28 @@ ERROR: node is still EOpNull!
0:62 'ic2D' (flat in mediump 2-component vector of int)
0:63 move second child to first child (temp lowp float)
0:63 'f' (temp lowp float)
0:63 Function Call: textureLodOffset(sS21;vf3;f1;vi2; (global lowp float)
0:63 textureLodOffset (global lowp float)
0:63 's2DShadow' (uniform lowp sampler2DShadow)
0:63 'c3D' (smooth in lowp 3-component vector of float)
0:63 'c1D' (smooth in lowp float)
0:63 'ic2D' (flat in mediump 2-component vector of int)
0:64 move second child to first child (temp lowp 4-component vector of float)
0:64 'v' (temp lowp 4-component vector of float)
0:64 Function Call: textureProjLodOffset(s21;vf3;f1;vi2; (global lowp 4-component vector of float)
0:64 textureProjLodOffset (global lowp 4-component vector of float)
0:64 's2D' (uniform lowp sampler2D)
0:64 'c3D' (smooth in lowp 3-component vector of float)
0:64 'c1D' (smooth in lowp float)
0:64 'ic2D' (flat in mediump 2-component vector of int)
0:65 move second child to first child (temp lowp 4-component vector of float)
0:65 'v' (temp lowp 4-component vector of float)
0:65 Function Call: textureGrad(sC1;vf3;vf3;vf3; (global lowp 4-component vector of float)
0:65 textureGrad (global lowp 4-component vector of float)
0:65 'sCube' (uniform lowp samplerCube)
0:65 'c3D' (smooth in lowp 3-component vector of float)
0:65 'c3D' (smooth in lowp 3-component vector of float)
0:65 'c3D' (smooth in lowp 3-component vector of float)
0:66 move second child to first child (temp lowp float)
0:66 'f' (temp lowp float)
0:66 Function Call: textureGradOffset(sAS21;vf4;vf2;vf2;vi2; (global lowp float)
0:66 textureGradOffset (global lowp float)
0:66 's2DArrayShadow' (uniform lowp sampler2DArrayShadow)
0:66 'c4D' (smooth temp lowp 4-component vector of float)
0:66 'c2D' (smooth in lowp 2-component vector of float)
@@ -478,14 +479,14 @@ ERROR: node is still EOpNull!
0:66 'ic2D' (flat in mediump 2-component vector of int)
0:67 move second child to first child (temp lowp 4-component vector of float)
0:67 'v' (temp lowp 4-component vector of float)
0:67 Function Call: textureProjGrad(s31;vf4;vf3;vf3; (global lowp 4-component vector of float)
0:67 textureProjGrad (global lowp 4-component vector of float)
0:67 's3D' (uniform lowp sampler3D)
0:67 'c4D' (smooth temp lowp 4-component vector of float)
0:67 'c3D' (smooth in lowp 3-component vector of float)
0:67 'c3D' (smooth in lowp 3-component vector of float)
0:68 move second child to first child (temp lowp 4-component vector of float)
0:68 'v' (temp lowp 4-component vector of float)
0:68 Function Call: textureProjGradOffset(s21;vf3;vf2;vf2;vi2; (global lowp 4-component vector of float)
0:68 textureProjGradOffset (global lowp 4-component vector of float)
0:68 's2D' (uniform lowp sampler2D)
0:68 'c3D' (smooth in lowp 3-component vector of float)
0:68 'c2D' (smooth in lowp 2-component vector of float)
@@ -493,51 +494,51 @@ ERROR: node is still EOpNull!
0:68 'ic2D' (flat in mediump 2-component vector of int)
0:69 move second child to first child (temp lowp 4-component vector of float)
0:69 'v' (temp lowp 4-component vector of float)
0:69 Function Call: texture(s21;vf2; (global lowp 4-component vector of float)
0:69 texture (global lowp 4-component vector of float)
0:69 indirect index (temp lowp sampler2D)
0:69 'arrayedSampler' (uniform 5-element array of lowp sampler2D)
0:69 'ic1D' (flat in mediump int)
0:69 'c2D' (smooth in lowp 2-component vector of float)
0:72 move second child to first child (temp mediump 4-component vector of int)
0:72 'iv' (temp mediump 4-component vector of int)
0:72 Function Call: texture(is21;vf2; (global mediump 4-component vector of int)
0:72 texture (global mediump 4-component vector of int)
0:72 'is2D' (uniform lowp isampler2D)
0:72 'c2D' (smooth in lowp 2-component vector of float)
0:73 move second child to first child (temp mediump 4-component vector of int)
0:73 'iv' (temp mediump 4-component vector of int)
0:73 Function Call: textureProjOffset(is21;vf4;vi2; (global mediump 4-component vector of int)
0:73 textureProjOffset (global mediump 4-component vector of int)
0:73 'is2D' (uniform lowp isampler2D)
0:73 'c4D' (smooth temp lowp 4-component vector of float)
0:73 'ic2D' (flat in mediump 2-component vector of int)
0:74 move second child to first child (temp mediump 4-component vector of int)
0:74 'iv' (temp mediump 4-component vector of int)
0:74 Function Call: textureProjLod(is21;vf3;f1; (global mediump 4-component vector of int)
0:74 textureProjLod (global mediump 4-component vector of int)
0:74 'is2D' (uniform lowp isampler2D)
0:74 'c3D' (smooth in lowp 3-component vector of float)
0:74 'c1D' (smooth in lowp float)
0:75 move second child to first child (temp mediump 4-component vector of int)
0:75 'iv' (temp mediump 4-component vector of int)
0:75 Function Call: textureProjGrad(is21;vf3;vf2;vf2; (global mediump 4-component vector of int)
0:75 textureProjGrad (global mediump 4-component vector of int)
0:75 'is2D' (uniform lowp isampler2D)
0:75 'c3D' (smooth in lowp 3-component vector of float)
0:75 'c2D' (smooth in lowp 2-component vector of float)
0:75 'c2D' (smooth in lowp 2-component vector of float)
0:76 move second child to first child (temp mediump 4-component vector of int)
0:76 'iv' (temp mediump 4-component vector of int)
0:76 Function Call: texture(is31;vf3;f1; (global mediump 4-component vector of int)
0:76 texture (global mediump 4-component vector of int)
0:76 'is3D' (uniform lowp isampler3D)
0:76 'c3D' (smooth in lowp 3-component vector of float)
0:76 Constant:
0:76 4.200000
0:77 move second child to first child (temp mediump 4-component vector of int)
0:77 'iv' (temp mediump 4-component vector of int)
0:77 Function Call: textureLod(isC1;vf3;f1; (global mediump 4-component vector of int)
0:77 textureLod (global mediump 4-component vector of int)
0:77 'isCube' (uniform lowp isamplerCube)
0:77 'c3D' (smooth in lowp 3-component vector of float)
0:77 'c1D' (smooth in lowp float)
0:78 move second child to first child (temp mediump 4-component vector of int)
0:78 'iv' (temp mediump 4-component vector of int)
0:78 Function Call: texelFetch(isA21;vi3;i1; (global mediump 4-component vector of int)
0:78 textureFetch (global mediump 4-component vector of int)
0:78 'is2DArray' (uniform lowp isampler2DArray)
0:78 'ic3D' (flat in mediump 3-component vector of int)
0:78 'ic1D' (flat in mediump int)
@@ -549,7 +550,7 @@ ERROR: node is still EOpNull!
0:80 0 (const int)
0:80 Constant:
0:80 1 (const int)
0:80 Function Call: textureSize(sSC1;i1; (global highp 2-component vector of int)
0:80 textureSize (global highp 2-component vector of int)
0:80 'sCubeShadow' (uniform lowp samplerCubeShadow)
0:80 Constant:
0:80 2 (const int)
@@ -630,14 +631,14 @@ ERROR: node is still EOpNull!
0:126 Function Definition: foo23( (global void)
0:126 Function Parameters:
0:128 Sequence
0:128 Function Call: textureOffset(sS21;vf3;vi2;f1; (global lowp float)
0:128 textureOffset (global lowp float)
0:128 's2DShadow' (uniform lowp sampler2DShadow)
0:128 'c3D' (smooth in lowp 3-component vector of float)
0:128 Constant:
0:128 -8 (const int)
0:128 7 (const int)
0:128 'c1D' (smooth in lowp float)
0:129 Function Call: textureOffset(sS21;vf3;vi2;f1; (global lowp float)
0:129 textureOffset (global lowp float)
0:129 's2DShadow' (uniform lowp sampler2DShadow)
0:129 'c3D' (smooth in lowp 3-component vector of float)
0:129 Constant: