[Mesa-dev] [Bug 100303] Adding a single, meaningless if-else to a shader source leads to different image

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Mar 26 01:04:10 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=100303

--- Comment #3 from Roland Scheidegger <sroland at vmware.com> ---
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)) )
    ))

)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170326/f23a95c5/attachment.html>


More information about the mesa-dev mailing list