summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2015-12-13 14:02:26 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2016-05-19 09:28:50 +1000
commitffdb254d086da2b4234074490a8bfdc35678ae30 (patch)
treea6ce541da20b2a6118ed265a4e99aa3d9e7cbeb4
parent11772379d09569f3d7b725f2f85cd288d0b44b11 (diff)
arb_enhanced_layouts: vertex shader input component layout qualifier test
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.
-rw-r--r--tests/spec/arb_enhanced_layouts/execution/component-layout/vs-attribs-array.shader_test57
1 files changed, 57 insertions, 0 deletions
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 000000000..9227a8f19
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-attribs-array.shader_test
@@ -0,0 +1,57 @@
+# This tests that explicit component packing
+# works correctly for vertex shader attribute arrays
+#
+[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
+