<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Compiling of shader gets stuck in infinite loop"
href="https://bugs.freedesktop.org/show_bug.cgi?id=78468#c13">Comment # 13</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Compiling of shader gets stuck in infinite loop"
href="https://bugs.freedesktop.org/show_bug.cgi?id=78468">bug 78468</a>
from <span class="vcard"><a class="email" href="mailto:itoral@igalia.com" title="Iago Toral <itoral@igalia.com>"> <span class="fn">Iago Toral</span></a>
</span></b>
<pre>FWIW, I can reproduce the problem with a simple fragment shader like this one:
#version 140
uniform sampler2D tex;
out vec4 FragColor;
void main()
{
vec4 col = texture(tex, vec2(0, 0)); // 1
for (int i=0; i<30; i++) // 2
col += vec4(0.1, 0.1, 0.1, 0.1); // 3
col = vec4(col.rgb/ 2.0, col.a); // 4
FragColor = col; // 5
}
Some things worth noting:
- The hang goes away if I only replace (1) by:
vec4 col = vec4(0, 0, 0, 0);
or even something like this
vec4 col = vec4(texture(tex, vec2(0, 0)).r, 0.0, 0.0, 0.0);
- The hang goes away if I only replace (4) by:
col = vec4(col.rgb, col.a);
- The hang goes away if we reduce the number of iterations in the loop below a
certain threshold. Actually, for some thresholds you can see that it seems to
hang, but will eventually finished after a few seconds. It just seems that the
time required to complete the constant_folding optimization pass grows
exponentially with the number of iterations in the cases where the test seems
to hang.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>