[Piglit] [PATCH 15/17] ext_framebuffer_multisample: sample-coverage also against RGBA16F/32F

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


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 tests/all.py                                               | 10 ++++++----
 tests/spec/ext_framebuffer_multisample/sample-coverage.cpp | 14 +++++++++-----
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 589259ea5..37399c737 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3030,10 +3030,12 @@ with profile.test_list.group_manager(
                   'unaligned-blit {} {} {}'.format(
                       sample_count, buffer_type, blit_type))
 
-        for test_mode in ('inverted', 'non-inverted'):
-            g(['ext_framebuffer_multisample-sample-coverage', sample_count,
-               test_mode],
-              'sample-coverage {} {}'.format(sample_count, test_mode))
+        for fmt in ('GL_RGBA', 'GL_RGBA16F', 'GL_RGBA32F'):
+            for test_mode in ('inverted', 'non-inverted'):
+                g(['ext_framebuffer_multisample-sample-coverage', sample_count,
+                   fmt, test_mode],
+                  'sample-coverage {} {} {}'.format(
+                      sample_count, fmt, test_mode))
 
         for buffer_type in ('color', 'depth'):
             g(['ext_framebuffer_multisample-sample-alpha-to-coverage',
diff --git a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
index 6261d5cea..655e01636 100644
--- a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
@@ -176,7 +176,7 @@ draw_pattern(bool sample_coverage)
 void
 print_usage_and_exit(char *prog_name)
 {
-	printf("Usage: %s <num_samples> <mode> \n"
+	printf("Usage: %s <num_samples> <format> <mode> \n"
 	       "  where <mode> is one of:\n"
 	       "    inverted\n"
 	       "    non-inverted\n",
@@ -356,7 +356,7 @@ void
 piglit_init(int argc, char **argv)
 {
 	int samples;
-	if (argc < 3)
+	if (argc < 4)
 		print_usage_and_exit(argv[0]);
 	{
 		char *endptr = NULL;
@@ -365,7 +365,10 @@ piglit_init(int argc, char **argv)
 			print_usage_and_exit(argv[0]);
 	}
 
-	for (int i = 2; i < argc; ++i) {
+	const GLenum color_internal_format =
+		piglit_get_gl_enum_from_name(argv[2]);
+
+	for (int i = 3; i < argc; ++i) {
 		if (strcmp(argv[i], "inverted") == 0)
 			coverage_invert = true;
 		else if (strcmp(argv[i], "non-inverted") == 0)
@@ -386,9 +389,10 @@ piglit_init(int argc, char **argv)
 		piglit_report_result(PIGLIT_SKIP);
 
 	/* Setup frame buffer objects with required configuration */
-	ms_fbo.setup(FboConfig(GL_RGBA, samples,
+	ms_fbo.setup(FboConfig(color_internal_format, samples,
 			       pattern_width, pattern_height));
-	resolve_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width, pattern_height));
+	resolve_fbo.setup(FboConfig(color_internal_format, 0,
+				    pattern_width, pattern_height));
 
 	if (!piglit_check_gl_error(GL_NO_ERROR)) {
 		printf("Error setting up frame buffer objects\n");
-- 
2.11.0



More information about the Piglit mailing list