radv: fix handling ViewportIndex with GPL
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 20 Sep 2022 09:40:35 +0000 (11:40 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 27 Sep 2022 11:38:06 +0000 (11:38 +0000)
commit630bb53e68e8c150c99d01fdbf1806aba790af70
tree08adefae8cb1f0a2332f691c1d68cdbd5d5ddf7a
parent515847b2a7a79a7a9eb23004f8f71bfc52a3ba55
radv: fix handling ViewportIndex with GPL

When the fragment shader reads the viewport index as input and the last
pre-rasterization stage doesn't export it, it should be implicitly
zero (ie. first viewport). When the next stage is known, it's already
lowered in NIR, but with GPL we can't because we don't know if the FS
reads it. To fix this use AC_EXP_PARAM_DEFAULT_VAL_000.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18699>
src/amd/vulkan/radv_pipeline.c