[Piglit] [PATCH 3/4] arb_bindless_texture: add new explicit-image-binding.shader_test

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri May 19 12:52:50 UTC 2017


Similar to explicit-sampler-binding.shader_test but that one
exercices the explicit binding layout qualifier with
bound/bindless images.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 .../images/explicit-image-binding.shader_test      | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test

diff --git a/tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test b/tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test
new file mode 100644
index 000000000..d1be50c23
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/execution/images/explicit-image-binding.shader_test
@@ -0,0 +1,58 @@
+# In this test, perform an image store with a bound image, then create a
+# resident image and pass the handle through the OpenGL API.
+[require]
+GL >= 4.2
+GLSL >= 4.20
+GL_ARB_bindless_texture
+GL_ARB_shader_image_load_store
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 420
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+uniform vec4 color;
+layout (bindless_image, binding = 5) writeonly uniform image2D tex;
+out vec4 outcolor;
+
+void main()
+{
+	imageStore(tex, ivec2(gl_FragCoord.xy), color);
+	outcolor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+# Test with a bound image.
+# Texture 5 is the imageStore output.
+texture rgbw 5 (16, 16) GL_RGBA8
+image texture 5 GL_RGBA8
+
+# Texture 1 is the rendering output. We don't care about this.
+texture rgbw 1 (16, 16) GL_RGBA8
+
+# Store red using imageStore
+uniform vec4 color 1.0 0.0 0.0 1.0
+fb tex 2d 1
+draw rect -1 -1 2 2
+
+# Test the result of imageStore
+memory barrier GL_FRAMEBUFFER_BARRIER_BIT
+fb tex 2d 5
+probe all rgba 1.0 0.0 0.0 1.0
+
+# Test with a bindless image.
+texture rgbw 3 (16, 16) GL_RGBA8
+resident image texture 3 GL_RGBA8
+uniform handle tex 3
+
+# Store blue using imageStore
+uniform vec4 color 0.0 1.0 0.0 1.0
+fb tex 2d 1
+draw rect -1 -1 2 2
+
+# Test the result of imageStore
+memory barrier GL_FRAMEBUFFER_BARRIER_BIT
+fb tex 2d 3
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.13.0



More information about the Piglit mailing list