[Piglit] [PATCH 1/3] shader_runner: Pass the desired image format explicitly to "image texture".

Francisco Jerez currojerez at riseup.net
Wed Aug 19 06:24:34 PDT 2015


---
 generated_tests/gen_builtin_uniform_tests.py                      | 2 +-
 tests/shaders/shader_runner.c                                     | 8 +++++---
 .../image_store/basic-imageStore-const-uniform-index.shader_test  | 2 +-
 .../basic-imageStore-non-const-uniform-index.shader_test          | 8 ++++----
 .../arb_compute_shader/execution/basic-texelFetch.shader_test     | 2 +-
 .../arb_compute_shader/execution/basic-uniform-access.shader_test | 2 +-
 .../execution/multiple-texture-reading.shader_test                | 6 +++---
 .../arb_compute_shader/execution/multiple-workgroups.shader_test  | 2 +-
 .../spec/arb_compute_shader/execution/simple-barrier.shader_test  | 2 +-
 .../execution/basic-imageStore-from-uniform.shader_test           | 2 +-
 10 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py
index 009a05d..4be2245 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -834,7 +834,7 @@ class ComputeShaderTest(ShaderTest):
     def make_test_init(self):
         return '''uniform int tex 0
 texture rgbw 0 ({0}, 1) GL_RGBA8
-image texture 0
+image texture 0 GL_RGBA8
 fb tex 2d 0
 '''.format(len(self._test_vectors))
 
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index be6e6ae..0614c7f 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2633,13 +2633,15 @@ piglit_display(void)
 		} else if (string_match("hint", line)) {
 			do_hint(line + 4);
 		} else if (sscanf(line,
-				  "image texture %d",
-				  &tex) == 1) {
+				  "image texture %d %31s",
+				  &tex, s) == 2) {
+			const GLenum img_fmt = piglit_get_gl_enum_from_name(s);
 			GLint tex_num;
 
 			glActiveTexture(GL_TEXTURE0 + tex);
 			glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex_num);
