]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/referenced_but_unassigned_output.glsl
Avoid removing outputs which are referenced but not assigned
[libs/gl.git] / tests / glsl / referenced_but_unassigned_output.glsl
diff --git a/tests/glsl/referenced_but_unassigned_output.glsl b/tests/glsl/referenced_but_unassigned_output.glsl
new file mode 100644 (file)
index 0000000..aabff08
--- /dev/null
@@ -0,0 +1,50 @@
+uniform mat4 projection;
+
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in vec3 normal;
+out vec4 eye_vertex;
+out VertexOut
+{
+       vec4 color;
+};
+void main()
+{
+       gl_Position = projection*eye_vertex;
+       out float alpha = color.a;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out vec4 frag_color;
+void main()
+{
+       frag_color = vec4(color.rgb, alpha);
+}
+
+/* Expected output: vertex
+uniform mat4 projection;
+out vec4 eye_vertex;
+out VertexOut
+{
+  vec4 color;
+};
+out float alpha;
+void main()
+{
+  gl_Position = projection*eye_vertex;
+  alpha = color.a;
+}
+*/
+
+/* Expected output: fragment
+layout(location=0) out vec4 frag_color;
+in VertexOut
+{
+  vec4 color;
+};
+in float alpha;
+void main()
+{
+  frag_color = vec4(color.rgb, alpha);
+}
+*/