[Piglit] [PATCH 2/2] arb_compute_shader: test the texture border color

Marek Olšák maraeo at gmail.com
Tue Oct 4 23:52:23 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

This fails with radeonsi at the moment.
---
 .../execution/border-color.shader_test             | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 tests/spec/arb_compute_shader/execution/border-color.shader_test

diff --git a/tests/spec/arb_compute_shader/execution/border-color.shader_test b/tests/spec/arb_compute_shader/execution/border-color.shader_test
new file mode 100644
index 0000000..601701c
--- /dev/null
+++ b/tests/spec/arb_compute_shader/execution/border-color.shader_test
@@ -0,0 +1,36 @@
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_compute_shader
+GL_ARB_shader_atomic_counters
+
+[compute shader]
+#version 330
+#extension GL_ARB_compute_shader: enable
+#extension GL_ARB_shader_atomic_counters: require
+
+layout(binding = 0) uniform atomic_uint r;
+uniform sampler2D tex;
+
+layout(local_size_x = 1, local_size_y = 1) in;
+
+void main()
+{
+    vec4 diff = abs(texture(tex, vec2(2, 2)) - vec4(0.1, 0.2, 0.3, 0.4));
+
+    if (all(lessThan(diff, vec4(1 / 255.0))))
+        atomicCounterIncrement(r);
+}
+
+[test]
+# Setup tex image
+texture rgbw 0 (64, 64)
+texparameter 2D wrap_s clamp_to_border
+texparameter 2D wrap_t clamp_to_border
+texparameter 2D border_color 0.1 0.2 0.3 0.4
+uniform int tex 0
+
+atomic counters 4
+
+compute 1 1 1
+probe atomic counter 0 == 1
-- 
2.7.4



More information about the Piglit mailing list