]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/parameter_composite_access.glsl
Don't try to access parameters with a pointer access instructior
[libs/gl.git] / tests / glsl / parameter_composite_access.glsl
diff --git a/tests/glsl/parameter_composite_access.glsl b/tests/glsl/parameter_composite_access.glsl
new file mode 100644 (file)
index 0000000..718fffd
--- /dev/null
@@ -0,0 +1,60 @@
+uniform Colors
+{
+       vec4 top_color;
+       vec4 bottom_color;
+};
+
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in vec3 normal;
+void main()
+{
+       gl_Position = position;
+       passthrough;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out vec4 frag_color;
+vec4 get_color(vec3 n)
+{
+       if(n.z>=0)
+               return top_color;
+       else
+               return bottom_color;
+}
+void main()
+{
+       frag_color = get_color(normal);
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+layout(location=1) in vec3 normal;
+layout(location=0) out vec3 _vs_out_normal;
+void main()
+{
+       gl_Position = position;
+       _vs_out_normal = normal;
+}
+*/
+
+/* Expected output: fragment
+layout(binding=23) uniform Colors
+{
+       vec4 top_color;
+       vec4 bottom_color;
+};
+layout(location=0) out vec4 frag_color;
+vec4 get_color(vec3 n)
+{
+       if(n.z>=0.0)
+               return top_color;
+       else
+               return bottom_color;
+}
+layout(location=0) in vec3 _vs_out_normal;
+void main()
+{
+       frag_color = get_color(_vs_out_normal);
+}
+*/