[Piglit] [PATCH 2/3] arb_shader_image_load_store: Add test for the GL 4.5 floating-point overload of imageAtomicExchange.

Francisco Jerez currojerez at riseup.net
Wed Aug 19 06:24:35 PDT 2015


The same built-in exists in GLES 3.1 with OES_shader_image_atomic and
in unextended GLES 3.2, but testing it in the ES API would require a
separate piglit test.  Passes on the i965 driver with the GL/GLSL
versions overridden appropriately with the usual environment
variables.
---
 .../gl45-imageAtomicExchange-float.shader_test     | 44 ++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 tests/spec/arb_shader_image_load_store/execution/gl45-imageAtomicExchange-float.shader_test

diff --git a/tests/spec/arb_shader_image_load_store/execution/gl45-imageAtomicExchange-float.shader_test b/tests/spec/arb_shader_image_load_store/execution/gl45-imageAtomicExchange-float.shader_test
new file mode 100644
index 0000000..8b176d0
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/execution/gl45-imageAtomicExchange-float.shader_test
@@ -0,0 +1,44 @@
+# Test the overload of imageAtomicExchange() with floating point
+# argument, which wasn't defined by the original
+# ARB_shader_image_load_store extension or by unextended desktop GL
+# until version 4.5.
+#
+[require]
+GL >= 4.5
+GLSL >= 4.5
+
+[vertex shader]
+#version 450
+in vec4 piglit_vertex;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 450
+
+layout(r32f, binding=0) uniform image2D img;
+uniform float v;
+out vec4 color;
+
+void main()
+{
+	color = vec4(imageAtomicExchange(img, ivec2(gl_FragCoord.xy), v));
+}
+
+[test]
+texture rgbw 0 (250, 250) GL_R32F
+image texture 0 GL_R32F
+
+uniform float v 0.5
+draw rect -1 -1 2 2
+
+relative probe rect rgb (0.0, 0.0, 0.5, 0.5) (1.0, 1.0, 1.0)
+relative probe rect rgb (0.0, 0.5, 0.5, 0.5) (0.0, 0.0, 0.0)
+relative probe rect rgb (0.5, 0.0, 0.5, 0.5) (0.0, 0.0, 0.0)
+relative probe rect rgb (0.5, 0.5, 0.5, 0.5) (1.0, 1.0, 1.0)
+
+fb tex 2d 0
+probe all rgb 0.5 0.0 0.0
-- 
2.4.6



More information about the Piglit mailing list