[Piglit] [PATCH 01/17] util/fbo: Provide color format to config constructor

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


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 .../arb_framebuffer_object/attachments-blit-scaled-linear.cpp     | 2 +-
 tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp          | 2 +-
 .../spec/arb_sample_shading/execution/builtin-gl-num-samples.cpp  | 5 +++--
 tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp  | 2 +-
 .../execution/builtin-gl-sample-mask-mrt-alpha.cpp                | 2 +-
 .../execution/builtin-gl-sample-mask-simple.cpp                   | 2 +-
 .../spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp  | 2 +-
 .../arb_sample_shading/execution/builtin-gl-sample-position.cpp   | 2 +-
 .../arb_sample_shading/execution/ignore-centroid-qualifier.cpp    | 2 +-
 .../execution/interpolate-at-sample-position.cpp                  | 2 +-
 tests/spec/ext_framebuffer_multisample/bitmap.cpp                 | 5 +++--
 tests/spec/ext_framebuffer_multisample/blit-flipped.cpp           | 4 ++--
 .../spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp  | 8 ++++----
 .../spec/ext_framebuffer_multisample/blit-mismatched-samples.cpp  | 5 +++--
 tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp  | 4 ++--
 .../ext_framebuffer_multisample/blit-multiple-render-targets.cpp  | 2 +-
 tests/spec/ext_framebuffer_multisample/clear.cpp                  | 2 +-
 tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp  | 6 ++++--
 tests/spec/ext_framebuffer_multisample/common.cpp                 | 2 +-
 tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp    | 7 +++----
 tests/spec/ext_framebuffer_multisample/enable-flag.cpp            | 4 ++--
 tests/spec/ext_framebuffer_multisample/formats.cpp                | 7 ++++---
 tests/spec/ext_framebuffer_multisample/interpolation.cpp          | 4 ++--
 tests/spec/ext_framebuffer_multisample/line-smooth.cpp            | 3 ++-
 tests/spec/ext_framebuffer_multisample/multisample-blit.cpp       | 6 ++++--
 tests/spec/ext_framebuffer_multisample/no-color.cpp               | 5 +++--
 tests/spec/ext_framebuffer_multisample/point-smooth.cpp           | 3 ++-
 tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp         | 3 ++-
 tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp        | 5 +++--
 tests/spec/ext_framebuffer_multisample/sample-coverage.cpp        | 5 +++--
 tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp         | 6 ++++--
 tests/spec/ext_framebuffer_multisample/upsample.cpp               | 2 +-
 .../spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp  | 4 ++--
 .../negative-blit-scaled.cpp                                      | 2 +-
 tests/util/piglit-fbo.cpp                                         | 7 ++++---
 tests/util/piglit-fbo.h                                           | 3 ++-
 36 files changed, 77 insertions(+), 60 deletions(-)

diff --git a/tests/spec/arb_framebuffer_object/attachments-blit-scaled-linear.cpp b/tests/spec/arb_framebuffer_object/attachments-blit-scaled-linear.cpp
index 23e1f60cc..fb2fc1f1d 100644
--- a/tests/spec/arb_framebuffer_object/attachments-blit-scaled-linear.cpp
+++ b/tests/spec/arb_framebuffer_object/attachments-blit-scaled-linear.cpp
@@ -61,7 +61,7 @@ piglit_init(int argc, char **argv)
 	/* Create two singlesample FBOs with same format and dimensions but
 	 * different color attachment types.
 	 */
-	FboConfig Config(0, pattern_width, pattern_height);
+	FboConfig Config(GL_RGBA, 0, pattern_width, pattern_height);
 	fbo_rb.setup(Config);
 	Config.num_rb_attachments = 0;
 	Config.num_tex_attachments = 1;
diff --git a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
index 5cf6a4906..81678bbf4 100644
--- a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
+++ b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
@@ -187,7 +187,7 @@ piglit_init(int argc, char **argv)
 	/* Create two singlesample FBOs with same format and dimensions but
 	 * different color attachment types.
 	 */
