[8/8] arb_arrays_of_arrays: basic image store execution tests

Message ID 1434802475-4020-8-git-send-email-t_arceri@yahoo.com.au
State New
Headers show

Commit Message

'Timothy Arceri' via Patchwork Forward June 20, 2015, 12:14 p.m.
Test results:

Nvidia GeForce 840M - NVIDIA 346.47

basic-imageStore-const-uniform-index.shader_test - pass
basic-imageStore-non-const-uniform-index.shader_test - pass
---
 ...asic-imageStore-const-uniform-index.shader_test |  58 ++++++++++++
 ...-imageStore-non-const-uniform-index.shader_test | 101 +++++++++++++++++++++
 2 files changed, 159 insertions(+)
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test
new file mode 100644
index 0000000..0009f86
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-const-uniform-index.shader_test
@@ -0,0 +1,58 @@ 
+# Verify simple reading of a uniform and output to an image
+
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_shader_image_load_store
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 130
+in vec4 piglit_vertex;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+#extension GL_ARB_arrays_of_arrays: require
+
+uniform vec4 color;
+writeonly uniform image2D tex[2][2];
+out vec4 outcolor;
+
+void main()
+{
+	imageStore(tex[1][0], ivec2(gl_FragCoord.xy), color);
+	outcolor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+# Texture 0 is the imageStore output.
+uniform int tex[1][0] 0
+texture rgbw 0 (16, 16)
+image texture 0
+
+# Texture 1 is the rendering output. We don't care about this.
+texture rgbw 1 (16, 16)
+
+# 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
+fb tex 2d 0
+probe all rgba 1.0 0.0 0.0 1.0
+
+# Store green 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
+fb tex 2d 0
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test
new file mode 100644
index 0000000..f5271e6
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-non-const-uniform-index.shader_test
@@ -0,0 +1,101 @@ 
+# Verify simple reading of a uniform and output to an image
+
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_shader_image_load_store
+GL_ARB_arrays_of_arrays
+
+[vertex shader]
+#version 130
+in vec4 piglit_vertex;
+
+void main()
+{
+	gl_Position = piglit_vertex;
+}
+
+[fragment shader]
+#version 330
+#extension GL_ARB_shader_image_load_store: enable
+#extension GL_ARB_arrays_of_arrays: require
+
+uniform vec4 color;
+uniform int n;
+uniform int m;
+writeonly uniform image2D tex[2][2];
+out vec4 outcolor;
+
+void main()
+{
+	imageStore(tex[n][m], ivec2(gl_FragCoord.xy), color);
+	outcolor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+# Texture 0 is the imageStore output.
+uniform int tex[0][0] 0
+texture rgbw 0 (16, 16)
+image texture 0
+
+# Texture 1 is the imageStore output.
+uniform int tex[0][1] 1
+texture rgbw 1 (16, 16)
+image texture 1
+
+# Texture 2 is the imageStore output.
+uniform int tex[1][0] 2
+texture rgbw 2 (16, 16)
+image texture 2
+
+# Texture 3 is the imageStore output.
+uniform int tex[1][1] 3
+texture rgbw 3 (16, 16)
+image texture 3
+
+# Texture 4 is the rendering output. We don't care about this.
+texture rgbw 4 (16, 16)
+
+# Store red using imageStore
+uniform int n 0
+uniform int m 0
+uniform vec4 color 1.0 0.0 0.0 1.0
+fb tex 2d 4
+draw rect -1 -1 2 2
+
+# Test the result of imageStore 0
+fb tex 2d 0
+probe all rgba 1.0 0.0 0.0 1.0
+
+# Store green using imageStore
+uniform int n 0
+uniform int m 1
+uniform vec4 color 0.0 1.0 0.0 1.0
+fb tex 2d 4
+draw rect -1 -1 2 2
+
+# Test the result of imageStore 1
+fb tex 2d 1
+probe all rgba 0.0 1.0 0.0 1.0
+
+# Store blue using imageStore
+uniform int n 1
+uniform int m 0
+uniform vec4 color 0.0 0.0 1.0 1.0
+fb tex 2d 4
+draw rect -1 -1 2 2
+
+# Test the result of imageStore 2
+fb tex 2d 2
+probe all rgba 0.0 0.0 1.0 1.0
+
+# Store cyan using imageStore
+uniform int n 1
+uniform int m 1
+uniform vec4 color 0.0 1.0 1.0 1.0
+fb tex 2d 4
+draw rect -1 -1 2 2
+
+# Test the result of imageStore 3
+fb tex 2d 3
+probe all rgba 0.0 1.0 1.0 1.0