[Bug 109404] [ANV] The Witcher 3 shadows flickering
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Jan 22 17:28:08 UTC 2019
https://bugs.freedesktop.org/show_bug.cgi?id=109404
--- Comment #13 from Danylo <danylo.piliaiev at gmail.com> ---
> I wonder if the constant folding/lowering only just made a certain bug trigger much more often?
Yes, looks like it.
After staring at shader in RenderDoc I found that something wrong with 1-bit
boolean optimizations.
Commenting out
(('bcsel', a, -1, 0), ('ineg', ('b2i', 'a at 1'))),
in src/compiler/nir/nir_opt_algebraic.py solves the issue, this optimization is
part of optimizations for 1-bit booleans introduced in:
6bcd2af0
nir/algebraic: Add some optimizations for D3D-style Booleans
I have some doubts that this exact optimization is a root of the issue but
still it's near enough.
So in the shader there is next contruction:
vec4 _893 = shader_in[4];
_893.x = uintBitsToFloat(gl_FrontFacing ? 4294967295u : 0u);
shader_in[4] = _893;
...
_613.x = uintBitsToFloat((0u >= floatBitsToUint(shader_in[4].x)) ? 4294967295u
: 0u);
r1 = _613;
if (floatBitsToUint(r1.x) != 0u)
{
// Something that happens when it should not
}
When problematic optimization kicks in - it is reduced to:
vec1 32 ssa_14 = intrinsic load_front_face () ()
vec1 32 ssa_15 = b2i32 ssa_14
vec1 32 ssa_16 = imov -ssa_15
...
vec1 32 ssa_200 = uge32 ssa_1, ssa_16
/* succs: block_1 block_2 */
if ssa_200 {
block block_1:
And without it:
vec1 32 ssa_14 = intrinsic load_front_face () ()
...
vec1 32 ssa_198 = inot ssa_14
/* succs: block_1 block_2 */
if ssa_198 {
block block_1:
The first one is incorrect, I was unable to find how it happens today.
I'll attach shader and the resulted NIR.
--
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20190122/7c660167/attachment.html>
More information about the intel-3d-bugs
mailing list