[Piglit] [PATCH 16/17] ext_framebuffer_multisample: int-draw-buffers also against 8/16/32/UI

Topi Pohjolainen topi.pohjolainen at gmail.com
Tue Jul 18 19:16:41 UTC 2017


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 tests/all.py                                                   |  8 +++++---
 tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp |  7 ++++++-
 .../int-draw-buffers-alpha-to-coverage.cpp                     | 10 ++++++----
 .../int-draw-buffers-alpha-to-one.cpp                          | 10 ++++++----
 4 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 37399c737..a3de040c4 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3062,9 +3062,11 @@ with profile.test_list.group_manager(
                      'int-draw-buffers-alpha-to-one',
                      'int-draw-buffers-alpha-to-coverage',
                      'alpha-to-one-single-sample-buffer']:
-            g(['ext_framebuffer_multisample-{}'.format(test),
-               sample_count],
-              '{} {}'.format(test, sample_count))
+            for fmt in ('GL_RGBA8I', 'GL_RGBA8UI', 'GL_RGBA16I', 'GL_RGBA16UI',
+                        'GL_RGBA32I', 'GL_RGBA32UI'):
+                g(['ext_framebuffer_multisample-{}'.format(test),
+                   sample_count, fmt],
+                  '{} {} {}'.format(test, sample_count, fmt))
 
         for fmt in ('GL_RGBA', 'GL_RGBA16F', 'GL_RGBA32F'):
             for blit_type in ('msaa', 'upsample', 'downsample', 'normal'):
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
index 877b74a17..7ca2e1d22 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
@@ -927,7 +927,12 @@ ms_fbo_and_draw_buffers_setup(int samples,
  	 * formatted attachments and therefore the default GL_RGBA resolve
  	 * framebuffer is needed in addition to the integer based.
  	 */
-	if (color_buffer_zero_format == GL_RGBA8I) {
+	if (color_buffer_zero_format == GL_RGBA8I ||
+	    color_buffer_zero_format == GL_RGBA8UI ||
+	    color_buffer_zero_format == GL_RGBA16I ||
+	    color_buffer_zero_format == GL_RGBA16UI ||
+	    color_buffer_zero_format == GL_RGBA32I ||
+	    color_buffer_zero_format == GL_RGBA32UI) {
 		/* Assuming single integer buffer */
 		resolve_int_fbo.setup(FboConfig(
 					color_buffer_zero_format, 0,
diff --git a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp
index 509d7a665..18b9cec20 100644
--- a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-coverage.cpp
@@ -62,15 +62,14 @@ static int samples;
 void
 print_usage_and_exit(char *prog_name)
 {
-        printf("Usage: %s <num_samples>\n", prog_name);
+        printf("Usage: %s <num_samples> <format>\n", prog_name);
 	piglit_report_result(PIGLIT_FAIL);
 }
 
 void
 piglit_init(int argc, char **argv)
 {
-
-	if (argc < 2)
+	if (argc < 3)
 		print_usage_and_exit(argv[0]);
 	{
 		char *endptr = NULL;
@@ -79,6 +78,9 @@ piglit_init(int argc, char **argv)
 			print_usage_and_exit(argv[0]);
 	}
 
+	const GLenum color_internal_format =
+		piglit_get_gl_enum_from_name(argv[2]);
+
 	piglit_require_gl_version(30);
 
 	int pattern_width = piglit_width / 2;
@@ -101,7 +103,7 @@ piglit_init(int argc, char **argv)
 				      pattern_height,
 				      num_attachments,
 				      GL_COLOR_BUFFER_BIT,
-				      GL_RGBA8I);
+				      color_internal_format);
 	shader_compile(true /* sample_alpha_to_coverage */,
 		       false /* dual_src_blend */,
 		       true /* frag_out_zero_write */);
diff --git a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp
index 608455d2f..e89651256 100644
--- a/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp
+++ b/tests/spec/ext_framebuffer_multisample/int-draw-buffers-alpha-to-one.cpp
@@ -59,15 +59,14 @@ static int samples;
 void
 print_usage_and_exit(char *prog_name)
 {
-        printf("Usage: %s <num_samples>\n", prog_name);
+        printf("Usage: %s <num_samples> <format>\n", prog_name);
 	piglit_report_result(PIGLIT_FAIL);
 }
 
 void
 piglit_init(int argc, char **argv)
 {
-
-	if (argc < 2)
+	if (argc < 3)
 		print_usage_and_exit(argv[0]);
 	{
 		char *endptr = NULL;
@@ -76,6 +75,9 @@ piglit_init(int argc, char **argv)
 			print_usage_and_exit(argv[0]);
 	}
 
+	const GLenum color_internal_format =
+		piglit_get_gl_enum_from_name(argv[2]);
+
 	piglit_require_gl_version(30);
 
 	int pattern_width = piglit_width / 2;
@@ -98,7 +100,7 @@ piglit_init(int argc, char **argv)
 				      pattern_height,
 				      num_attachments,
 				      GL_COLOR_BUFFER_BIT,
-				      GL_RGBA8I);
+				      color_internal_format);
 	shader_compile(false /* sample_alpha_to_coverage */,
 		       false /* dual_src_blend */,
 		       true /* frag_out_zero_write */);
-- 
2.11.0



More information about the Piglit mailing list