<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Failed to build shader (translation from TGSI)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99349#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Failed to build shader (translation from TGSI)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99349">bug 99349</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>It turns out that in r600_shader.c:tgsi_split_constant the constants should be
moved to the GPR range, but for large shaders this is not sufficient, since the
temporary registers used there may be beyond 127 which is the limit for GPRs. 

tgsi_split_constant doesn't move all constants and if an operator uses the same
constant as source more than once, then one of the instances of the constants
is moved to a new address, and this may even be counter productive. 

Now to fix this bug, a partial workaround is in the repo I've given above, the
patch changes the register handling to reserve a few registers in the low range
and moves constants there if necessary. Note, however, that it also contains
additional debugging output. 

However, for the instruction 

 LRP TEMP[0].xyz, CONST[31].wwww, CONST[31].xyzz, TEMP[0].xyzz

check_and_set_bank_swizzle still fails. (This is, by the way, one such case
where 
tgsi_split_constant moves one of the instances of CONST[31] to another place.) 

I will try to correct  tgsi_split_constant to not move the values around if
they are originally from the same source and see whether this fixes the
problem.</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>