[Piglit] [PATCH 10/17] ext_framebuffer_multisample: multiple-blit also against RGBA16F/32F

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


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 .../multisample-blit.cpp                           | 32 ++++++++++++++--------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
index a9b58bf64..527e64ea6 100644
--- a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
@@ -51,12 +51,11 @@ PIGLIT_GL_TEST_CONFIG_END
 
 const int pattern_width = 256; const int pattern_height = 256;
 
-Fbo src_fbo;
-Fbo dst_fbo;
 TestPattern *test_pattern = NULL;
 ManifestProgram *manifest_program = NULL;
 GLbitfield buffer_to_test;
 GLenum filter_mode = GL_NEAREST;
+int num_samples;
 
 void
 print_usage_and_exit(char *prog_name)
@@ -75,7 +74,6 @@ print_usage_and_exit(char *prog_name)
 void
 piglit_init(int argc, char **argv)
 {
-	int num_samples;
 	if (argc < 3)
 		print_usage_and_exit(argv[0]);
 	{
@@ -120,17 +118,18 @@ piglit_init(int argc, char **argv)
 	test_pattern->compile();
 	if (manifest_program)
 		manifest_program->compile();
-
-	src_fbo.setup(FboConfig(GL_RGBA, num_samples,
-				pattern_width, pattern_height));
-	dst_fbo.setup(FboConfig(GL_RGBA, num_samples,
-				pattern_width, pattern_height));
 }
 
-enum piglit_result
-piglit_display()
+static bool
+test_format(GLenum color_internal_format)
 {
 	bool pass = true;
+	Fbo src_fbo, dst_fbo;
+
+	src_fbo.setup(FboConfig(color_internal_format, num_samples,
+				pattern_width, pattern_height));
+	dst_fbo.setup(FboConfig(color_internal_format, num_samples,
+				pattern_width, pattern_height));
 
 	/* Draw the test pattern in src_fbo. */
 	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, src_fbo.handle);
@@ -183,7 +182,18 @@ piglit_display()
 	pass = piglit_probe_rect_halves_equal_rgba(0, 0, piglit_width,
 						   piglit_height) && pass;
 
-	pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
+	return piglit_check_gl_error(GL_NO_ERROR) && pass;
+}
+
+enum piglit_result
+piglit_display()
+{
+	bool pass = test_format(GL_RGBA);
+	
+	if (buffer_to_test == GL_COLOR_BUFFER_BIT) {
+		pass &= test_format(GL_RGBA16F);
+		pass &= test_format(GL_RGBA32F);
+        }
 
 	piglit_present_results();
 
-- 
2.11.0



More information about the Piglit mailing list