]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/invalid_swizzle.glsl
Recognize swizzles in GLSL
[libs/gl.git] / tests / glsl / invalid_swizzle.glsl
diff --git a/tests/glsl/invalid_swizzle.glsl b/tests/glsl/invalid_swizzle.glsl
new file mode 100644 (file)
index 0000000..4094ce5
--- /dev/null
@@ -0,0 +1,15 @@
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in vec2 texcoord;
+void main()
+{
+       vec2 bad_component = texcoord.xz;
+       vec4 mixed = position.xyba;
+       gl_Position = position.xyzwx.xyzw;
+}
+
+/* Expected error:
+<test>:6: Access to component 'z' which is not present in 'vec2'
+<test>:7: Flavour of swizzle component 'b' is inconsistent with 'x'
+<test>:8: Use of undeclared member 'xyzwx'
+*/