[Piglit] [PATCH v2 2/5] arb_bindless_texture: add some uvec2 arithmetic test

Karol Herbst kherbst at redhat.com
Thu Apr 12 10:58:16 UTC 2018


v2: add test for iamges as well

Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 .../basic-arithmetic-uvec2-imageStore.shader_test  | 50 ++++++++++++++++++++++
 .../basic-arithmetic-uvec2-texture2D.shader_test   | 37 ++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 tests/spec/arb_bindless_texture/execution/images/basic-arithmetic-uvec2-imageStore.shader_test
 create mode 100644 tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-uvec2-texture2D.shader_test

diff --git a/tests/spec/arb_bindless_texture/execution/images/basic-arithmetic-uvec2-imageStore.shader_test b/tests/spec/arb_bindless_texture/execution/images/basic-arithmetic-uvec2-imageStore.shader_test
new file mode 100644
index 000000000..d86299a48
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/execution/images/basic-arithmetic-uvec2-imageStore.shader_test
@@ -0,0 +1,50 @@
+# Same as basic-imageStore.shader_test, but with some math on the handle
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_bindless_texture
+GL_ARB_shader_image_load_store
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+uniform vec4 color;
+layout (bindless_image) writeonly uniform image2D tex;
+uniform uvec2 handleOffset;
+out vec4 outcolor;
+
+void main()
+{
+	uvec2 handle = uvec2(tex);
+	handle.x -= 0x12345678u;
+	handle.y -= 0x9abcdef0u;
+
+	image2D fixedTex = image2D(handle + handleOffset);
+
+	imageStore(fixedTex, ivec2(gl_FragCoord.xy), color);
+	outcolor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+# Texture 0 is the imageStore output.
+texture rgbw 0 (16, 16) GL_RGBA8
+resident image texture 0 GL_RGBA8
+uniform handle tex 0
+uniform uvec2 handleOffset 0x12345678 0x9abcdef0
+
+# 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 0
+probe all rgba 1.0 0.0 0.0 1.0
diff --git a/tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-uvec2-texture2D.shader_test b/tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-uvec2-texture2D.shader_test
new file mode 100644
index 000000000..4d644b044
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-uvec2-texture2D.shader_test
@@ -0,0 +1,37 @@
+# Same as basic-texture2D.shader_test, but with some math on the handle
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_bindless_texture
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+layout (bindless_sampler) uniform sampler2D tex;
+uniform uvec2 handleOffset;
+
+out vec4 finalColor;
+
+void main()
+{
+	sampler2D fixedTex;
+
+	uvec2 handle = uvec2(tex);
+	handle.x -= 0x12345678u;
+	handle.y -= 0x9abcdef0u;
+
+	fixedTex = sampler2D(handle + handleOffset);
+
+	finalColor = texture2D(fixedTex, vec2(0, 0));
+}
+
+[test]
+texture rgbw 0 (16, 16)
+resident texture 0
+uniform uvec2 handleOffset 0x12345678 0x9abcdef0
+uniform handle tex 0
+draw rect -1 -1 2 2
+relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0)
-- 
2.14.3



More information about the Piglit mailing list