[Piglit] [RFC PATCH 5/5] arb_bindless_texture: add execution-related tests

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Mar 27 22:05:13 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 .../execution/basic-image.shader_test              | 52 ++++++++++++++++++++++
 .../execution/basic-texture.shader_test            | 26 +++++++++++
 .../execution/basic-vertex.shader_test             | 41 +++++++++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 tests/spec/arb_bindless_texture/execution/basic-image.shader_test
 create mode 100644 tests/spec/arb_bindless_texture/execution/basic-texture.shader_test
 create mode 100644 tests/spec/arb_bindless_texture/execution/basic-vertex.shader_test

diff --git a/tests/spec/arb_bindless_texture/execution/basic-image.shader_test b/tests/spec/arb_bindless_texture/execution/basic-image.shader_test
new file mode 100644
index 000000000..3f13861f1
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/execution/basic-image.shader_test
@@ -0,0 +1,52 @@
+# In this test, just perform an image store with a resident texture image.
+
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_bindless_texture
+GL_ARB_shader_image_load_store
+
+[vertex shader]
+#version 130
+in vec4 piglit_vertex;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+layout (bindless_image) uniform;
+
+uniform vec4 color;
+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]
+# Texture 0 is the imageStore output.
+texture rgbw 0 (16, 16) GL_RGBA8
+resident image texture 0 GL_RGBA8
+uniform handle tex 0
+
+# 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/basic-texture.shader_test b/tests/spec/arb_bindless_texture/execution/basic-texture.shader_test
new file mode 100644
index 000000000..4abab560f
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/execution/basic-texture.shader_test
@@ -0,0 +1,26 @@
+# In this test, just perform a texture lookup with a resident texture.
+
+[require]
+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;
+out vec4 finalColor;
+
+void main()
+{
+	finalColor = texture2D(tex, vec2(0, 0));
+}
+
+[test]
+texture rgbw 0 (16, 16)
+resident texture 0
+uniform handle tex 0
+draw rect -1 -1 2 2
+relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0)
diff --git a/tests/spec/arb_bindless_texture/execution/basic-vertex.shader_test b/tests/spec/arb_bindless_texture/execution/basic-vertex.shader_test
new file mode 100644
index 000000000..bb05a883b
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/execution/basic-vertex.shader_test
@@ -0,0 +1,41 @@
+# In this test, the sampler to use is selected in a vertex shader, passed
+# to the fragment shader as a (flat) input, and then used for a texture
+# lookup.
+
+[require]
+GLSL >= 3.30
+GL_ARB_bindless_texture
+
+[vertex shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+layout (bindless_sampler) uniform sampler2D tex;
+in vec4 piglit_vertex;
+
+flat out sampler2D sampler_vs;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+	sampler_vs = tex;
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+flat in sampler2D sampler_vs;
+out vec4 color;
+
+void main()
+{
+	color = texture2D(sampler_vs, vec2(0, 0));
+}
+
+[test]
+texture rgbw 0 (16, 16)
+resident texture 0
+uniform handle tex 0
+draw rect -1 -1 2 2
+relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0)
-- 
2.12.1



More information about the Piglit mailing list