[Piglit] [PATCH] arb_shader_clock: add test that doesn't require advanced features
Ilia Mirkin
imirkin at alum.mit.edu
Sun Apr 9 17:02:52 UTC 2017
This is a simplified version of the compute-based tests, ensuring that
there's some basic functionality. Used for testing at least nv50.
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
.../execution/fs-clock2x32.shader_test | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 tests/spec/arb_shader_clock/execution/fs-clock2x32.shader_test
diff --git a/tests/spec/arb_shader_clock/execution/fs-clock2x32.shader_test b/tests/spec/arb_shader_clock/execution/fs-clock2x32.shader_test
new file mode 100644
index 0000000..ae4e931
--- /dev/null
+++ b/tests/spec/arb_shader_clock/execution/fs-clock2x32.shader_test
@@ -0,0 +1,40 @@
+[require]
+GL >= 3.1
+GLSL >= 1.40
+GL_ARB_shader_clock
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 140
+#extension GL_ARB_shader_clock: require
+
+out vec4 color;
+
+bool is_time_ordered(uvec2 a, uvec2 b) {
+ int diff = int(b.y - a.y);
+ if (diff > 0)
+ return true;
+ if (diff < 0)
+ return false;
+
+ diff = int(b.x - a.x);
+ if (diff > 0)
+ return true;
+ return false;
+}
+
+void main() {
+ uvec2 start_time = clock2x32ARB();
+
+ color = vec4(0, 1, 0, 1);
+
+ uvec2 late_time = clock2x32ARB();
+
+ if (!is_time_ordered(start_time, late_time))
+ color = vec4(1, 0, 0, 1);
+}
+
+[test]
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
--
2.10.2
More information about the Piglit
mailing list