radv: apply the indexing workaround for atomic buffer operations on GFX9
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 3 May 2019 09:45:34 +0000 (11:45 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 3 May 2019 15:59:12 +0000 (17:59 +0200)
commit4f18c43d1df64135e8968a7d4fbfd2c9918b76ae
treeefd2296ec3caf159bf2a2102478594ab145c2ed2
parente340d7beef9573facc53f3eeece640b2a14a15f5
radv: apply the indexing workaround for atomic buffer operations on GFX9

Because the new raw/struct intrinsics are buggy with LLVM 8
(they weren't marked as source of divergence), we fallback to the
old instrinsics for atomic buffer operations only. This means we need
to apply the indexing workaround for GFX9. The load/store
operations still use the new LLVM 8 intrinsics.

The fact that we need another workaround is painful but we should
be able to clean up that a bit once LLVM 7 support will be dropped.

This fixes a GPU hang with AC Odyssey and some rendering problems
with Nioh.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110573
Fixes: 31164cf5f70 ("ac/nir: only use the new raw/struct image atomic intrinsics with LLVM 9+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_shader_abi.h
src/amd/vulkan/radv_nir_to_llvm.c