]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/nested_member_access.glsl
Save possible outer reference when entering subscript
[libs/gl.git] / tests / glsl / nested_member_access.glsl
diff --git a/tests/glsl/nested_member_access.glsl b/tests/glsl/nested_member_access.glsl
new file mode 100644 (file)
index 0000000..60b3a49
--- /dev/null
@@ -0,0 +1,46 @@
+uniform Lighting
+{
+       vec3 light_color[4];
+};
+uniform Params
+{
+       int light_index;
+};
+
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+void main()
+{
+       gl_Position = position;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out vec4 frag_color;
+void main()
+{
+       frag_color = vec4(light_color[light_index], 1.0);
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+void main()
+{
+       gl_Position = position;
+}
+*/
+
+/* Expected output: fragment
+layout(binding=5) uniform Lighting
+{
+       vec3 light_color[4];
+};
+layout(binding=80) uniform Params
+{
+       int light_index;
+};
+layout(location=0) out vec4 frag_color;
+void main()
+{
+       frag_color = vec4(light_color[light_index], 1.0);
+}
+*/