aco: add missing usable_read2 check
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 26 Feb 2021 16:05:40 +0000 (16:05 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 2 Mar 2021 13:13:59 +0000 (13:13 +0000)
commit3a72044ece27f6a06d7819bcd6ba3fcc2f786d0c
treead3cb5a785de17385bff513007a0b14b5b0574eb
parent941739619e1f7841aee8048e6a046377b39b19b0
aco: add missing usable_read2 check

A Hitman 2 shader does: read64(local_invocation_index() * 4 - 4). This was
likely emitting a ds_read2_b32 on GFX6. For local_invocation_index()=0,
because the first dword was out-of-bounds, the second was likely also
considered out-of-bounds (even though it's not, at offset 0).

Likely fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/3882

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 57e6886f981 ("aco: refactor load_lds to use new helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9332>
src/amd/compiler/aco_instruction_selection.cpp