<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#c19">Comment # 19</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:mattst88@gmail.com" title="Matt Turner <mattst88@gmail.com>"> <span class="fn">Matt Turner</span></a>
</span></b>
<pre>(In reply to Danylo from <a href="show_bug.cgi?id=109404#c18">comment #18</a>)
<span class="quote">> 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.</span >
I'm just (In reply to Danylo from <a href="show_bug.cgi?id=109404#c18">comment #18</a>)
<span class="quote">> 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.</span >
Thank you very much for the analysis (and attaching the shader). I'll take a
closer look.</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>