[Piglit] [PATCH piglit] fbo-integer-precision-clear: Use value that would be an invalid float

Neil Roberts neil at linux.intel.com
Thu Aug 14 07:26:01 PDT 2014


This changes one of the values of the integer clear color to
0x7f817f81. If this were interpreted as a float value then it would be
a signalling NaN. If this passes through an x87 register then the
store instruction will convert it to a quiet NaN by setting bit 22.
The integer value would then be incorrect.

This currently exposes a bug in the blorp code path in the i965 driver
in Mesa.
---
 tests/spec/ext_texture_integer/fbo-integer-precision-clear.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/spec/ext_texture_integer/fbo-integer-precision-clear.c b/tests/spec/ext_texture_integer/fbo-integer-precision-clear.c
index f4bf452..eea70f6 100644
--- a/tests/spec/ext_texture_integer/fbo-integer-precision-clear.c
+++ b/tests/spec/ext_texture_integer/fbo-integer-precision-clear.c
@@ -129,7 +129,12 @@ test_fbo(const struct format_info *info)
 	GLenum status;
 	GLboolean intMode;
 	GLint buf;
-	static const GLint clr[4] = { 300000005, 7, 6, 5 };
+	/* The last value is chosen because if it were to be
+	 * interpreted as a float value then it would be a signalling
+	 * NaN value. If this passes through an x87 floating-point
+	 * register then it will be corrupted by the fst
+	 * instruction. */
+	static const GLint clr[4] = { 300000005, 7, 6, 0x7f817f81 };
 	GLint pix[4], i;
 	bool pass = true;
 
-- 
1.9.3



More information about the Piglit mailing list