<div dir="ltr">On 26 August 2013 22:26, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 08/23/2013 04:32 PM, Matt Turner wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The GLSL spec doesn't guarantee that a linking error won't happen.<br>
---<br>
.../built-in-functions/const-<u></u>bitCount.shader_test | 40 ++++++++--------------<br>
.../const-bitfieldExtract.<u></u>shader_test | 23 +++++--------<br>
.../const-bitfieldInsert.<u></u>shader_test | 20 ++++-------<br>
.../const-bitfieldReverse.<u></u>shader_test | 32 +++++++----------<br>
.../built-in-functions/const-<u></u>findLSB.shader_test | 40 ++++++++--------------<br>
.../built-in-functions/const-<u></u>findMSB.shader_test | 26 +++++---------<br>
6 files changed, 66 insertions(+), 115 deletions(-)<br>
<br>
diff --git a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitCount.shader_test b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitCount.shader_test<br>
index 7ba0c91..dfbc224 100644<br>
--- a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitCount.shader_test<br>
+++ b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitCount.shader_test<br>
@@ -12,7 +12,7 @@ void main() {<br>
[fragment shader]<br>
#extension GL_ARB_gpu_shader5 : enable<br>
<br>
-void bad_constant_folding();<br>
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }<br>
</blockquote>
<br></div>
Have you tried this on other drivers? I've seen many cases where things that seem like the should be errors get optimized out before the error gets generated. While this is a known "bug" in those implementations, it's generally better to test the thing you're trying to test instead of testing something else with your test when you're testing a test. Sorry, I got carried away there. :)<br>
<br>
I can try it tomorrow on NVIDIA, if you like.</blockquote><div><br></div><div>FWIW, in my experience NVIDIA fails most of these kinds of constant folding tests, because it is only capable of evaluating the simplest built-in functions at compile time. I wouldn't hold your breath for this test, or any variant of it, passing on NVIIDA.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
out vec4 color;<br>
<br>
@@ -21,30 +21,20 @@ void main()<br>
/* Green if both pass. */<br>
color = vec4(0.0, 1.0, 0.0, 1.0);<br>
<br>
- if (ivec4(0) != bitCount(ivec4(0)))<br>
- bad_constant_folding();<br>
- else if (ivec4(0) != bitCount(uvec4(0u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(1) != bitCount(ivec4(1, 2, 4, 8)))<br>
- bad_constant_folding();<br>
- else if (ivec4(1) != bitCount(uvec4(1u, 2u, 4u, 8u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(1, 2, 3, 4) != bitCount(ivec4(1, 3, 7, 15)))<br>
- bad_constant_folding();<br>
- else if (ivec4(1, 2, 3, 4) != bitCount(uvec4(1u, 3u, 7u, 15u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(6, 6, 3, 5) != bitCount(ivec4(783, 111, 385, 484)))<br>
- bad_constant_folding();<br>
- else if (ivec4(6, 6, 3, 5) != bitCount(uvec4(783u, 111u, 385u, 484u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(32, 31, 31, 30) != bitCount(ivec4(-1, -2, -3, -4)))<br>
- bad_constant_folding();<br>
- else if (ivec4(32, 31, 31, 30) != bitCount(uvec4(0xFFFFFFFFu, 0xFFFFFFFEu, 0xFFFFFFFDu, 0xFFFFFFFCu)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(0) != bitCount(ivec4(0)));<br>
+ STATIC_ASSERT(ivec4(0) != bitCount(uvec4(0u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(1) != bitCount(ivec4(1, 2, 4, 8)));<br>
+ STATIC_ASSERT(ivec4(1) != bitCount(uvec4(1u, 2u, 4u, 8u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(1, 2, 3, 4) != bitCount(ivec4(1, 3, 7, 15)));<br>
+ STATIC_ASSERT(ivec4(1, 2, 3, 4) != bitCount(uvec4(1u, 3u, 7u, 15u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(6, 6, 3, 5) != bitCount(ivec4(783, 111, 385, 484)));<br>
+ STATIC_ASSERT(ivec4(6, 6, 3, 5) != bitCount(uvec4(783u, 111u, 385u, 484u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(32, 31, 31, 30) != bitCount(ivec4(-1, -2, -3, -4)));<br>
+ STATIC_ASSERT(ivec4(32, 31, 31, 30) != bitCount(uvec4(0xFFFFFFFFu, 0xFFFFFFFEu, 0xFFFFFFFDu, 0xFFFFFFFCu)));<br>
}<br>
<br>
[vertex data]<br>
diff --git a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldExtract.shader_<u></u>test b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldExtract.shader_<u></u>test<br>
index ed6b988..8351b78 100644<br>
--- a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldExtract.shader_<u></u>test<br>
+++ b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldExtract.shader_<u></u>test<br>
@@ -12,7 +12,7 @@ void main() {<br>
[fragment shader]<br>
#extension GL_ARB_gpu_shader5 : enable<br>
<br>
-void bad_constant_folding();<br>
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }<br>
<br>
out vec4 color;<br>
<br>
@@ -21,26 +21,19 @@ void main()<br>
/* Green if both pass. */<br>
color = vec4(0.0, 1.0, 0.0, 1.0);<br>
<br>
- if (ivec4(0) != bitfieldExtract(ivec4(<u></u><a href="tel:2147483647" value="+12147483647" target="_blank">2147483647</a>, 15, 7, 3), 0, 0))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(0) != bitfieldExtract(ivec4(<u></u><a href="tel:2147483647" value="+12147483647" target="_blank">2147483647</a>, 15, 7, 3), 0, 0));<br>
<br>
- if (uvec4(0u) != bitfieldExtract(uvec4(<u></u>0xFFFFFFFFu, 15u, 7u, 3u), 0, 0))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(uvec4(0u) != bitfieldExtract(uvec4(<u></u>0xFFFFFFFFu, 15u, 7u, 3u), 0, 0));<br>
<br>
- if (ivec4(-1) != bitfieldExtract(ivec4(1), 0, 1))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(-1) != bitfieldExtract(ivec4(1), 0, 1));<br>
<br>
- if (uvec4(1u) != bitfieldExtract(uvec4(1u), 0, 1))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(uvec4(1u) != bitfieldExtract(uvec4(1u), 0, 1));<br>
<br>
- if (ivec4(1, -1, -1, 1) != bitfieldExtract(ivec4(1, 3, 3, 1), 0, 2))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(1, -1, -1, 1) != bitfieldExtract(ivec4(1, 3, 3, 1), 0, 2));<br>
<br>
- if (ivec4(-1, 0, 1, 3) != bitfieldExtract(ivec4(983040, 61440, 114688, 229376), 16, 4))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(-1, 0, 1, 3) != bitfieldExtract(ivec4(983040, 61440, 114688, 229376), 16, 4));<br>
<br>
- if (uvec4(0xFu, 0x0u, 0x1u, 0x3u) != bitfieldExtract(uvec4(<u></u>0x000F0000u, 0x0000F000u, 0x0001C000u, 0x00038000u), 16, 4))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(uvec4(0xFu, 0x0u, 0x1u, 0x3u) != bitfieldExtract(uvec4(<u></u>0x000F0000u, 0x0000F000u, 0x0001C000u, 0x00038000u), 16, 4));<br>
}<br>
<br>
[vertex data]<br>
diff --git a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldInsert.shader_<u></u>test b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldInsert.shader_<u></u>test<br>
index 228e5db..9ac492b 100644<br>
--- a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldInsert.shader_<u></u>test<br>
+++ b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldInsert.shader_<u></u>test<br>
@@ -12,7 +12,7 @@ void main() {<br>
[fragment shader]<br>
#extension GL_ARB_gpu_shader5 : enable<br>
<br>
-void bad_constant_folding();<br>
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }<br>
<br>
out vec4 color;<br>
<br>
@@ -21,23 +21,17 @@ void main()<br>
/* Green if both pass. */<br>
color = vec4(0.0, 1.0, 0.0, 1.0);<br>
<br>
- if (ivec4(42, 56, 72, 97) != bitfieldInsert(ivec4(42, 56, 72, 97), ivec4(2147483647, 15, 7, 3), 0, 0))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(42, 56, 72, 97) != bitfieldInsert(ivec4(42, 56, 72, 97), ivec4(2147483647, 15, 7, 3), 0, 0));<br>
<br>
- if (uvec4(42u, 56u, 72u, 97u) != bitfieldInsert(uvec4(42u, 56u, 72u, 97u), uvec4(0xFFFFFFFFu, 15u, 7u, 3u), 0, 0))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(uvec4(42u, 56u, 72u, 97u) != bitfieldInsert(uvec4(42u, 56u, 72u, 97u), uvec4(0xFFFFFFFFu, 15u, 7u, 3u), 0, 0));<br>
<br>
- if (ivec4(589839, 262159, 65551, 15) != bitfieldInsert(ivec4(983055), ivec4(9, 4, 1, 0), 16, 4))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(589839, 262159, 65551, 15) != bitfieldInsert(ivec4(983055), ivec4(9, 4, 1, 0), 16, 4));<br>
<br>
- if (uvec4(0x0009000Fu, 0x0004000Fu, 0x0001000Fu, 0x0000000Fu) != bitfieldInsert(uvec4(<u></u>0x000F000Fu), uvec4(0x9u, 0x4u, 0x1u, 0x0u), 16, 4))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(uvec4(<u></u>0x0009000Fu, 0x0004000Fu, 0x0001000Fu, 0x0000000Fu) != bitfieldInsert(uvec4(<u></u>0x000F000Fu), uvec4(0x9u, 0x4u, 0x1u, 0x0u), 16, 4));<br>
<br>
- if (ivec4(917519, 589839, 262159, 65551) != bitfieldInsert(ivec4(15), ivec4(14, 9, 4, 1), 16, 4))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(917519, 589839, 262159, 65551) != bitfieldInsert(ivec4(15), ivec4(14, 9, 4, 1), 16, 4));<br>
<br>
- if (uvec4(0x000E000Fu, 0x0009000Fu, 0x0004000Fu, 0x0001000Fu) != bitfieldInsert(uvec4(0xFu), uvec4(0xEu, 0x9u, 0x4u, 0x1u), 16, 4))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(uvec4(<u></u>0x000E000Fu, 0x0009000Fu, 0x0004000Fu, 0x0001000Fu) != bitfieldInsert(uvec4(0xFu), uvec4(0xEu, 0x9u, 0x4u, 0x1u), 16, 4));<br>
}<br>
<br>
[vertex data]<br>
diff --git a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldReverse.shader_<u></u>test b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldReverse.shader_<u></u>test<br>
index 28c6621..60caf2a 100644<br>
--- a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldReverse.shader_<u></u>test<br>
+++ b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-bitfieldReverse.shader_<u></u>test<br>
@@ -12,7 +12,7 @@ void main() {<br>
[fragment shader]<br>
#extension GL_ARB_gpu_shader5 : enable<br>
<br>
-void bad_constant_folding();<br>
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }<br>
<br>
out vec4 color;<br>
<br>
@@ -21,25 +21,17 @@ void main()<br>
/* Green if both pass. */<br>
color = vec4(0.0, 1.0, 0.0, 1.0);<br>
<br>
- if (ivec4(0, -1, -1, 0) != bitfieldReverse(ivec4(0, -1, -1, 0)))<br>
- bad_constant_folding();<br>
- else if (uvec4(0u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0u) != bitfieldReverse(uvec4(0u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(-2147483648, 1073741824, 536870912, 268435456) != bitfieldReverse(ivec4(1, 2, 4, 8)))<br>
- bad_constant_folding();<br>
- else if (uvec4(0x80000000u, 0x40000000u, 0x20000000u, 0x10000000u) != bitfieldReverse(uvec4(1u, 2u, 4u, 8u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(1, 2, 4, 8) != bitfieldReverse(ivec4(-<u></u><a href="tel:2147483648" value="+12147483648" target="_blank">2147483648</a>, 1073741824, 536870912, 268435456)))<br>
- bad_constant_folding();<br>
- else if (uvec4(1u, 2u, 4u, 8u) != bitfieldReverse(uvec4(<u></u>0x80000000u, 0x40000000u, 0x20000000u, 0x10000000u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(783, 15, 65536, 384) != bitfieldReverse(ivec4(-<u></u>255852544, -268435456, 32768, 25165824)))<br>
- bad_constant_folding();<br>
- else if (uvec4(0xF0C00000u, 0xF0000000u, 0x00008000u, 0x00000180u) != bitfieldReverse(uvec4(783u, 15u, 0x00010000u, 0x01800000u)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(0, -1, -1, 0) != bitfieldReverse(ivec4(0, -1, -1, 0)));<br>
+ STATIC_ASSERT(uvec4(0u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0u) != bitfieldReverse(uvec4(0u, 0xFFFFFFFFu, 0xFFFFFFFFu, 0u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(-<u></u><a href="tel:2147483648" value="+12147483648" target="_blank">2147483648</a>, 1073741824, 536870912, 268435456) != bitfieldReverse(ivec4(1, 2, 4, 8)));<br>
+ STATIC_ASSERT(uvec4(<u></u>0x80000000u, 0x40000000u, 0x20000000u, 0x10000000u) != bitfieldReverse(uvec4(1u, 2u, 4u, 8u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(1, 2, 4, 8) != bitfieldReverse(ivec4(-<u></u><a href="tel:2147483648" value="+12147483648" target="_blank">2147483648</a>, 1073741824, 536870912, 268435456)));<br>
+ STATIC_ASSERT(uvec4(1u, 2u, 4u, 8u) != bitfieldReverse(uvec4(<u></u>0x80000000u, 0x40000000u, 0x20000000u, 0x10000000u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(783, 15, 65536, 384) != bitfieldReverse(ivec4(-<u></u>255852544, -268435456, 32768, 25165824)));<br>
+ STATIC_ASSERT(uvec4(<u></u>0xF0C00000u, 0xF0000000u, 0x00008000u, 0x00000180u) != bitfieldReverse(uvec4(783u, 15u, 0x00010000u, 0x01800000u)));<br>
}<br>
<br>
[vertex data]<br>
diff --git a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findLSB.shader_test b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findLSB.shader_test<br>
index b62df92..742a0d6 100644<br>
--- a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findLSB.shader_test<br>
+++ b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findLSB.shader_test<br>
@@ -12,7 +12,7 @@ void main() {<br>
[fragment shader]<br>
#extension GL_ARB_gpu_shader5 : enable<br>
<br>
-void bad_constant_folding();<br>
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }<br>
<br>
out vec4 color;<br>
<br>
@@ -21,30 +21,20 @@ void main()<br>
/* Green if both pass. */<br>
color = vec4(0.0, 1.0, 0.0, 1.0);<br>
<br>
- if (ivec4(-1) != findLSB(ivec4(0)))<br>
- bad_constant_folding();<br>
- else if (ivec4(-1) != findLSB(uvec4(0u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(0, 1, 0, 2) != findLSB(ivec4(1, 2, 3, 4)))<br>
- bad_constant_folding();<br>
- else if (ivec4(0, 1, 0, 2) != findLSB(uvec4(1u, 2u, 3u, 4u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(10, 9, 8, 7) != findLSB(ivec4(1024, 512, 256, 128)))<br>
- bad_constant_folding();<br>
- else if (ivec4(10, 9, 8, 7) != findLSB(uvec4(1024u, 512u, 256u, 128u)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(0, 1, 0, 2) != findLSB(ivec4(-1, -2, -3, -4)))<br>
- bad_constant_folding();<br>
- else if (ivec4(0, 1, 0, 2) != findLSB(uvec4(0xFFFFFFFFu, 0xFFFFFFFEu, 0xFFFFFFFDu, 0xFFFFFFFCu)))<br>
- bad_constant_folding();<br>
-<br>
- if (ivec4(31, 30, 29, 28) != findLSB(ivec4(-2147483648, 1073741824, 536870912, 268435456)))<br>
- bad_constant_folding();<br>
- else if (ivec4(31, 30, 29, 28) != findLSB(uvec4(0x80000000u, 0x40000000u, 0x20000000u, 0x10000000u)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(-1) != findLSB(ivec4(0)));<br>
+ STATIC_ASSERT(ivec4(-1) != findLSB(uvec4(0u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(0, 1, 0, 2) != findLSB(ivec4(1, 2, 3, 4)));<br>
+ STATIC_ASSERT(ivec4(0, 1, 0, 2) != findLSB(uvec4(1u, 2u, 3u, 4u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(10, 9, 8, 7) != findLSB(ivec4(1024, 512, 256, 128)));<br>
+ STATIC_ASSERT(ivec4(10, 9, 8, 7) != findLSB(uvec4(1024u, 512u, 256u, 128u)));<br>
+<br>
+ STATIC_ASSERT(ivec4(0, 1, 0, 2) != findLSB(ivec4(-1, -2, -3, -4)));<br>
+ STATIC_ASSERT(ivec4(0, 1, 0, 2) != findLSB(uvec4(0xFFFFFFFFu, 0xFFFFFFFEu, 0xFFFFFFFDu, 0xFFFFFFFCu)));<br>
+<br>
+ STATIC_ASSERT(ivec4(31, 30, 29, 28) != findLSB(ivec4(-2147483648, 1073741824, 536870912, 268435456)));<br>
+ STATIC_ASSERT(ivec4(31, 30, 29, 28) != findLSB(uvec4(0x80000000u, 0x40000000u, 0x20000000u, 0x10000000u)));<br>
}<br>
<br>
[vertex data]<br>
diff --git a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findMSB.shader_test b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findMSB.shader_test<br>
index fec20f1..ef875e6 100644<br>
--- a/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findMSB.shader_test<br>
+++ b/tests/spec/arb_gpu_shader5/<u></u>execution/built-in-functions/<u></u>const-findMSB.shader_test<br>
@@ -12,7 +12,7 @@ void main() {<br>
[fragment shader]<br>
#extension GL_ARB_gpu_shader5 : enable<br>
<br>
-void bad_constant_folding();<br>
+#define STATIC_ASSERT(cond) { float array[(cond) ? -1 : 1]; }<br>
<br>
out vec4 color;<br>
<br>
@@ -21,29 +21,21 @@ void main()<br>
/* Green if both pass. */<br>
color = vec4(0.0, 1.0, 0.0, 1.0);<br>
<br>
- if (ivec4(-1) != findMSB(ivec4(0, -1, -1, 0)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(-1) != findMSB(ivec4(0, -1, -1, 0)));<br>
<br>
- if (ivec4(-1) != findMSB(uvec4(0u)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(-1) != findMSB(uvec4(0u)));<br>
<br>
- if (ivec4(0, 1, 1, 2) != findMSB(ivec4(1, 2, 3, 4)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(0, 1, 1, 2) != findMSB(ivec4(1, 2, 3, 4)));<br>
<br>
- if (ivec4(30, 29, 28, 27) != findMSB(ivec4(2147483647, 1073741823, 536870911, 268435455)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(30, 29, 28, 27) != findMSB(ivec4(2147483647, 1073741823, 536870911, 268435455)));<br>
<br>
- if (ivec4(0, 1, 2, 3) != findMSB(ivec4(-2, -3, -5, -9)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(0, 1, 2, 3) != findMSB(ivec4(-2, -3, -5, -9)));<br>
<br>
- if (ivec4(30, 30, 29, 28) != findMSB(ivec4(-2147483648, -1879048192, -1073741824, -536870912)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(30, 30, 29, 28) != findMSB(ivec4(-2147483648, -1879048192, -1073741824, -536870912)));<br>
<br>
- if (ivec4(0, 1, 1, 2) != findMSB(uvec4(1u, 2u, 3u, 4u)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(0, 1, 1, 2) != findMSB(uvec4(1u, 2u, 3u, 4u)));<br>
<br>
- if (ivec4(31, 30, 29, 28) != findMSB(uvec4(0xFFFFFFFFu, 0x7FFFFFFFu, 0x3FFFFFFFu, 0x1FFFFFFFu)))<br>
- bad_constant_folding();<br>
+ STATIC_ASSERT(ivec4(31, 30, 29, 28) != findMSB(uvec4(0xFFFFFFFFu, 0x7FFFFFFFu, 0x3FFFFFFFu, 0x1FFFFFFFu)));<br>
}<br>
<br>
[vertex data]<br>
<br>
</blockquote>
<br></div></div>
______________________________<u></u>_________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org" target="_blank">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/piglit</a><br>
</blockquote></div><br></div></div>