summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2012-07-06 13:05:03 -0700
committerPaul Berry <stereotype441@gmail.com>2012-07-17 12:36:41 -0700
commit95f00a1202a3b935ee4388ed0905ddad335708dc (patch)
treed907f32579e924c6cb59e8b04f1b60f47b49d0a7
parent655d6140b94af2bd6fee54fa71479ae5616ba657 (diff)
msaa/formats: Use a wider color range in MSAA float tests.
Previously, the MSAA tests for floating-point color buffers only exercised color values in the range [0, 1]. This patch extends the range to [-10, 10], in order to verify that floating-point color values are not inadvertently clamped. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--tests/spec/ext_framebuffer_multisample/formats.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/spec/ext_framebuffer_multisample/formats.cpp b/tests/spec/ext_framebuffer_multisample/formats.cpp
index 55542aab0..1d11024b6 100644
--- a/tests/spec/ext_framebuffer_multisample/formats.cpp
+++ b/tests/spec/ext_framebuffer_multisample/formats.cpp
@@ -163,11 +163,27 @@ PatternRenderer::try_setup(GLenum internalformat)
color_offset = 0.0;
break;
case GL_UNSIGNED_NORMALIZED:
- case GL_FLOAT:
test_pattern = test_pattern_vec4;
color_offset = 0.0;
color_scale = 1.0;
break;
+ case GL_FLOAT:
+ /* Test floating point formats to a (rather arbitrary)
+ * range of [-10.0, 10.0], to make sure no extraneous
+ * clamping occurs. Exception: GL_R11F_G11F_B10F_EXT
+ * and GL_RGB9_E5_EXT are unsigned, so they are tested
+ * to a range of [0.0, 10.0].
+ */
+ test_pattern = test_pattern_vec4;
+ if (internalformat == GL_R11F_G11F_B10F_EXT ||
+ internalformat == GL_RGB9_E5_EXT) {
+ color_offset = 0.0;
+ color_scale = 10.0;
+ } else {
+ color_offset = -10.0;
+ color_scale = 20.0;
+ }
+ break;
default:
printf("Unrecognized component type: %s\n",
piglit_get_gl_enum_name(component_type));