diff mbox

arb_arrays_of_arrays: mixed direct and indirect image indexing

Message ID 1439371128-32766-1-git-send-email-t_arceri@yahoo.com.au
State New
Headers show

Commit Message

'Timothy Arceri' via Patchwork Forward Aug. 12, 2015, 9:18 a.m. UTC
---
 ...mixed-const-non-const-uniform-index.shader_test | 66 ++++++++++++++++++++++
 ...ixed-const-non-const-uniform-index2.shader_test | 66 ++++++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index.shader_test
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index2.shader_test
diff mbox

Patch

diff --git a/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index.shader_test b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index.shader_test
new file mode 100644
index 0000000..93996a8
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index.shader_test
@@ -0,0 +1,66 @@ 
+# 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;
+writeonly uniform image2D tex[2][2];
+out vec4 outcolor;
+
+void main()
+{
+	imageStore(tex[1][n], 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) GL_RGBA8
+image texture 0
+
+# Texture 1 is the imageStore output.
+uniform int tex[1][1] 1
+texture rgbw 1 (16, 16) GL_RGBA8
+image texture 1
+
+# Texture 3 is the rendering output. We don't care about this.
+texture rgbw 2 (16, 16)
+
+# Store red using imageStore
+uniform int n 0
+uniform vec4 color 1.0 0.0 0.0 1.0
+fb tex 2d 2
+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 1
+uniform vec4 color 0.0 1.0 0.0 1.0
+fb tex 2d 2
+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
diff --git a/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index2.shader_test b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index2.shader_test
new file mode 100644
index 0000000..1b5bded
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/execution/image_store/basic-imageStore-mixed-const-non-const-uniform-index2.shader_test
@@ -0,0 +1,66 @@ 
+# 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;
+writeonly uniform image2D tex[2][2];
+out vec4 outcolor;
+
+void main()
+{
+	imageStore(tex[n][1], 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][1] 0
+texture rgbw 0 (16, 16) GL_RGBA8
+image texture 0
+
+# Texture 1 is the imageStore output.
+uniform int tex[1][1] 1
+texture rgbw 1 (16, 16) GL_RGBA8
+image texture 1
+
+# Texture 3 is the rendering output. We don't care about this.
+texture rgbw 2 (16, 16)
+
+# Store red using imageStore
+uniform int n 0
+uniform vec4 color 1.0 0.0 0.0 1.0
+fb tex 2d 2
+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 1
+uniform vec4 color 0.0 1.0 0.0 1.0
+fb tex 2d 2
+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