<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Adding a single, meaningless if-else to a shader source leads to different image"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100303#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Adding a single, meaningless if-else to a shader source leads to different image"
href="https://bugs.freedesktop.org/show_bug.cgi?id=100303">bug 100303</a>
from <span class="vcard"><a class="email" href="mailto:sroland@vmware.com" title="Roland Scheidegger <sroland@vmware.com>"> <span class="fn">Roland Scheidegger</span></a>
</span></b>
<pre>Here's a simplified example, not even the empty branch is necessary, it is
sufficient if the return is inside a loop which is inside a conditional (I'm
actually wondering why this isn't hit in ordinary shaders...):
#version 130
uniform vec2 val_cond;
float func1()
{
if(val_cond.x > val_cond.y) {
for(int i = 0; i < 1; i++) {
return 2.0;
}
}
return 1.0;
}
void main(void)
{
gl_FragColor = vec4(func1());
}
The --dump-lir output for func1 is just:
( function func1
(signature float
(parameters
)
(
(return (constant float (1.000000)) )
))
)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>