summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-02-23 11:48:56 +1000
committerDave Airlie <airlied@redhat.com>2015-04-05 16:25:37 +1000
commit402f04b6f1e1cc5e43226aa431ce0cfd2fb81b47 (patch)
tree04f97aac8dfda331e34ac210db916e506a2bbf46
parente6beb2427d03f2b4ddb96dfa19a532bb03a20e2e (diff)
arb_vertex_attrib_64bit: pass a 64-bit vertex attrib through to frag shader
Check the double value unpacks cleanly in the fragment shader. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test
new file mode 100644
index 000000000..b5dc8a839
--- /dev/null
+++ b/tests/spec/arb_vertex_attrib_64bit/execution/vs-fs-pass-vertex-attrib.shader_test
@@ -0,0 +1,50 @@
+# test sending a double vertex attrib
+# through the pipeline unpacks correctly
+#
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader_fp64
+GL_ARB_vertex_attrib_64bit
+
+[vertex shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+#extension GL_ARB_vertex_attrib_64bit : require
+in dvec2 vertex;
+in double value;
+flat out double val_to_fs;
+void main()
+{
+ gl_Position = vec4(vertex, 0.0, 1.0);
+ val_to_fs = value;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_gpu_shader_fp64 : require
+flat in double val_to_fs;
+uniform uint expected1;
+uniform uint expected2;
+out vec4 color;
+
+void main()
+{
+ uvec2 unpck = unpackDouble2x32(val_to_fs);
+ if (unpck == uvec2(expected1, expected2))
+ color = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ color = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/double/2 value/double/1
+-1.0 -1.0 1.5
+ 1.0 -1.0 1.5
+ 1.0 1.0 1.5
+-1.0 1.0 1.5
+
+[test]
+uniform uint expected1 0
+uniform uint expected2 1073217536
+draw arrays GL_TRIANGLE_FAN 0 4
+probe rgba 0 0 0.0 1.0 0.0 1.0