summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2019-02-27 19:32:41 -0800
committerIan Romanick <ian.d.romanick@intel.com>2019-02-28 20:13:00 -0800
commit80baf08d700329e0159e620e1bff99a620a5339f (patch)
treeabf70b340206c0140f94e4f852a0bdde1de17131
parentf866aeb579399ff6af9bebc4a33263d189c90826 (diff)
arb_gpu_shader_int64: Test extracting individual bytes from 64-bit values
In Mesa, NIR has an optimization that will convert certain patterns into instructions that extract an individual byte from a larger integer. When extracting from a 64-bit value, the i965 compiler backend has some bugs emitting these instructions. These tests try to reproduce these problems, but only fs-ushr-and-mask.shader_test is able to trigger the failure. The optimization is not (yet) able to recognize the patterns from the other tests to generate the mishandled instructions. With those patterns added, all of these tests either fail or hit the assertion: src/intel/compiler/brw_ir_fs.h:295: fs_reg subscript(fs_reg, brw_reg_type, unsigned int): Assertion `(i + 1) * type_sz(type) <= type_sz(reg.type)' failed. Reviewed-by: Matt Turner <mattst88@gmail.com> Cc: Jason Ekstrand <jason@jlekstrand.net>
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr-loop.shader_test55
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr.shader_test89
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr-loop.shader_test55
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr.shader_test89
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask-loop.shader_test55
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask.shader_test89
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask-loop.shader_test56
-rw-r--r--tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask.shader_test89
8 files changed, 577 insertions, 0 deletions
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr-loop.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr-loop.shader_test
new file mode 100644
index 000000000..4eacc615b
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr-loop.shader_test
@@ -0,0 +1,55 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform int64_t ival[] = int64_t[](0xBADDC0DEDEADBEEFl,
+ 0xDEADBEA7BA5EBA11l,
+ 0xF0F1F2F3F4F5F6F7l,
+ 0x0F1F2F3F4F5F6F7Fl,
+ 0x7071727374757677l,
+ 0x0717273747576777l,
+ 0x1F2E3D4C5B6A7988l,
+ 0xBADB100DDEADC0DEl);
+
+const int64_t expected[] = int64_t[](0xFFFFFFFFFFFFFFEFl,
+ 0xFFFFFFFFFFFFFFBAl,
+ 0xFFFFFFFFFFFFFFF5l,
+ 0x000000000000004Fl,
+ 0x0000000000000073l,
+ 0x0000000000000027l,
+ 0x000000000000002El,
+ 0xFFFFFFFFFFFFFFBAl);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+
+ for (uint i = 0; i < uint(ival.length()); i++) {
+ uint64_t result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+ }
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr.shader_test
new file mode 100644
index 000000000..f6a6ba542
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ishr.shader_test
@@ -0,0 +1,89 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform int64_t ival[] = int64_t[](0xBADDC0DEDEADBEEFl,
+ 0xDEADBEA7BA5EBA11l,
+ 0xF0F1F2F3F4F5F6F7l,
+ 0x0F1F2F3F4F5F6F7Fl,
+ 0x7071727374757677l,
+ 0x0717273747576777l,
+ 0x1F2E3D4C5B6A7988l,
+ 0xBADB100DDEADC0DEl);
+
+const int64_t expected[] = int64_t[](0xFFFFFFFFFFFFFFEFl,
+ 0xFFFFFFFFFFFFFFBAl,
+ 0xFFFFFFFFFFFFFFF5l,
+ 0x000000000000004Fl,
+ 0x0000000000000073l,
+ 0x0000000000000027l,
+ 0x000000000000002El,
+ 0xFFFFFFFFFFFFFFBAl);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+ uint64_t result;
+ uint i;
+
+ /* This is INTENTIONALLY not a loop. Putting it in a loop causes the
+ * optimization that generates the extract instructions to trigger
+ * before the shift count is known to be a constant. The effectively
+ * prevents the bad code generation in the i965 driver from occuring.
+ */
+ i = 0;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 1;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 2;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 3;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 4;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 5;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 6;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 7;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr-loop.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr-loop.shader_test
new file mode 100644
index 000000000..197876ab7
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr-loop.shader_test
@@ -0,0 +1,55 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform uint64_t ival[] = uint64_t[](0xBADDC0DEDEADBEEFul,
+ 0xDEADBEA7BA5EBA11ul,
+ 0xF0F1F2F3F4F5F6F7ul,
+ 0x0F1F2F3F4F5F6F7Ful,
+ 0x7071727374757677ul,
+ 0x0717273747576777ul,
+ 0x1F2E3D4C5B6A7988ul,
+ 0xBADB100DDEADC0DEul);
+
+const uint64_t expected[] = uint64_t[](0x00000000000000EFul,
+ 0x00000000000000BAul,
+ 0x00000000000000F5ul,
+ 0x000000000000004Ful,
+ 0x0000000000000073ul,
+ 0x0000000000000027ul,
+ 0x000000000000002Eul,
+ 0x00000000000000BAul);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+
+ for (uint i = 0; i < uint(ival.length()); i++) {
+ uint64_t result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+ }
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr.shader_test
new file mode 100644
index 000000000..30844ea0b
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ishl-then-ushr.shader_test
@@ -0,0 +1,89 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform uint64_t ival[] = uint64_t[](0xBADDC0DEDEADBEEFul,
+ 0xDEADBEA7BA5EBA11ul,
+ 0xF0F1F2F3F4F5F6F7ul,
+ 0x0F1F2F3F4F5F6F7Ful,
+ 0x7071727374757677ul,
+ 0x0717273747576777ul,
+ 0x1F2E3D4C5B6A7988ul,
+ 0xBADB100DDEADC0DEul);
+
+const uint64_t expected[] = uint64_t[](0x00000000000000EFul,
+ 0x00000000000000BAul,
+ 0x00000000000000F5ul,
+ 0x000000000000004Ful,
+ 0x0000000000000073ul,
+ 0x0000000000000027ul,
+ 0x000000000000002Eul,
+ 0x00000000000000BAul);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+ uint64_t result;
+ uint i;
+
+ /* This is INTENTIONALLY not a loop. Putting it in a loop causes the
+ * optimization that generates the extract instructions to trigger
+ * before the shift count is known to be a constant. The effectively
+ * prevents the bad code generation in the i965 driver from occuring.
+ */
+ i = 0;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 1;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 2;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 3;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 4;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 5;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 6;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 7;
+ result = (ival[i] << (56u - (i * 8u))) >> 56u;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask-loop.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask-loop.shader_test
new file mode 100644
index 000000000..a5cec5d0e
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask-loop.shader_test
@@ -0,0 +1,55 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform int64_t ival[] = int64_t[](0xBADDC0DEDEADBEEFl,
+ 0xDEADBEA7BA5EBA11l,
+ 0xF0F1F2F3F4F5F6F7l,
+ 0x0F1F2F3F4F5F6F7Fl,
+ 0x7071727374757677l,
+ 0x0717273747576777l,
+ 0x1F2E3D4C5B6A7988l,
+ 0xBADB100DDEADC0DEl);
+
+const int64_t expected[] = int64_t[](0x00000000000000EFl,
+ 0x00000000000000BAl,
+ 0x00000000000000F5l,
+ 0x000000000000004Fl,
+ 0x0000000000000073l,
+ 0x0000000000000027l,
+ 0x000000000000002El,
+ 0x00000000000000BAl);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+
+ for (uint i = 0; i < uint(ival.length()); i++) {
+ uint64_t result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+ }
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask.shader_test
new file mode 100644
index 000000000..fa1509dfa
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ishr-and-mask.shader_test
@@ -0,0 +1,89 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform int64_t ival[] = int64_t[](0xBADDC0DEDEADBEEFl,
+ 0xDEADBEA7BA5EBA11l,
+ 0xF0F1F2F3F4F5F6F7l,
+ 0x0F1F2F3F4F5F6F7Fl,
+ 0x7071727374757677l,
+ 0x0717273747576777l,
+ 0x1F2E3D4C5B6A7988l,
+ 0xBADB100DDEADC0DEl);
+
+const int64_t expected[] = int64_t[](0x00000000000000EFl,
+ 0x00000000000000BAl,
+ 0x00000000000000F5l,
+ 0x000000000000004Fl,
+ 0x0000000000000073l,
+ 0x0000000000000027l,
+ 0x000000000000002El,
+ 0x00000000000000BAl);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+ uint64_t result;
+ uint i;
+
+ /* This is INTENTIONALLY not a loop. Putting it in a loop causes the
+ * optimization that generates the extract instructions to trigger
+ * before the shift count is known to be a constant. The effectively
+ * prevents the bad code generation in the i965 driver from occuring.
+ */
+ i = 0;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 1;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 2;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 3;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 4;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 5;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 6;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 7;
+ result = (ival[i] >> (i * 8u)) & 0x0FFl;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask-loop.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask-loop.shader_test
new file mode 100644
index 000000000..e9d41cd70
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask-loop.shader_test
@@ -0,0 +1,56 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform uint64_t ival[] = uint64_t[](0xBADDC0DEDEADBEEFul,
+ 0xDEADBEA7BA5EBA11ul,
+ 0xF0F1F2F3F4F5F6F7ul,
+ 0x0F1F2F3F4F5F6F7Ful,
+ 0x7071727374757677ul,
+ 0x0717273747576777ul,
+ 0x1F2E3D4C5B6A7988ul,
+ 0xBADB100DDEADC0DEul);
+
+const uint64_t expected[] = uint64_t[](0x00000000000000EFul,
+ 0x00000000000000BAul,
+ 0x00000000000000F5ul,
+ 0x000000000000004Ful,
+ 0x0000000000000073ul,
+ 0x0000000000000027ul,
+ 0x000000000000002Eul,
+ 0x00000000000000BAul);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+ uint64_t result;
+
+ for (uint i = 0; i < uint(ival.length()); i++) {
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+ }
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask.shader_test b/tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask.shader_test
new file mode 100644
index 000000000..96519624b
--- /dev/null
+++ b/tests/spec/arb_gpu_shader_int64/execution/fs-ushr-and-mask.shader_test
@@ -0,0 +1,89 @@
+[require]
+GL >= 4.0
+GLSL >= 4.00
+GL_ARB_gpu_shader_int64
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 400
+#extension GL_ARB_gpu_shader_int64 : require
+
+uniform uint64_t ival[] = uint64_t[](0xBADDC0DEDEADBEEFul,
+ 0xDEADBEA7BA5EBA11ul,
+ 0xF0F1F2F3F4F5F6F7ul,
+ 0x0F1F2F3F4F5F6F7Ful,
+ 0x7071727374757677ul,
+ 0x0717273747576777ul,
+ 0x1F2E3D4C5B6A7988ul,
+ 0xBADB100DDEADC0DEul);
+
+const uint64_t expected[] = uint64_t[](0x00000000000000EFul,
+ 0x00000000000000BAul,
+ 0x00000000000000F5ul,
+ 0x000000000000004Ful,
+ 0x0000000000000073ul,
+ 0x0000000000000027ul,
+ 0x000000000000002Eul,
+ 0x00000000000000BAul);
+
+out vec4 piglit_fragcolor;
+
+void main()
+{
+ uint fail_mask = 0;
+ uint64_t result;
+ uint i;
+
+ /* This is INTENTIONALLY not a loop. Putting it in a loop causes the
+ * optimization that generates the extract instructions to trigger
+ * before the shift count is known to be a constant. The effectively
+ * prevents the bad code generation in the i965 driver from occuring.
+ */
+ i = 0;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 1;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 2;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 3;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 4;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 5;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 6;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ i = 7;
+ result = (ival[i] >> (i * 8u)) & 0x0FFul;
+ fail_mask |= result != expected[i] ? 1u << i : 0u;
+
+ /* Construct a clever color so that just looking at the "Observed:"
+ * output from shader_runner will tell you exactly which values did
+ * not match.
+ */
+ piglit_fragcolor = fail_mask == 0
+ ? vec4(0.0, 1.0, 0.0, 1.0)
+ : vec4(float(fail_mask) / 255.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0