[Piglit] [PATCH 1/2] msaa/formats: Use a wider color range in MSAA float tests.

Paul Berry stereotype441 at gmail.com
Mon Jul 9 07:50:35 PDT 2012


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.
---
 tests/spec/ext_framebuffer_multisample/formats.cpp |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample/formats.cpp b/tests/spec/ext_framebuffer_multisample/formats.cpp
index 55542aa..f780d5e 100644
--- a/tests/spec/ext_framebuffer_multisample/formats.cpp
+++ b/tests/spec/ext_framebuffer_multisample/formats.cpp
@@ -163,11 +163,26 @@ 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
+		 * is unsigned, so it is tested to a range of [0.0,
+		 * 10.0].
+		 */
+		test_pattern = test_pattern_vec4;
+		if (internalformat == GL_R11F_G11F_B10F_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));
-- 
1.7.7.6



More information about the Piglit mailing list