radeonsi: fix a coherency issue when VS memory stores are not visible in PS
authorMarek Olšák <marek.olsak@amd.com>
Tue, 11 May 2021 00:03:04 +0000 (20:03 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 25 May 2021 16:15:44 +0000 (16:15 +0000)
commit805c785314c5749ee5341f3b4bcd492e9c55053d
tree6a0b48e9b282d88d80d601ab62bc01bbc964e4db
parentd8fefb13228256601c3ae04331f1c05828143ed7
radeonsi: fix a coherency issue when VS memory stores are not visible in PS

If a shader has no param exports (no varyings), the pixel shader can start
after the VS position is written before the vertex shader finishes.
The fix is to wait for the memory stores before the position export.

The code needs to be restructured. First prepare param exports to get
nr_param_exports, then emit position exports with the wait, and then
emit param exports.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10813>
src/gallium/drivers/radeonsi/si_shader_llvm_vs.c