[Piglit] [PATCH] texture-integer-glsl130: fix random failures with wrong expected alpha values

sroland at vmware.com sroland at vmware.com
Wed Jan 9 13:44:46 PST 2013


From: Roland Scheidegger <sroland at vmware.com>

The logic failed whenever the random number was 0 for formats which don't have
an alpha channel. In this case all of expected/bias/value were 0 but the actual
correct read back value is 1.0 (default value for alpha channel sampling for
integer textures is 1 just like it is 1.0 for ordinary texture formats).
---
 .../ext_texture_integer/texture-integer-glsl130.c  |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/spec/ext_texture_integer/texture-integer-glsl130.c b/tests/spec/ext_texture_integer/texture-integer-glsl130.c
index 17b02bc..bc0d598 100644
--- a/tests/spec/ext_texture_integer/texture-integer-glsl130.c
+++ b/tests/spec/ext_texture_integer/texture-integer-glsl130.c
@@ -373,10 +373,11 @@ test_format(const struct format_info *info)
 		value[0] = temp;
 		break;
 	case GL_RGB_INTEGER_EXT:
-		expected[3] = 0.0;
+		value[3] = 1.0;
 		break;
 	case GL_RG_INTEGER:
-		expected[2] = expected[3] = 0.0;
+		value[2] = 0.0;
+		value[3] = 1.0;
 		break;
 	case GL_ALPHA_INTEGER_EXT:
 		expected[0] = expected[1] = expected[2] = 0.0;
@@ -404,7 +405,8 @@ test_format(const struct format_info *info)
 			expected[0] = expected[1] = expected[2] = expected[3] = 0.25;
 			value[1] = value[2] = value[3] = value[0];
 		} else {
-			expected[1] = expected[2] = expected[3] = 0.0;
+			value[1] = value[2] = 0.0;
+			value[3] = 1.0;
 		}			
 		break;
 	default:
-- 
1.7.9.5


More information about the Piglit mailing list