[Piglit] [PATCH 3/3] arb_vertex_attrib_64bit: pass a 64-bit vertex attrib through to frag shader

Dave Airlie airlied at gmail.com
Mon Feb 23 17:26:03 PST 2015


From: Dave Airlie <airlied at redhat.com>

Check the double value unpacks cleanly in the fragment shader.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 vs-fs-pass-vertex-attrib.shader_test | 50 ++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 vs-fs-pass-vertex-attrib.shader_test

diff --git a/vs-fs-pass-vertex-attrib.shader_test b/vs-fs-pass-vertex-attrib.shader_test
new file mode 100644
index 0000000..b5dc8a8
--- /dev/null
+++ b/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
-- 
1.9.3



More information about the Piglit mailing list