<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - r600/sb: clobbers gl_Position -> gl_FragCoord"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104143#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - r600/sb: clobbers gl_Position -> gl_FragCoord"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104143">bug 104143</a>
              from <span class="vcard"><a class="email" href="mailto:gw.fossdev@gmail.com" title="Gert Wollny <gw.fossdev@gmail.com>"> <span class="fn">Gert Wollny</span></a>
</span></b>
        <pre>I found the problem: 

if KC0[0].x == index (=0):  

1      x: ADD_INT            T0.x,  KC0[0].x, [0xfffffffe -nan].x
2      x: MOVA_INT           __.x,  T0.x

Address register is now -2 and hence,  in the next step R1 is unconditionally
written, and this is actually the gl_Vertex value ...

3      z: MOV                R[3+AR].z,  0
       w: MOV                R[3+AR].w,  [0x3dcccccd 0.1].x

that is here used to evaluate the gl_Posuition. 

5      x: MUL_IEEE           T0.x,  KC0[1].w, R1.x
       y: MUL_IEEE           T0.y,  KC0[1].z, R1.x
6      t: MULADD_IEEE        T0.y,  KC0[2].z, R1.y, T0.y   SCL_212
...

In the un-optimized shader R[3+AR].w is only written to if (KC0[0].x >= 2), and
hence AR >= 0;

I.e. the sb optimizer is to aggressive in optimizing away the conditional
blocks.</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>