radv/llvm: fix exporting the viewport index if the fragment shader needs it
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 15 Apr 2020 06:37:40 +0000 (08:37 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 17 Apr 2020 16:23:24 +0000 (16:23 +0000)
It's like the layer, it has to be exported via the pos and also
as a varying if the fragment shader reads it.

Fixes dEQP-VK.draw.shader_viewport_index.fragment_shader_*

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4564>

src/amd/vulkan/radv_nir_to_llvm.c

index 900246d275ef57a13cf3240a1ae7360cfa45b573..85128ed07981fd2473d85621b3da3f1b2c312103 100644 (file)
@@ -1772,6 +1772,7 @@ radv_build_param_exports(struct radv_shader_context *ctx,
 
                if (slot_name != VARYING_SLOT_LAYER &&
                    slot_name != VARYING_SLOT_PRIMITIVE_ID &&
+                   slot_name != VARYING_SLOT_VIEWPORT &&
                    slot_name != VARYING_SLOT_CLIP_DIST0 &&
                    slot_name != VARYING_SLOT_CLIP_DIST1 &&
                    slot_name < VARYING_SLOT_VAR0)