<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ANV] The Witcher 3 shadows flickering"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=109404#c18">Comment # 18</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ANV] The Witcher 3 shadows flickering"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=109404">bug 109404</a>
              from <span class="vcard"><a class="email" href="mailto:danylo.piliaiev@gmail.com" title="Danylo <danylo.piliaiev@gmail.com>"> <span class="fn">Danylo</span></a>
</span></b>
        <pre>What have I found on Friday:

The NIR I have attached is not a problem - it's a correct one as Jason
corrected me on IRC.

The issue seems to be even further down, in native code such comparison
generated:

asr.le.f0.0(8)  null<1>D        -g0<0,1,0>W     15D             { align1 1Q };

...

(+f0.0) if(8)   JIP: 128        UIP: 128                        { align1 1Q };

The 15th bit of that register means:

  0: Front Facing 
  1: Back Facing

Then it is negated to have:

  0: Back Facing
  ~0: Front Facing

Then the *signed* .le (less or equal) with zero, as I see it - this is the
wrong part, ~0 < 0 when comparison is signed however the initial intention was
to have "false" in this comparison when triangle is front facing.

Manually changing null<1>D to null<1>UD fixes the issue.

How such comparison is created?

brw_fs_cmod_propagation.cpp, in opt_cmod_propagation_local, line 323 -
CONDITION_LE modifier is propagated when condition operates on two
REGISTER_TYPE_UD while scan_inst (opcode: asr) has dst: REGISTER_TYPE_D and
src: REGISTER_TYPE_W.

>From my point of view it's not a correct thing to do, but I'm not sure what to
do here.</pre>
        </div>
      </p>


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

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