]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/redundant_geometry_gl_position.glsl
Add a unit test framework and some tests for the GLSL compiler
[libs/gl.git] / tests / glsl / redundant_geometry_gl_position.glsl
diff --git a/tests/glsl/redundant_geometry_gl_position.glsl b/tests/glsl/redundant_geometry_gl_position.glsl
new file mode 100644 (file)
index 0000000..99d4330
--- /dev/null
@@ -0,0 +1,41 @@
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+void main()
+{
+       gl_Position = position;
+       gl_Position = position;
+}
+
+#pragma MSP stage(geometry)
+layout(triangles) in;
+layout(triangles, max_vertices=3) out;
+void main()
+{
+       for(int i=0; i<3; ++i)
+       {
+               passthrough[i];
+               gl_Position = gl_in[i].gl_Position;
+               EmitVertex();
+       }
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+void main()
+{
+       gl_Position = position;
+}
+*/
+
+/* Expected output: geometry
+layout(triangles) in;
+layout(triangles, max_vertices=3) out;
+void main()
+{
+       for(int i = 0; i<3; ++i)
+       {
+               gl_Position = gl_in[i].gl_Position;
+               EmitVertex();
+       }
+}
+*/