-	FboConfig Config(0, pattern_width / 2, pattern_height / 2);
+	FboConfig Config(GL_RGBA, 0, pattern_width / 2, pattern_height / 2);
 	fbo_rb.setup(Config);
 	Config.num_rb_attachments = 0;
 	Config.num_tex_attachments = 1;
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-num-samples.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-num-samples.cpp
index 52965bf47..02ceae18d 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-num-samples.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-num-samples.cpp
@@ -106,11 +106,12 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	singlesampled_fbo.setup(FboConfig(0,
+	singlesampled_fbo.setup(FboConfig(GL_RGBA, 0,
 					  pattern_width,
 					  pattern_height));
 
-	FboConfig msConfig(num_samples, pattern_width, pattern_height);
+	FboConfig msConfig(GL_RGBA, num_samples,
+			   pattern_width, pattern_height);
 	multisampled_fbo.setup(msConfig);
 
 	compile_shader();
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp
index c318b1433..378960a55 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-id.cpp
@@ -143,7 +143,7 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	FboConfig msConfig(num_samples, pattern_width, pattern_height);
+	FboConfig msConfig(GL_RGBA, num_samples, pattern_width, pattern_height);
 	msConfig.color_format = GL_RGBA_INTEGER;
 	msConfig.color_internalformat = GL_RGBA8UI;
 	multisampled_fbo.setup(msConfig);
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-mrt-alpha.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-mrt-alpha.cpp
index 47ad18085..c05992967 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-mrt-alpha.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-mrt-alpha.cpp
@@ -49,7 +49,7 @@ PIGLIT_GL_TEST_CONFIG_END
 static Fbo
 make_fbo()
 {
-        FboConfig config(NUM_SAMPLES, piglit_width, piglit_height);
+        FboConfig config(GL_RGBA, NUM_SAMPLES, piglit_width, piglit_height);
         config.num_rb_attachments = 0;
         config.num_tex_attachments = 2;
         config.tex_attachment[0] = GL_COLOR_ATTACHMENT0;
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp
index 42ce67da7..3fa235642 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask-simple.cpp
@@ -141,7 +141,7 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	FboConfig msConfig(num_samples, 1 << MAX2(num_samples, 1), 1);
+	FboConfig msConfig(GL_RGBA, num_samples, 1 << MAX2(num_samples, 1), 1);
 	msConfig.num_rb_attachments = 0;
 	msConfig.num_tex_attachments = 1;
 	multisampled_tex.setup(msConfig);
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp
index 48ed525e8..f5bc25522 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-mask.cpp
@@ -157,7 +157,7 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	FboConfig msConfig(num_samples, pattern_width, pattern_height);
+	FboConfig msConfig(GL_RGBA, num_samples, pattern_width, pattern_height);
 	multisampled_fbo.setup(msConfig);
 	msConfig.num_tex_attachments = 1;
 	msConfig.num_rb_attachments = 0;
diff --git a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp
index ede6514fc..bfdcada44 100644
--- a/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp
+++ b/tests/spec/arb_sample_shading/execution/builtin-gl-sample-position.cpp
@@ -112,7 +112,7 @@ piglit_init(int argc, char **argv)
 	if (num_samples > MAX_NUM_SAMPLES)
 		piglit_report_result(PIGLIT_FAIL);
 
-	FboConfig msConfig(num_samples, pattern_width, pattern_height);
+	FboConfig msConfig(GL_RGBA, num_samples, pattern_width, pattern_height);
 	multisampled_fbo.setup(msConfig);
 
 	compile_shader();
diff --git a/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp b/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp
index c286c5c75..e2300a5e4 100644
--- a/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp
+++ b/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp
@@ -127,7 +127,7 @@ piglit_init(int argc, char**argv)
 	if (num_samples == 0 || num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	FboConfig msConfig(num_samples, piglit_width, piglit_height);
+	FboConfig msConfig(GL_RGBA, num_samples, piglit_width, piglit_height);
 	msConfig.num_rb_attachments = 0;
 	msConfig.num_tex_attachments = 1;
 	multisampled_fbo.setup(msConfig);
diff --git a/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp b/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp
index 6d0123bff..6bb584b38 100644
--- a/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp
+++ b/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp
@@ -138,7 +138,7 @@ piglit_init(int argc, char**argv)
 	if (num_samples == 0 || num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	FboConfig msConfig(num_samples, piglit_width, piglit_height);
+	FboConfig msConfig(GL_RGBA, num_samples, piglit_width, piglit_height);
 	msConfig.num_rb_attachments = 0;
 	msConfig.num_tex_attachments = 2;
 	msConfig.tex_attachment[1] = GL_COLOR_ATTACHMENT1;
diff --git a/tests/spec/ext_framebuffer_multisample/bitmap.cpp b/tests/spec/ext_framebuffer_multisample/bitmap.cpp
index ef9309dc0..3b50dccb0 100644
--- a/tests/spec/ext_framebuffer_multisample/bitmap.cpp
+++ b/tests/spec/ext_framebuffer_multisample/bitmap.cpp
@@ -163,8 +163,9 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	ms_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
-	resolve_fbo.setup(FboConfig(0, pattern_width, pattern_height));
+	ms_fbo.setup(FboConfig(GL_RGBA, num_samples,
+			       pattern_width, pattern_height));
+	resolve_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width, pattern_height));
 }
 
 enum piglit_result
diff --git a/tests/spec/ext_framebuffer_multisample/blit-flipped.cpp b/tests/spec/ext_framebuffer_multisample/blit-flipped.cpp
index 8b9228fca..5380d0542 100644
--- a/tests/spec/ext_framebuffer_multisample/blit-flipped.cpp
+++ b/tests/spec/ext_framebuffer_multisample/blit-flipped.cpp
@@ -115,11 +115,11 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	singlesampled_fbo.setup(FboConfig(0,
+	singlesampled_fbo.setup(FboConfig(GL_RGBA, 0,
 					  pattern_width,
 					  pattern_height));
 
-	multisampled_fbo.setup(FboConfig(num_samples,
+	multisampled_fbo.setup(FboConfig(GL_RGBA, num_samples,
 					 pattern_width,
 					 pattern_height));
 
diff --git a/tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp b/tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp
index dfbf91296..3cfa5165d 100644
--- a/tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp
+++ b/tests/spec/ext_framebuffer_multisample/blit-mismatched-formats.cpp
@@ -113,7 +113,7 @@ piglit_display()
 	GLfloat *expected_image;
 	GLuint i;
 
-	FboConfig config_ms(1 , pattern_width, pattern_height);
+	FboConfig config_ms(GL_RGBA, 1, pattern_width, pattern_height);
 
 	for(i = 0; i < ARRAY_SIZE(color_formats); i++) {
 		expected_image =
@@ -211,18 +211,18 @@ piglit_init(int argc, char **argv)
 	/* Passing sample count = 1 will create the FBOs with minimum supported
 	 * sample count. Both FBOs are created with GL_RGBA format by default.
 	 */
-	src_fbo.setup(FboConfig(1 /* sample count */,
+	src_fbo.setup(FboConfig(GL_RGBA, 1 /* sample count */,
 				pattern_width,
 				pattern_height));
 
-	dst_fbo.setup(FboConfig(1 /* sample count */,
+	dst_fbo.setup(FboConfig(GL_RGBA, 1 /* sample count */,
 				pattern_width,
 				pattern_height));
 
 	/* Single-sampled FBO used so that we can call glReadPixels to
 	 * examine the results.
 	 */
-	ss_fbo.setup(FboConfig(0 /* sample count */,
+	ss_fbo.setup(FboConfig(GL_RGBA, 0 /* sample count */,
 			       pattern_width,
 			       pattern_height));
 
diff --git a/tests/spec/ext_framebuffer_multisample/blit-mismatched-samples.cpp b/tests/spec/ext_framebuffer_multisample/blit-mismatched-samples.cpp
index 61ef380d1..09e82d60f 100644
--- a/tests/spec/ext_framebuffer_multisample/blit-mismatched-samples.cpp
+++ b/tests/spec/ext_framebuffer_multisample/blit-mismatched-samples.cpp
@@ -82,7 +82,7 @@ piglit_init(int argc, char **argv)
 	 * the next available sample count. So, this will create the FBO with
 	 * minimum supported sample count.
 	 */
-	src_fbo.setup(FboConfig(1 /* sample count */,
+	src_fbo.setup(FboConfig(GL_RGBA, 1 /* sample count */,
 				pattern_width,
 				pattern_height));
 
@@ -101,7 +101,8 @@ piglit_init(int argc, char **argv)
 	/* Creating FBO with (samples + 1) ensures that we get a different
 	 * value of sample count in dst_fbo.
 	 */
-	dst_fbo.setup(FboConfig(samples + 1, pattern_width, pattern_height));
+	dst_fbo.setup(FboConfig(GL_RGBA, samples + 1,
+				pattern_width, pattern_height));
 
 	if (!piglit_check_gl_error(GL_NO_ERROR)) {
 		printf("Error setting up frame buffer objects\n");
diff --git a/tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp b/tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp
index a5d8a4471..a60934393 100644
--- a/tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp
+++ b/tests/spec/ext_framebuffer_multisample/blit-mismatched-sizes.cpp
@@ -81,11 +81,11 @@ piglit_init(int argc, char **argv)
 	/* Passing sample count = 1 will create the FBOs with minimum supported
 	 * sample count.
 	 */
-	src_fbo.setup(FboConfig(1 /* sample count */,
+	src_fbo.setup(FboConfig(GL_RGBA, 1 /* sample count */,
 				pattern_width,
 				pattern_height));
 
-	dst_fbo.setup(FboConfig(1 /* sample count */,
+	dst_fbo.setup(FboConfig(GL_RGBA, 1 /* sample count */,
 				pattern_width,
 				pattern_height));
 
diff --git a/tests/spec/ext_framebuffer_multisample/blit-multiple-render-targets.cpp b/tests/spec/ext_framebuffer_multisample/blit-multiple-render-targets.cpp
index 219d3a092..4afb84cfe 100644
--- a/tests/spec/ext_framebuffer_multisample/blit-multiple-render-targets.cpp
+++ b/tests/spec/ext_framebuffer_multisample/blit-multiple-render-targets.cpp
@@ -73,7 +73,7 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	FboConfig Config(num_samples, piglit_width, piglit_height);
+	FboConfig Config(GL_RGBA, num_samples, piglit_width, piglit_height);
 
 	/* Setup fbo with renderbuffer and texture attachments */
 	Config.num_rb_attachments = 2;
diff --git a/tests/spec/ext_framebuffer_multisample/clear.cpp b/tests/spec/ext_framebuffer_multisample/clear.cpp
index 1284d0d00..cb6c2e1a6 100644
--- a/tests/spec/ext_framebuffer_multisample/clear.cpp
+++ b/tests/spec/ext_framebuffer_multisample/clear.cpp
@@ -130,7 +130,7 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	multisampled_fbo.setup(FboConfig(num_samples, pattern_width,
+	multisampled_fbo.setup(FboConfig(GL_RGBA, num_samples, pattern_width,
 					 pattern_height));
 	if (manifest_program)
 		manifest_program->compile();
diff --git a/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp b/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp
index b48930c29..1b17e9b38 100644
--- a/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/clip-and-scissor-blit.cpp
@@ -366,8 +366,10 @@ piglit_init(int argc, char **argv)
 		print_usage_and_exit(argv[0]);
 	}
 
-	src_fbo.setup(FboConfig(src_samples, src_size[0], src_size[1]));
-	dst_fbo.setup(FboConfig(dst_samples, dst_size[0], dst_size[1]));
+	src_fbo.setup(FboConfig(GL_RGBA, src_samples,
+				src_size[0], src_size[1]));
+	dst_fbo.setup(FboConfig(GL_RGBA, dst_samples,
+				dst_size[0], dst_size[1]));
 }
 
 extern "C" enum piglit_result
diff --git a/tests/spec/ext_framebuffer_multisample/common.cpp b/tests/spec/ext_framebuffer_multisample/common.cpp
index a9f332af7..f6e2d7421 100644
--- a/tests/spec/ext_framebuffer_multisample/common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/common.cpp
@@ -279,7 +279,7 @@ Test::init(int num_samples, bool small, bool combine_depth_stencil,
 	this->supersample_factor = supersample_factor;
 	this->filter_mode = filter_mode;
 
-	FboConfig test_fbo_config(0,
+	FboConfig test_fbo_config(GL_RGBA, 0,
 				  small ? 16 : pattern_width,
 				  small ? 16 : pattern_height);
 	if (srgb)
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
index bf0d42915..9f92abdd1 100644
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp
@@ -898,16 +898,15 @@ ms_fbo_and_draw_buffers_setup(int samples,
 	draw_buffer_zero_format = color_buffer_zero_format;
 
 	/* Setup frame buffer objects with required configuration */
-	FboConfig ms_config(samples, pattern_width, pattern_height);
-	ms_config.color_internalformat = color_buffer_zero_format;
+	FboConfig ms_config(color_buffer_zero_format, samples,
+			    pattern_width, pattern_height);
 	ms_fbo.setup(ms_config);
 
 	/* Create resolve_fbo with dimensions large enough to accomodate
 	 * all the draw buffers
 	 */
-	FboConfig resolve_config(0, pattern_width,
+	FboConfig resolve_config(GL_RGBA, 0, pattern_width,
 				 num_draw_buffers * pattern_height);
-	resolve_config.color_internalformat = GL_RGBA;
 	resolve_fbo.setup(resolve_config);
 
 	/* Create resolve_int_fbo to store downsampled integer draw buffer */
diff --git a/tests/spec/ext_framebuffer_multisample/enable-flag.cpp b/tests/spec/ext_framebuffer_multisample/enable-flag.cpp
index 92b6c91fa..542655d58 100644
--- a/tests/spec/ext_framebuffer_multisample/enable-flag.cpp
+++ b/tests/spec/ext_framebuffer_multisample/enable-flag.cpp
@@ -94,9 +94,9 @@ piglit_init(int argc, char **argv)
 	GLint max_samples;
 	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
 
-	singlesampled_fbo.setup(FboConfig(0, pattern_width,
+	singlesampled_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width,
 					  pattern_height));
-	multisampled_fbo.setup(FboConfig(max_samples, pattern_width,
+	multisampled_fbo.setup(FboConfig(GL_RGBA, max_samples, pattern_width,
 					 pattern_height));
 	triangles.compile();
 }
diff --git a/tests/spec/ext_framebuffer_multisample/formats.cpp b/tests/spec/ext_framebuffer_multisample/formats.cpp
index b3698e230..71c767198 100644
--- a/tests/spec/ext_framebuffer_multisample/formats.cpp
+++ b/tests/spec/ext_framebuffer_multisample/formats.cpp
@@ -182,8 +182,8 @@ public:
 bool
 PatternRenderer::try_setup(GLenum internalformat, bool is_integer)
 {
-	FboConfig config_downsampled(0, pattern_width, pattern_height);
-	config_downsampled.color_internalformat = internalformat;
+	FboConfig config_downsampled(internalformat, 0,
+				     pattern_width, pattern_height);
 
 	if (is_integer) {
 		config_downsampled.color_format = GL_RGBA_INTEGER;
@@ -577,7 +577,8 @@ test_format(const struct format_desc *format)
 
 	if (is_integer) {
 		Fbo compare_fbo;
-		compare_fbo.setup(FboConfig(0, pattern_width, pattern_height));
+		compare_fbo.setup(FboConfig(GL_RGBA, 0,
+					    pattern_width, pattern_height));
 
 		glBindFramebuffer(GL_DRAW_FRAMEBUFFER, compare_fbo.handle);
 
diff --git a/tests/spec/ext_framebuffer_multisample/interpolation.cpp b/tests/spec/ext_framebuffer_multisample/interpolation.cpp
index a814724b9..5ebb36104 100644
--- a/tests/spec/ext_framebuffer_multisample/interpolation.cpp
+++ b/tests/spec/ext_framebuffer_multisample/interpolation.cpp
@@ -373,9 +373,9 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	singlesampled_fbo.setup(FboConfig(0, pattern_width,
+	singlesampled_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width,
 					  pattern_height));
-	multisampled_fbo.setup(FboConfig(num_samples, pattern_width,
+	multisampled_fbo.setup(FboConfig(GL_RGBA, num_samples, pattern_width,
 					 pattern_height));
 	test_pattern = new InterpolationTestPattern(frag);
 	test_pattern->compile();
diff --git a/tests/spec/ext_framebuffer_multisample/line-smooth.cpp b/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
index c013d559b..29b1be04e 100644
--- a/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/line-smooth.cpp
@@ -100,7 +100,8 @@ piglit_init(int argc, char **argv)
 	test_pattern = new Lines();
 	test_pattern->compile();
 
-	test_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
+	test_fbo.setup(FboConfig(GL_RGBA, num_samples,
+				 pattern_width, pattern_height));
 
 	glEnable (GL_BLEND);
 	glBlendFunc (GL_SRC_ALPHA_SATURATE, GL_ONE);
diff --git a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
index 40cd16b79..a9b58bf64 100644
--- a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
@@ -121,8 +121,10 @@ piglit_init(int argc, char **argv)
 	if (manifest_program)
 		manifest_program->compile();
 
-	src_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
-	dst_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
+	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
diff --git a/tests/spec/ext_framebuffer_multisample/no-color.cpp b/tests/spec/ext_framebuffer_multisample/no-color.cpp
index 144c05809..2e81ec615 100644
--- a/tests/spec/ext_framebuffer_multisample/no-color.cpp
+++ b/tests/spec/ext_framebuffer_multisample/no-color.cpp
@@ -142,7 +142,8 @@ piglit_init(int argc, char **argv)
 	}
 
 	/* 3rd arg: buffer_config */
-	FboConfig test_fbo_config(num_samples, pattern_width, pattern_height);
+	FboConfig test_fbo_config(GL_RGBA, num_samples,
+				  pattern_width, pattern_height);
 	test_fbo_config.color_internalformat = GL_NONE;
 	if (strcmp(argv[3], "combined") == 0) {
 		test_fbo_config.combine_depth_stencil = true;
@@ -169,7 +170,7 @@ piglit_init(int argc, char **argv)
 		piglit_report_result(PIGLIT_SKIP);
 
 	test_fbo.setup(test_fbo_config);
-	manifest_fbo.setup(FboConfig(num_samples, pattern_width,
+	manifest_fbo.setup(FboConfig(GL_RGBA, num_samples, pattern_width,
 				     pattern_height));
 	manifest_program->compile();
 	test_pattern->compile();
diff --git a/tests/spec/ext_framebuffer_multisample/point-smooth.cpp b/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
index 9f1d6ddf8..544b001a6 100644
--- a/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/point-smooth.cpp
@@ -100,7 +100,8 @@ piglit_init(int argc, char **argv)
 	test_pattern = new Points();
 	test_pattern->compile();
 
-	test_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
+	test_fbo.setup(FboConfig(GL_RGBA, num_samples,
+				 pattern_width, pattern_height));
 
 	/* Blending is required to test smooth points */
 	glEnable (GL_BLEND);
diff --git a/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp b/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
index d4271acf5..e6f71807a 100644
--- a/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
+++ b/tests/spec/ext_framebuffer_multisample/polygon-smooth.cpp
@@ -98,7 +98,8 @@ piglit_init(int argc, char **argv)
 	test_pattern = new Triangles();
 	test_pattern->compile();
 
-	ms_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
+	ms_fbo.setup(FboConfig(GL_RGBA, num_samples,
+			       pattern_width, pattern_height));
 
 	/* Enable blending to test GL_POLYGON_SMOOTH */
 	glEnable (GL_BLEND);
diff --git a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
index eb615da73..f22386655 100644
--- a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
+++ b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp
@@ -237,8 +237,9 @@ piglit_init(int argc, char **argv)
 	if (num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	ms_fbo.setup(FboConfig(num_samples, pattern_width, pattern_height));
-	resolve_fbo.setup(FboConfig(0, pattern_width, pattern_height));
+	ms_fbo.setup(FboConfig(GL_RGBA, num_samples,
+			       pattern_width, pattern_height));
+	resolve_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width, pattern_height));
 
 	buffer_to_test = GL_COLOR_BUFFER_BIT;
 	shader_compile();
diff --git a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
index 91e7a8909..6261d5cea 100644
--- a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
+++ b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp
@@ -386,8 +386,9 @@ piglit_init(int argc, char **argv)
 		piglit_report_result(PIGLIT_SKIP);
 
 	/* Setup frame buffer objects with required configuration */
-	ms_fbo.setup(FboConfig(samples, pattern_width, pattern_height));
-	resolve_fbo.setup(FboConfig(0, pattern_width, pattern_height));
+	ms_fbo.setup(FboConfig(GL_RGBA, samples,
+			       pattern_width, pattern_height));
+	resolve_fbo.setup(FboConfig(GL_RGBA, 0, pattern_width, pattern_height));
 
 	if (!piglit_check_gl_error(GL_NO_ERROR)) {
 		printf("Error setting up frame buffer objects\n");
diff --git a/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp b/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
index 4237b50ce..299eab097 100644
--- a/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/unaligned-blit.cpp
@@ -168,8 +168,10 @@ piglit_init(int argc, char **argv)
 	test_pattern->compile();
 	if (manifest_program)
 		manifest_program->compile();
-	src_fbo.setup(FboConfig(src_samples, pattern_size, pattern_size));
-	dst_fbo.setup(FboConfig(dst_samples, pattern_size, pattern_size));
+	src_fbo.setup(FboConfig(GL_RGBA, src_samples,
+				pattern_size, pattern_size));
+	dst_fbo.setup(FboConfig(GL_RGBA, dst_samples,
+				pattern_size, pattern_size));
 }
 
 enum piglit_result
diff --git a/tests/spec/ext_framebuffer_multisample/upsample.cpp b/tests/spec/ext_framebuffer_multisample/upsample.cpp
index 53d6234d3..5f1dc635f 100644
--- a/tests/spec/ext_framebuffer_multisample/upsample.cpp
+++ b/tests/spec/ext_framebuffer_multisample/upsample.cpp
@@ -136,7 +136,7 @@ piglit_init(int argc, char **argv)
 	if (manifest_program)
 		manifest_program->compile();
 
-	multisample_fbo.setup(FboConfig(num_samples, pattern_width,
+	multisample_fbo.setup(FboConfig(GL_RGBA, num_samples, pattern_width,
 					pattern_height));
 }
 
diff --git a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
index 90e96ef4a..c05516c73 100644
--- a/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
+++ b/tests/spec/ext_framebuffer_multisample_blit_scaled/blit-scaled.cpp
@@ -313,13 +313,13 @@ piglit_init(int argc, char **argv)
 	if (num_samples == 0 || num_samples > max_samples)
 		piglit_report_result(PIGLIT_SKIP);
 
-	singlesampled_fbo.setup(FboConfig(0,
+	singlesampled_fbo.setup(FboConfig(GL_RGBA, 0,
 					  2 * pattern_width,
 					  pattern_height));
 	/* Create two multisample FBOs with same dimensions and sample count
 	 * but different color attachment types.
 	 */
-	FboConfig msConfig(num_samples, pattern_width, pattern_height);
+	FboConfig msConfig(GL_RGBA, num_samples, pattern_width, pattern_height);
 	multisampled_fbo.setup(msConfig);
 	msConfig.num_tex_attachments = 1;
 	msConfig.num_rb_attachments = 0; /* default value is 1 */
diff --git a/tests/spec/ext_framebuffer_multisample_blit_scaled/negative-blit-scaled.cpp b/tests/spec/ext_framebuffer_multisample_blit_scaled/negative-blit-scaled.cpp
index e2b60fe5e..276283c8e 100644
--- a/tests/spec/ext_framebuffer_multisample_blit_scaled/negative-blit-scaled.cpp
+++ b/tests/spec/ext_framebuffer_multisample_blit_scaled/negative-blit-scaled.cpp
@@ -61,7 +61,7 @@ piglit_init(int argc, char **argv)
 	piglit_require_extension("GL_EXT_framebuffer_multisample_blit_scaled");
 
 	glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
-	FboConfig Config(max_samples, pattern_width, pattern_height);
+	FboConfig Config(GL_RGBA, max_samples, pattern_width, pattern_height);
 	multisampled_fbo_1.setup(Config);
 	multisampled_fbo_2.setup(Config);
 	Config.num_samples = 0;
diff --git a/tests/util/piglit-fbo.cpp b/tests/util/piglit-fbo.cpp
index df403d717..61c407a60 100644
--- a/tests/util/piglit-fbo.cpp
+++ b/tests/util/piglit-fbo.cpp
@@ -31,7 +31,8 @@
 #include "piglit-fbo.h"
 using namespace piglit_util_fbo;
 
-FboConfig::FboConfig(int num_samples, int width, int height)
+FboConfig::FboConfig(GLenum color_internalformat, int num_samples,
+		     int width, int height)
 	: num_samples(num_samples),
 	  num_rb_attachments(1),
 	  num_tex_attachments(0),
@@ -42,7 +43,7 @@ FboConfig::FboConfig(int num_samples, int width, int height)
 	  attachment_layer(0),
 	  combine_depth_stencil(true),
 	  color_format(GL_RGBA),
-	  color_internalformat(GL_RGBA),
+	  color_internalformat(color_internalformat),
 	  depth_internalformat(GL_DEPTH_COMPONENT24),
 	  stencil_internalformat(GL_STENCIL_INDEX8)
 {
@@ -55,7 +56,7 @@ FboConfig::FboConfig(int num_samples, int width, int height)
 }
 
 Fbo::Fbo()
-	: config(0, 0, 0), /* will be overwritten on first call to setup() */
+	: config(0, 0, 0, 0), /* will be overwritten on first call to setup() */
 	  handle(0),
 	  depth_rb(0),
 	  stencil_rb(0),
diff --git a/tests/util/piglit-fbo.h b/tests/util/piglit-fbo.h
index e7e45a884..6db6afc49 100644
--- a/tests/util/piglit-fbo.h
+++ b/tests/util/piglit-fbo.h
@@ -42,7 +42,8 @@ namespace piglit_util_fbo {
 	class FboConfig
 	{
 	public:
-		FboConfig(int num_samples, int width, int height);
+		FboConfig(GLenum color_internalformat, int num_samples,
+			  int width, int height);
 
 		int num_samples;
 		int num_rb_attachments; /* Default value is 1 */
-- 
2.11.0



More information about the Piglit mailing list