[Piglit] [PATCH 2/2] Add compiler tests for overlapping attribute locations
Anuj Phogat
anuj.phogat at gmail.com
Mon Mar 10 11:38:11 PDT 2014
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
.../compiler/overlapping-attrib-locations-1.vert | 28 ++++++++++++++++++++++
.../compiler/overlapping-attrib-locations-2.vert | 28 ++++++++++++++++++++++
2 files changed, 56 insertions(+)
create mode 100644 tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert
create mode 100644 tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert
diff --git a/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert
new file mode 100644
index 0000000..af3b8ae
--- /dev/null
+++ b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// check_link: true
+// [end config]
+//
+// Binding more than one attribute name to the same location is referred
+// to as aliasing. It is allowed only on vertex shader input variables
+// in OpenGL (2.0 and above). Check that vertex shader compiles and links
+// successfully in case of overlapping input attribute locations. This
+// shader uses attributes of same size with same locations.
+
+#version 110
+#extension GL_ARB_explicit_attrib_location : require
+
+layout(location=0) in vec4 p0;
+layout(location=0) in vec4 p1;
+uniform int x;
+
+void main()
+{
+ if (x == 0)
+ gl_Position = p0;
+ else if (x == 1)
+ gl_Position = p1;
+ else
+ gl_Position = vec4(0.0);
+}
diff --git a/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert
new file mode 100644
index 0000000..81af940
--- /dev/null
+++ b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.10
+// check_link: true
+// [end config]
+//
+// Binding more than one attribute name to the same location is referred
+// to as aliasing. It is allowed only on vertex shader input variables
+// in OpenGL (2.0 and above). Check that vertex shader compiles and links
+// successfully in case of overlapping input attribute locations. This
+// shader uses attributes of different sizes with overlapping locations.
+
+#version 110
+#extension GL_ARB_explicit_attrib_location : require
+
+layout(location=0) in mat4 mat;
+layout(location=3) in vec4 p;
+uniform int x;
+
+void main()
+{
+ if (x == 0)
+ gl_Position = mat * vec4(1.0);
+ else if (x == 1)
+ gl_Position = p;
+ else
+ gl_Position = vec4(0.0);
+}
--
1.8.3.1
More information about the Piglit
mailing list