]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/passthrough_declaration_order.glsl
Limit GLSL passthrough statement to variables declared by that point
[libs/gl.git] / tests / glsl / passthrough_declaration_order.glsl
diff --git a/tests/glsl/passthrough_declaration_order.glsl b/tests/glsl/passthrough_declaration_order.glsl
new file mode 100644 (file)
index 0000000..52712d8
--- /dev/null
@@ -0,0 +1,41 @@
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+void process();
+void main()
+{
+       gl_Position = position;
+       passthrough;
+       process();
+}
+layout(location=1) in vec4 color;
+void process()
+{
+       passthrough;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out vec4 frag_color;
+void main()
+{
+       frag_color = color;
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+layout(location=1) in vec4 color;
+out vec4 _vs_out_color;
+void main()
+{
+       gl_Position = position;
+       _vs_out_color = color;
+}
+*/
+
+/* Expected output: fragment
+layout(location=0) out vec4 frag_color;
+in vec4 _vs_out_color;
+void main()
+{
+       frag_color = _vs_out_color;
+}
+*/