-			glBindImageTexture(tex, tex_num, 0, GL_FALSE, 0, GL_READ_WRITE, GL_RGBA8);
+			glBindImageTexture(tex, tex_num, 0, GL_FALSE, 0,
+					   GL_READ_WRITE, img_fmt);
 		} else if (sscanf(line, "ortho %f %f %f %f",
 				  c + 0, c + 1, c + 2, c + 3) == 4) {
 			piglit_gen_ortho_projection(c[0], c[1], c[2], c[3],
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
index ab14086..af7d5d4 100644
--- 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
@@ -34,7 +34,7 @@ void main()
 # Texture 0 is the imageStore output.
 uniform int tex[1][0] 0
 texture rgbw 0 (16, 16) GL_RGBA8
-image texture 0
+image texture 0 GL_RGBA8
 
 # Texture 1 is the rendering output. We don't care about this.
 texture rgbw 1 (16, 16) GL_RGBA8
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
index 2482277..646ea3b 100644
--- 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
@@ -36,22 +36,22 @@ void main()
 # Texture 0 is the imageStore output.
 uniform int tex[0][0] 0
 texture rgbw 0 (16, 16) GL_RGBA8
-image texture 0
+image texture 0 GL_RGBA8
 
 # Texture 1 is the imageStore output.
 uniform int tex[0][1] 1
 texture rgbw 1 (16, 16) GL_RGBA8
-image texture 1
+image texture 1 GL_RGBA8
 
 # Texture 2 is the imageStore output.
 uniform int tex[1][0] 2
 texture rgbw 2 (16, 16) GL_RGBA8
-image texture 2
+image texture 2 GL_RGBA8
 
 # Texture 3 is the imageStore output.
 uniform int tex[1][1] 3
 texture rgbw 3 (16, 16) GL_RGBA8
-image texture 3
+image texture 3 GL_RGBA8
 
 # Texture 4 is the rendering output. We don't care about this.
 texture rgbw 4 (16, 16)
diff --git a/tests/spec/arb_compute_shader/execution/basic-texelFetch.shader_test b/tests/spec/arb_compute_shader/execution/basic-texelFetch.shader_test
index 0f30266..9d1c1c5 100644
--- a/tests/spec/arb_compute_shader/execution/basic-texelFetch.shader_test
+++ b/tests/spec/arb_compute_shader/execution/basic-texelFetch.shader_test
@@ -51,7 +51,7 @@ void main()
 # Setup tex image
 texture rgbw 0 (64, 64)
 uniform int tex 0
-image texture 0
+image texture 0 GL_RGBA8
 
 atomic counters 4
 
diff --git a/tests/spec/arb_compute_shader/execution/basic-uniform-access.shader_test b/tests/spec/arb_compute_shader/execution/basic-uniform-access.shader_test
index ad6f82d..5e49801 100644
--- a/tests/spec/arb_compute_shader/execution/basic-uniform-access.shader_test
+++ b/tests/spec/arb_compute_shader/execution/basic-uniform-access.shader_test
@@ -25,7 +25,7 @@ void main()
 [test]
 uniform int tex 0
 texture rgbw 0 (16, 16) GL_RGBA8
-image texture 0
+image texture 0 GL_RGBA8
 fb tex 2d 0
 
 uniform vec4 color 1.0 0.0 0.0 0.0
diff --git a/tests/spec/arb_compute_shader/execution/multiple-texture-reading.shader_test b/tests/spec/arb_compute_shader/execution/multiple-texture-reading.shader_test
index b13f4df..a17e00b 100644
--- a/tests/spec/arb_compute_shader/execution/multiple-texture-reading.shader_test
+++ b/tests/spec/arb_compute_shader/execution/multiple-texture-reading.shader_test
@@ -35,7 +35,7 @@ void main()
 # Setup src0 image
 texture rgbw 0 (16, 16) GL_RGBA8
 uniform int src0 0
-image texture 0
+image texture 0 GL_RGBA8
 fb tex 2d 0
 clear color 1.0 0.0 1.0 0.0
 clear
@@ -43,7 +43,7 @@ clear
 # Setup src1 image
 texture rgbw 1 (16, 16) GL_RGBA8
 uniform int src1 1
-image texture 1
+image texture 1 GL_RGBA8
 fb tex 2d 1
 clear color 0.0 1.0 0.0 1.0
 clear
@@ -51,7 +51,7 @@ clear
 # Setup dst image
 texture rgbw 2 (16, 16) GL_RGBA8
 uniform int dst 2
-image texture 2
+image texture 2 GL_RGBA8
 fb tex 2d 2
 
 # Clear dst image to not have the same color as the first test case
diff --git a/tests/spec/arb_compute_shader/execution/multiple-workgroups.shader_test b/tests/spec/arb_compute_shader/execution/multiple-workgroups.shader_test
index eeb3233..de4c52c 100644
--- a/tests/spec/arb_compute_shader/execution/multiple-workgroups.shader_test
+++ b/tests/spec/arb_compute_shader/execution/multiple-workgroups.shader_test
@@ -25,7 +25,7 @@ void main()
 [test]
 uniform int tex 0
 texture rgbw 0 (16, 16) GL_RGBA8
-image texture 0
+image texture 0 GL_RGBA8
 fb tex 2d 0
 
 uniform vec4 color 1.0 0.0 0.0 0.0
diff --git a/tests/spec/arb_compute_shader/execution/simple-barrier.shader_test b/tests/spec/arb_compute_shader/execution/simple-barrier.shader_test
index 3f09c34..2d9dcee 100644
--- a/tests/spec/arb_compute_shader/execution/simple-barrier.shader_test
+++ b/tests/spec/arb_compute_shader/execution/simple-barrier.shader_test
@@ -49,7 +49,7 @@ void main()
 [test]
 uniform int tex 0
 texture rgbw 0 (16, 16) GL_RGBA8
-image texture 0
+image texture 0 GL_RGBA8
 fb tex 2d 0
 
 compute 2 2 1
diff --git a/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test b/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
index 500fdb1..7133593 100644
--- a/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
+++ b/tests/spec/arb_shader_image_load_store/execution/basic-imageStore-from-uniform.shader_test
@@ -32,7 +32,7 @@ void main()
 # Texture 0 is the imageStore output.
 uniform int tex 0
 texture rgbw 0 (16, 16) GL_RGBA8
-image texture 0
+image texture 0 GL_RGBA8
 
 # Texture 1 is the rendering output. We don't care about this.
 texture rgbw 1 (16, 16) GL_RGBA8
-- 
2.4.6



More information about the Piglit mailing list