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

Carl Worth cworth at cworth.org
Wed Jan 16 13:26:36 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.

---

Here in version 2 I fix the window testing as well, (version 1 fixed
only the fbo testing).

 tests/fbo/fbo-blending-formats.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/fbo/fbo-blending-formats.c b/tests/fbo/fbo-blending-formats.c
index 4b03591..9085204 100644
--- a/tests/fbo/fbo-blending-formats.c
+++ b/tests/fbo/fbo-blending-formats.c
@@ -298,7 +298,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;
 	}
@@ -367,7 +367,7 @@ static enum piglit_result test_format(const struct format_desc *format)
 		printf("  when testing window result, blending 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 window result, blending DST_ALPHA.\n");
 		pass = GL_FALSE;
 	}
-- 
1.7.10.4



More information about the Piglit mailing list