[Bug 111490] [REGRESSION] [BISECTED] Shadow Tactics: Blades of the Shogun - problems rendering water
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Wed Sep 4 18:06:07 UTC 2019
https://bugs.freedesktop.org/show_bug.cgi?id=111490
--- Comment #15 from Ian Romanick <idr at freedesktop.org> ---
These are just my notes in case someone else ends up looking at this bug. I
haven't crosschecked this on the Shadow Tactics trace, but on HoF2, I've
noticed something a little surprising.
My hypothesis for this bug has been that some vertex shaders get the
optimization, and some don't. In the ones that do, converting the
fadd-ffma-ffma-fmul sequence to ffma-ffma-ffma gets an extra bit of precision,
and that changes the result. The results of testing the "Strip
is_used_once..." patch at least partially supports that. I ended up with
something like:
(('~fadd', ('ffma(is_used_once)', a, b, ('ffma', c, d, ('fmul',
'e(is_not_const_and_not_fsign)', 'f(is_not_const_and_not_fsign)'))),
'g(is_not_const)'),
('ffma', a, b, ('ffma', c, d, ('ffma', e, 'f', 'g'))), '(info->stage !=
MESA_SHADER_VERTEX && info->stage != MESA_SHADER_GEOMETRY) &&
!options->intel_vec4'),
(('~fadd', ('ffma' , a, b, ('ffma', c, d, ('fmul',
'e(is_not_const_and_not_fsign)', 'f(is_not_const_and_not_fsign)'))),
'g(is_not_const)'),
('ffma', a, b, ('ffma', c, d, ('ffma', e, 'f', 'g'))), '(info->stage ==
MESA_SHADER_VERTEX || info->stage == MESA_SHADER_GEOMETRY) &&
!options->intel_vec4'),
(('~fadd', ('ffma(is_used_once)', a, b, ('fmul',
'c(is_not_const_and_not_fsign)', 'd(is_not_const_and_not_fsign)') ),
'e(is_not_const)'),
('ffma', a, b, ('ffma', c, d, e)), '(info->stage != MESA_SHADER_VERTEX &&
info->stage != MESA_SHADER_GEOMETRY) && !options->intel_vec4'),
(('~fadd', ('ffma' , a, b, ('fmul',
'c(is_not_const_and_not_fsign)', 'd(is_not_const_and_not_fsign)') ),
'e(is_not_const)'),
('ffma', a, b, ('ffma', c, d, e)), '(info->stage == MESA_SHADER_VERTEX ||
info->stage == MESA_SHADER_GEOMETRY) && !options->intel_vec4'),
This applies the optimization more broadly in vertex shaders and geometry
shaders to avoid the "some do, some don't" problem. That fixes Shadow Tactics,
but it makes HoF2 worse. While trying to determine which shaders
(INTEL_DEBUG=vs logs about 1,000 shaders) are the root of the problem, I
tweaked the optimization to *not* generate an additional ffma. The second
pattern is changed to:
(('~fadd', ('ffma' , a, b, ('ffma', c, d, ('fmul',
'e(is_not_const_and_not_fsign)', 'f(is_not_const_and_not_fsign)'))),
'g(is_not_const)'),
('ffma', a, b, ('ffma', c, d, ('fadd', ('fmul', e, 'f'), 'g'))),
'(info->stage == MESA_SHADER_VERTEX || info->stage == MESA_SHADER_GEOMETRY) &&
!options->intel_vec4'),
This has the same behavior as the ffma version even though it doesn't have the
extra bit of precision. While you can come up with cases where changing the
order of operations will produce different floating point results, it doesn't
seem like it should occur as frequently as it does in the trace. The still
image only shows a couple spots, but when it's animated, it the dark spots
flicker all over the character's arms. It's an ugly mess. :(
--
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/20190904/2e8c1870/attachment.html>
More information about the intel-3d-bugs
mailing list