Implement 1.20 style function signature matching under implicit conversion. This was the last key unimplemented feature of versions 120 through 330.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23798 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -51,3 +51,62 @@ int[2][3] foo( // ERROR
|
||||
float[2][3] a, // ERROR
|
||||
float[2] b[3], // ERROR
|
||||
float c[2][3]); // ERROR
|
||||
|
||||
int overloadA(in float f);
|
||||
int overloadA(out float f); // ERROR, different qualifiers
|
||||
float overloadA(float); // ERROR, different return value for same signature
|
||||
float overloadA(out float f, int);
|
||||
float overloadA(int i);
|
||||
|
||||
vec2 overloadB(float, float);
|
||||
|
||||
vec2 overloadC(int, int);
|
||||
vec2 overloadC(int, float);
|
||||
vec2 overloadC(float, int);
|
||||
vec2 overloadC(vec2, vec2);
|
||||
|
||||
vec3 overloadD(int, float);
|
||||
vec3 overloadD(float, int);
|
||||
|
||||
vec3 overloadE(float[2]);
|
||||
vec3 overloadE(mat2 m);
|
||||
vec3 overloadE(vec2 v);
|
||||
|
||||
void foo()
|
||||
{
|
||||
float f;
|
||||
int i;
|
||||
|
||||
overloadB(f, f);
|
||||
overloadB(f, 2);
|
||||
overloadB(1, i);
|
||||
|
||||
overloadC(1, i);
|
||||
overloadC(vec2(1), vec2(2));
|
||||
overloadC(f, 3.0); // ERROR, no way
|
||||
overloadC(ivec2(1), vec2(2));
|
||||
|
||||
overloadD(i, f);
|
||||
overloadD(f, i);
|
||||
overloadD(i, i); // ERROR, ambiguous
|
||||
|
||||
int overloadB; // hiding
|
||||
overloadB(1, i); // ERROR
|
||||
|
||||
sin(1);
|
||||
texture2D(s2D, ivec2(0));
|
||||
clamp(attv4, 0, 1);
|
||||
clamp(ivec4(attv4), 0, 1);
|
||||
|
||||
int a[2];
|
||||
overloadC(a, 3); // ERROR
|
||||
overloadE(a); // ERROR
|
||||
overloadE(3.3); // ERROR
|
||||
overloadE(vec2(3.3));
|
||||
overloadE(mat2(0.5));
|
||||
overloadE(ivec4(1)); // ERROR
|
||||
overloadE(ivec2(1));
|
||||
|
||||
float b[2];
|
||||
overloadE(b);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
ERROR: 0:9: 'in for stage inputs' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:10: 'out for stage outputs' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:54: '+' : wrong operand types: no operation '+' exists that takes a left-hand operand of type '2-component vector of float' and a right operand of type '3-component vector of float' (or there is no acceptable conversion)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
ERROR: 0:3: 'in for stage inputs' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:4: 'out for stage outputs' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:11: 'gl_Position' : cannot add storage, auxiliary, memory, interpolation, or precision qualifier to an existing variable
|
||||
@@ -33,7 +32,15 @@ ERROR: 0:50: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:51: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:52: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 0:53: 'arrays of arrays' : not supported with this profile: none
|
||||
ERROR: 34 compilation errors. No code generated.
|
||||
ERROR: 0:56: 'out' : overloaded functions must have the same parameter qualifiers
|
||||
ERROR: 0:57: 'float' : overloaded functions must have the same return type
|
||||
ERROR: 0:86: 'overloadC' : no matching overloaded function found
|
||||
ERROR: 0:91: 'overloadD' : ambiguous function signature match: multiple signatures match under implicit type conversion
|
||||
ERROR: 0:102: 'overloadC' : no matching overloaded function found
|
||||
ERROR: 0:103: 'overloadE' : no matching overloaded function found
|
||||
ERROR: 0:104: 'overloadE' : no matching overloaded function found
|
||||
ERROR: 0:107: 'overloadE' : no matching overloaded function found
|
||||
ERROR: 42 compilation errors. No code generated.
|
||||
|
||||
ERROR: node is still EOpNull!
|
||||
0:15 Function Definition: main( (void)
|
||||
@@ -81,6 +88,97 @@ ERROR: node is still EOpNull!
|
||||
0:43 'gl_PointSize' (invariant gl_PointSize float)
|
||||
0:43 Constant:
|
||||
0:43 3.800000
|
||||
0:75 Function Definition: foo( (void)
|
||||
0:75 Function Parameters:
|
||||
0:? Sequence
|
||||
0:80 Function Call: overloadB(f1;f1; (2-component vector of float)
|
||||
0:80 'f' (float)
|
||||
0:80 'f' (float)
|
||||
0:81 Function Call: overloadB(f1;f1; (2-component vector of float)
|
||||
0:81 'f' (float)
|
||||
0:81 Constant:
|
||||
0:81 2 (const int)
|
||||
0:82 Function Call: overloadB(f1;f1; (2-component vector of float)
|
||||
0:82 Constant:
|
||||
0:82 1 (const int)
|
||||
0:82 'i' (int)
|
||||
0:84 Function Call: overloadC(i1;i1; (2-component vector of float)
|
||||
0:84 Constant:
|
||||
0:84 1 (const int)
|
||||
0:84 'i' (int)
|
||||
0:85 Function Call: overloadC(vf2;vf2; (2-component vector of float)
|
||||
0:85 Constant:
|
||||
0:85 1.000000
|
||||
0:85 1.000000
|
||||
0:85 Constant:
|
||||
0:85 2.000000
|
||||
0:85 2.000000
|
||||
0:86 Constant:
|
||||
0:86 0.000000
|
||||
0:87 Function Call: overloadC(vf2;vf2; (2-component vector of float)
|
||||
0:87 Constant:
|
||||
0:87 1 (const int)
|
||||
0:87 1 (const int)
|
||||
0:87 Constant:
|
||||
0:87 2.000000
|
||||
0:87 2.000000
|
||||
0:89 Function Call: overloadD(i1;f1; (3-component vector of float)
|
||||
0:89 'i' (int)
|
||||
0:89 'f' (float)
|
||||
0:90 Function Call: overloadD(f1;i1; (3-component vector of float)
|
||||
0:90 'f' (float)
|
||||
0:90 'i' (int)
|
||||
0:91 Function Call: overloadD(f1;i1; (3-component vector of float)
|
||||
0:91 'i' (int)
|
||||
0:91 'i' (int)
|
||||
0:94 Function Call: overloadB(f1;f1; (2-component vector of float)
|
||||
0:94 Constant:
|
||||
0:94 1 (const int)
|
||||
0:94 'i' (int)
|
||||
0:96 Constant:
|
||||
0:96 0.000000
|
||||
0:97 Function Call: texture2D(s21;vf2; (4-component vector of float)
|
||||
0:97 's2D' (uniform sampler2D)
|
||||
0:97 Constant:
|
||||
0:97 0 (const int)
|
||||
0:97 0 (const int)
|
||||
0:98 clamp (4-component vector of float)
|
||||
0:98 'attv4' (in 4-component vector of float)
|
||||
0:98 Constant:
|
||||
0:98 0 (const int)
|
||||
0:98 Constant:
|
||||
0:98 1 (const int)
|
||||
0:99 clamp (4-component vector of float)
|
||||
0:99 Convert float to int (4-component vector of int)
|
||||
0:99 'attv4' (in 4-component vector of float)
|
||||
0:99 Constant:
|
||||
0:99 0 (const int)
|
||||
0:99 Constant:
|
||||
0:99 1 (const int)
|
||||
0:102 Constant:
|
||||
0:102 0.000000
|
||||
0:103 Constant:
|
||||
0:103 0.000000
|
||||
0:104 Constant:
|
||||
0:104 0.000000
|
||||
0:105 Function Call: overloadE(vf2; (3-component vector of float)
|
||||
0:105 Constant:
|
||||
0:105 3.300000
|
||||
0:105 3.300000
|
||||
0:106 Function Call: overloadE(mf22; (3-component vector of float)
|
||||
0:106 Constant:
|
||||
0:106 0.500000
|
||||
0:106 0.000000
|
||||
0:106 0.000000
|
||||
0:106 0.500000
|
||||
0:107 Constant:
|
||||
0:107 0.000000
|
||||
0:108 Function Call: overloadE(vf2; (3-component vector of float)
|
||||
0:108 Constant:
|
||||
0:108 1 (const int)
|
||||
0:108 1 (const int)
|
||||
0:111 Function Call: overloadE(f1[2]; (3-component vector of float)
|
||||
0:111 'b' (2-element array of float)
|
||||
0:? Linker Objects
|
||||
0:? 'i' (in 4-component vector of float)
|
||||
0:? 'o' (smooth out 4-component vector of float)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:4 Function Definition: main( (void)
|
||||
0:4 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:4 Function Definition: main( (void)
|
||||
0:4 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:6 Function Definition: main( (void)
|
||||
0:6 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:5 Sequence
|
||||
0:5 move second child to first child (float)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:5 Sequence
|
||||
0:5 move second child to first child (float)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
ERROR: 0:77: '#error' : good1
|
||||
ERROR: 0:81: '#error' : good2
|
||||
ERROR: 0:85: '#error' : good3
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
ERROR: 0:19: 'vi4' : illegal use of type 'void'
|
||||
ERROR: 0:20: 'vj' : illegal use of type 'void'
|
||||
ERROR: 0:20: 'vk5' : illegal use of type 'void'
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:5 Sequence
|
||||
0:5 move second child to first child (4-component vector of float)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:4 Function Definition: main( (void)
|
||||
0:4 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:7 Function Definition: main( (void)
|
||||
0:7 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:19 Function Definition: main( (void)
|
||||
0:19 Function Parameters:
|
||||
|
||||
@@ -11,7 +11,6 @@ WARNING: #version: statement missing; use #version on first line of shader
|
||||
0:? Linker Objects
|
||||
|
||||
empty3.frag
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
|
||||
0:? Sequence
|
||||
0:? Linker Objects
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:10 Function Definition: main( (void)
|
||||
0:10 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:8 Function Definition: main( (void)
|
||||
0:8 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:11 Function Definition: main( (void)
|
||||
0:11 Function Parameters:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
mains1.frag
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
|
||||
0:? Sequence
|
||||
0:3 Function Definition: main( (void)
|
||||
@@ -7,7 +6,6 @@ Warning, version 110 is not yet complete; most features are present, but a few a
|
||||
0:? Linker Objects
|
||||
|
||||
mains2.frag
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
|
||||
0:? Sequence
|
||||
0:3 Function Definition: main( (void)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
ERROR: 0:10: 'constructor' : too many arguments
|
||||
ERROR: 0:7: 'const' : non-matching or non-convertible constant type for const initializer
|
||||
ERROR: 0:17: 'assign' : cannot convert from '2-component vector of float' to '3-component vector of float'
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:15 Function Definition: main( (void)
|
||||
0:15 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:38 Function Definition: main( (void)
|
||||
0:38 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:38 Function Definition: main( (void)
|
||||
0:38 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:9 Function Definition: main( (void)
|
||||
0:9 Function Parameters:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
ERROR: 0:9: 'vec5' : undeclared identifier
|
||||
ERROR: 0:9: '' : syntax error
|
||||
ERROR: 2 compilation errors. No code generated.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:13 Function Definition: main( (void)
|
||||
0:13 Function Parameters:
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
ERROR: #version: versions before 150 do not allow a profile token
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
ERROR: 0:38: 'attribute' : not supported in this stage: fragment
|
||||
ERROR: 0:40: 'sampler2DRect' : Reserved word.
|
||||
ERROR: 0:40: 'rectangle texture' : not supported for this version or the enabled extensions
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 120 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:7 Sequence
|
||||
0:7 move second child to first child (float)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
Warning, version 110 is not yet complete; most features are present, but a few are missing.
|
||||
0:? Sequence
|
||||
0:7 Function Definition: main( (void)
|
||||
0:7 Function Parameters:
|
||||
|
||||
Reference in New Issue
Block a user