[Piglit] [PATCH] arb_enhanced_layouts: vertex shader input component layout qualifier test

Timothy Arceri timothy.arceri at collabora.com
Sat Dec 12 19:02:26 PST 2015


Test results:
Nvidia GeForce 840M - NVIDIA 352.41: fail

Using the component qualifier on a vertex input array seems to uncover a
nasty bug on the Nvidia driver. The explict location ends up getting changed
for some reason.
---
 .../component-layout/vs-attribs-array.shader_test  | 57 ++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/execution/component-layout/vs-attribs-array.shader_test

diff --git a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-attribs-array.shader_test b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-attribs-array.shader_test
new file mode 100644
index 0000000..24e8dd6
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-attribs-array.shader_test
@@ -0,0 +1,57 @@
+# this tests that using explicit attributes
+# that each dvec3/4 only takes up one location
+#
+[require]
+GLSL >= 1.50
+GL_ARB_enhanced_layouts
+GL_ARB_explicit_attrib_location
+
+[vertex shader]
+#extension GL_ARB_enhanced_layouts : require
+#extension GL_ARB_explicit_attrib_location : require
+
+uniform int index;
+
+layout(location = 0) in vec3 vertex;
+layout(location = 1, component = 1) in vec3 gba[3];
+layout(location = 1) in float red[3];
+out vec4 fscolor;
+void main()
+{
+        gl_Position = vec4(vertex, 1.0);
+	fscolor = vec4(red[index], gba[index]);
+}
+
+[fragment shader]
+#extension GL_ARB_enhanced_layouts : require
+
+in vec4 fscolor;
+out vec4 color;
+void main()
+{
+  color = fscolor;
+}
+
+[vertex data]
+vertex/float/3   gba/float/4      gba/float/4/1     gba/float/4/2
+-1.0 -1.0 0.0   1.0 1.0 1.0 1.0  0.0 1.0 1.0 1.0   0.0 0.0 1.0 1.0
+ 1.0 -1.0 0.0   1.0 1.0 1.0 1.0  0.0 1.0 1.0 1.0   0.0 0.0 1.0 1.0
+ 1.0  1.0 0.0   1.0 1.0 1.0 1.0  0.0 1.0 1.0 1.0   0.0 0.0 1.0 1.0
+-1.0  1.0 0.0   1.0 1.0 1.0 1.0  0.0 1.0 1.0 1.0   0.0 0.0 1.0 1.0
+
+[test]
+clear color 0.0 0.0 1.0 0.0
+clear
+
+uniform int index 0
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 1.0 1.0 1.0 1.0
+
+uniform int index 1
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 1.0 1.0
+
+uniform int index 2
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 0.0 1.0 1.0
+
-- 
2.4.3



More information about the Piglit mailing list