[Piglit] [PATCH 12/16] msaa/formats: Fix visualization of RED and RG formats

Paul Berry stereotype441 at gmail.com
Fri Jun 15 08:32:32 PDT 2012


The switch statement in visualize_image() wasn't properly handling
formats whose base internal format is GL_RED or GL_RG.  As a result,
tests of these formats showed up as a black screen.  This patch addes
switch cases to handle the formats properly.
---
 tests/spec/ext_framebuffer_multisample/formats.cpp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/spec/ext_framebuffer_multisample/formats.cpp b/tests/spec/ext_framebuffer_multisample/formats.cpp
index b8e8352..d1e03e5 100644
--- a/tests/spec/ext_framebuffer_multisample/formats.cpp
+++ b/tests/spec/ext_framebuffer_multisample/formats.cpp
@@ -359,9 +359,13 @@ visualize_image(float *img, GLenum base_internal_format, bool rhs)
 				a = pixel[3];
 				/* Fall through */
 			case GL_RGB:
-				r = pixel[0];
-				g = pixel[1];
 				b = pixel[2];
+				/* Fall through */
+			case GL_RG:
+				g = pixel[1];
+				/* Fall through */
+			case GL_RED:
+				r = pixel[0];
 				break;
 			case GL_LUMINANCE_ALPHA:
 				a = pixel[1];
-- 
1.7.7.6



More information about the Piglit mailing list