radv: make sure to export the viewport index if FS needs it
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Apr 2020 20:21:55 +0000 (22:21 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Apr 2020 08:10:25 +0000 (08:10 +0000)
commit7086b38c81ebe2f0520461c1bc1a7b92863cf871
tree7a014e5f65afd05f464cca1c50e36faf12439b8d
parent133efa112dfa08f8f28ea2dde42a6072140cd977
radv: make sure to export the viewport index if FS needs it

If FS reads gl_ViewportIndex but VS doesn't export it, it should
be zero to avoid reading garbage.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2818
Fixes: b424d49ac05 ("radv/llvm: fix exporting the viewport index if the fragment shader needs it")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4687>
src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.h
src/amd/vulkan/radv_shader_info.c