From 7bee79e32f98444dc9896b524f8590a54f83cd44 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Sun, 27 Oct 2013 07:27:36 -0700 Subject: Test upsampling blits in GL_LINEAR filter mode. Since upsampling blits require the source and destination rectangles to be exactly the same size, GL_LINEAR and GL_NEAREST filtering should be equivalent. So just add an option to the "upsample" test that causes it to do a GL_LINEAR upsampling blit. Reviewed-by: Anuj Phogat --- tests/spec/ext_framebuffer_multisample/upsample.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'tests/spec/ext_framebuffer_multisample') diff --git a/tests/spec/ext_framebuffer_multisample/upsample.cpp b/tests/spec/ext_framebuffer_multisample/upsample.cpp index 10e5ad735..67854bf5a 100644 --- a/tests/spec/ext_framebuffer_multisample/upsample.cpp +++ b/tests/spec/ext_framebuffer_multisample/upsample.cpp @@ -71,6 +71,7 @@ Fbo multisample_fbo; TestPattern *test_pattern = NULL; ManifestProgram *manifest_program = NULL; GLbitfield buffer_to_test; +GLenum filter_mode = GL_NEAREST; void print_usage_and_exit(char *prog_name) @@ -79,7 +80,9 @@ print_usage_and_exit(char *prog_name) " where is one of:\n" " color\n" " stencil\n" - " depth\n", + " depth\n" + "Available options:\n" + " linear: use GL_LINEAR filter mode\n", prog_name); piglit_report_result(PIGLIT_FAIL); } @@ -121,6 +124,14 @@ piglit_init(int argc, char **argv) } else { print_usage_and_exit(argv[0]); } + + for (int i = 3; i < argc; i++) { + if (strcmp(argv[i], "linear") == 0) + filter_mode = GL_LINEAR; + else + print_usage_and_exit(argv[0]); + } + test_pattern->compile(); if (manifest_program) manifest_program->compile(); @@ -158,7 +169,7 @@ piglit_display() glBindFramebuffer(GL_DRAW_FRAMEBUFFER, multisample_fbo.handle); glBlitFramebuffer(pattern_width, 0, pattern_width*2, pattern_height, 0, 0, pattern_width, pattern_height, - buffer_to_test, GL_NEAREST); + buffer_to_test, filter_mode); if (manifest_program) { /* Manifest the test pattern in the main framebuffer. */ -- cgit v1.2.3