summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-10-27 07:37:54 -0700
committerPaul Berry <stereotype441@gmail.com>2013-10-29 11:15:25 -0700
commit9c5eda549a3a81b3d3d8a7013a946dcda6db4f7f (patch)
tree715ccad39b3eb3d867fee7d5d3319d1d9ae772b9
parent7bee79e32f98444dc9896b524f8590a54f83cd44 (diff)
Test MSAA-to-MSAA blits in GL_LINEAR filter mode.
Since MSAA-to-MSAA 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 "multisample-blit" test that causes it to do a GL_LINEAR blit. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
-rw-r--r--tests/all.tests11
-rw-r--r--tests/spec/ext_framebuffer_multisample/multisample-blit.cpp15
2 files changed, 21 insertions, 5 deletions
diff --git a/tests/all.tests b/tests/all.tests
index 1550adf54..550729d2b 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1807,10 +1807,15 @@ for num_samples in MSAA_SAMPLE_COUNTS:
for num_samples in MSAA_SAMPLE_COUNTS:
for buffer_type in ('color', 'depth', 'stencil'):
- test_name = ' ' .join(['multisample-blit', str(num_samples), buffer_type])
- executable = 'ext_framebuffer_multisample-{0} -auto'.format(
+ sensible_options = []
+ if buffer_type == 'color':
+ sensible_options.append('linear')
+ for options in power_set(sensible_options):
+ test_name = ' ' .join(['multisample-blit', str(num_samples),
+ buffer_type] + options)
+ executable = 'ext_framebuffer_multisample-{0} -auto'.format(
test_name)
- ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
+ ext_framebuffer_multisample[test_name] = PlainExecTest(executable)
for num_samples in MSAA_SAMPLE_COUNTS:
for buffer_type in ('color', 'depth', 'stencil'):
diff --git a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
index 9bfe4ab08..e601fee5b 100644
--- a/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
+++ b/tests/spec/ext_framebuffer_multisample/multisample-blit.cpp
@@ -56,6 +56,7 @@ Fbo dst_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)
@@ -64,7 +65,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);
}
@@ -106,6 +109,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();
@@ -129,7 +140,7 @@ piglit_display()
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dst_fbo.handle);
glBlitFramebuffer(0, 0, pattern_width, pattern_height,
0, 0, pattern_width, pattern_height,
- buffer_to_test, GL_NEAREST);
+ buffer_to_test, filter_mode);
/* If necessary, manifest the depth/stencil image in dst_fbo
* into a color image. This ensures that the blit that