From ffdb254d086da2b4234074490a8bfdc35678ae30 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Sun, 13 Dec 2015 14:02:26 +1100 Subject: 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. --- .../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 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 + -- cgit v1.2.3