<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:h.evrard@imperial.ac.uk" title="Hugues Evrard <h.evrard@imperial.ac.uk>"> <span class="fn">Hugues Evrard</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Adding unreachable "return" and "continue" in a GLSL shader leads to different image"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=100580">bug 100580</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">URL</td>
           <td>https://github.com/mc-imperial/shader-compiler-bugs/tree/master/AMD-R9-Tonga-285-380-Mesa-Linux/wrong_images/large-v100-197d922443aac5da_inv_variant_48
           </td>
           <td>https://github.com/mc-imperial/shader-compiler-bugs/issues/70
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Adding unreachable "return" and "continue" in a GLSL shader leads to different image"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=100580#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Adding unreachable "return" and "continue" in a GLSL shader leads to different image"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=100580">bug 100580</a>
              from <span class="vcard"><a class="email" href="mailto:h.evrard@imperial.ac.uk" title="Hugues Evrard <h.evrard@imperial.ac.uk>"> <span class="fn">Hugues Evrard</span></a>
</span></b>
        <pre>

Steps to Reproduce:
-------------------------------

0. Note: this bug is experienced on an AMD GPU (tested on Tonga, see
   below for more config details)

1. Obtain and build the latest release of get-image, a simple tool that
   creates a .png image from a fragment shader
   <a href="https://github.com/mc-imperial/get-image">https://github.com/mc-imperial/get-image</a>

2. From a terminal, execute:

   /path/to/get_image/linux_out/install/bin/get_image original.frag

   This will create output.png, which should look like original.png

3. From a terminal, execute:

   /path/to/get_image/linux_out/install/bin/get_image variant.frag

   This will create output.png, which should look like variant.png

Expected Results:
-------------------------------

Both shaders should render an image that looks like original.png. This
is because the only difference between the shader source files is the
addition, in the variant shader, of two unreachable "return" and
"continue" statements. The value of "injectionSwitch" is set to { 0.0,
1.0 }, such that the condition tested here is always false.

Diff:
```
27a28,29
<span class="quote">> uniform vec2 injectionSwitch;</span >
>
33a36,39
<span class="quote">>     if(injectionSwitch.x > injectionSwitch.y)
>         {
>             return vec2(1.0);
>         }</span >
120a127
<span class="quote">>     c = c;</span >
202a210,213
<span class="quote">>                     if(injectionSwitch.x > injectionSwitch.y)
>                         {
>                             continue;
>                         }</span >
```

Actual Results:
-------------------------------
The shaders render different images, which they should not: the red
circle completely disappear in the variant image.

Additional Information:
-------------------------------
Some info on the system where the bug was found:

- CPU: AMD A10-7850K Radeon R7, 12 Compute Cores 4C+8G
- GPU: Advanced Micro Devices, Inc. [AMD/ATI] Tonga PRO [Radeon R9 285/380]
- Mesa: 17.1.0-devel (git-08df015)
- OS: Ubuntu 16.04, Linux 4.4.0-71-generic</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>