]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/invalid_constructors.glsl
Resolve and validate the parameters of constructors in GLSL
[libs/gl.git] / tests / glsl / invalid_constructors.glsl
1 #pragma MSP stage(vertex)
2 void main()
3 {
4         float f = float();
5         vec3 v = vec3(f, f);
6         vec3 u = vec3(v, 1.0);
7         vec3 w = vec3(v.xy, vec2(3.0, 4.0));
8         mat3 m = mat3(v, u);
9         mat3 m2 = mat3(v, v, u, u);
10         mat2 m3 = mat2(v, 1.0);
11 }
12
13 /* Expected error:
14 <test>:4: No matching constructor found for 'float()'
15 <test>:5: No matching constructor found for 'vec3(float, float)'
16 <test>:6: No matching constructor found for 'vec3(vec3, float)'
17 <test>:7: No matching constructor found for 'vec3(vec2, vec2)'
18 <test>:8: No matching constructor found for 'mat3(vec3, vec3)'
19 <test>:9: No matching constructor found for 'mat3(vec3, vec3, vec3, vec3)'
20 <test>:10: No matching constructor found for 'mat2(vec3, float)'
21 */