[Piglit] [V3 2/4] ARB_explicit_uniform_location: test overlapping locations

Tapani Pälli tapani.palli at intel.com
Mon Mar 17 06:04:40 PDT 2014


This test tests overlapping uniform locations across shader stages.

v2: fix style issues (Anuj)
v3: change to be a shader-runner test (Ian)

Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 .../overlap-location-across-stages.shader_test     | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 tests/spec/arb_explicit_uniform_location/linker/overlap-location-across-stages.shader_test

diff --git a/tests/spec/arb_explicit_uniform_location/linker/overlap-location-across-stages.shader_test b/tests/spec/arb_explicit_uniform_location/linker/overlap-location-across-stages.shader_test
new file mode 100644
index 0000000..056ecfa
--- /dev/null
+++ b/tests/spec/arb_explicit_uniform_location/linker/overlap-location-across-stages.shader_test
@@ -0,0 +1,33 @@
+#
+# Tests overlapping uniform location among 2 shader stages, both shaders
+# define same explicit location. Note, this test does not include testing
+# for overlaps with unused uniform locations.
+#
+# The GL_ARB_explicit_uniform_location spec says:
+#     "No two default-block uniform variables in the program can have the same
+#     location, even if they are unused, otherwise a compiler or linker error
+#     will be generated"
+
+[require]
+GLSL >= 1.20
+GL_ARB_explicit_uniform_location
+
+[vertex shader]
+#extension GL_ARB_explicit_uniform_location: require
+layout(location = 42) uniform vec4 offset;
+vec4 vertex;
+void main()
+{
+  gl_Position = vertex + offset;
+}
+
+[fragment shader]
+#extension GL_ARB_explicit_uniform_location: require
+layout(location = 42) uniform vec4 color;
+void main()
+{
+  gl_FragColor = color;
+}
+
+[test]
+link error
-- 
1.8.3.1



More information about the Piglit mailing list