[Piglit] [PATCH 2/3] fb-blending-formats: Test DST_ALPHA blending when destination has no alpha

Carl Worth cworth at cworth.org
Mon Jan 14 14:30:28 PST 2013


It may sound silly to test the blending of DST_ALPHA when the
destination has no alpha channel, but in fact this is a not uncommon
source of errors in implementations.

Some implementations will implement a non-alpha format with an
internal buffer that actually does have bits for the alpha
channel. These implementations must then ensure that these alpha bits
never leak out, and must have additional code to smash alpha to 1.0
for things like ReadPixels, TexImage, and DST_ALPHA blending.

So, fix the test to not avoid this important testing.
---
 tests/fbo/fbo-blending-formats.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/fbo/fbo-blending-formats.c b/tests/fbo/fbo-blending-formats.c
index 3dffa0e..e8528e9 100644
--- a/tests/fbo/fbo-blending-formats.c
+++ b/tests/fbo/fbo-blending-formats.c
@@ -299,7 +299,7 @@ static enum piglit_result test_format(const struct format_desc *format)
 		printf("  when testing FBO result, blending with SRC_COLOR.\n");
 		pass = GL_FALSE;
         }
-	if ((i || a) && !piglit_probe_pixel_rgba(piglit_width * 9 / 12, 0, res4)) {
+	if (!piglit_probe_pixel_rgba(piglit_width * 9 / 12, 0, res4)) {
 		printf("  when testing FBO result, blending with DST_ALPHA.\n");
 		pass = GL_FALSE;
 	}
-- 
1.7.10.4



More information about the Piglit mailing list