summaryrefslogtreecommitdiff
path: root/tests/spec
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-10-27 07:27:36 -0700
committerPaul Berry <stereotype441@gmail.com>2013-10-29 11:15:24 -0700
commit7bee79e32f98444dc9896b524f8590a54f83cd44 (patch)
tree1b488387205a3f9a54924a82b533e3fb7d906c0c /tests/spec
parent0e14dfa4e7584150ae9224df062a9ed0d44f64bc (diff)
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 <anuj.phogat@gmail.com>
Diffstat (limited to 'tests/spec')
-rw-r--r--tests/spec/ext_framebuffer_multisample/upsample.cpp15
1 files changed, 13 insertions, 2 deletions
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 <buffer_type> 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. */