[Piglit] [PATCH 3/3] ext_framebuffer_multisample: don't use fixed sample count

Brian Paul brianp at vmware.com
Tue Dec 5 16:43:37 UTC 2017


---
 tests/spec/ext_framebuffer_multisample/fast-clear.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample/fast-clear.c b/tests/spec/ext_framebuffer_multisample/fast-clear.c
index d4bf7ce..49ec0a3 100644
--- a/tests/spec/ext_framebuffer_multisample/fast-clear.c
+++ b/tests/spec/ext_framebuffer_multisample/fast-clear.c
@@ -133,6 +133,7 @@ static GLuint prog_float, prog_int, prog_uint;
 static GLuint result_fbo;
 static bool enable_fb_srgb = false;
 static bool single_sample = false;
+static int num_samples = 2;
 
 static void
 convert_srgb_color(const struct format_desc *format,
@@ -395,7 +396,7 @@ test_format(const struct format_desc *format)
 		 * fast clears.
 		 */
 		glTexImage2DMultisample(tex_target,
-					2, /* samples */
+					num_samples,
 					format->internalformat,
 					1, 1, /* width/height */
 					GL_FALSE /* fixed sample locations */);
@@ -557,8 +558,13 @@ piglit_init(int argc, char **argv)
 		}
 	}
 
-	if (!single_sample)
+	if (!single_sample) {
 		piglit_require_extension("GL_ARB_texture_multisample");
+		/* Use the max number of samples for testing */
+		glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &num_samples);
+		printf("Testing %d samples\n", num_samples);
+	}
+
 	piglit_require_extension("GL_ARB_texture_float");
 	piglit_require_GLSL_version(130);
 
-- 
1.9.1



More information about the Piglit mailing list