diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2020-04-15 08:49:32 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-04-20 10:01:27 -0700 |
commit | 9d052b2534b4a01804d447f7db6360fa3997623e (patch) | |
tree | fb99b384cd7c6bb42f3b0a3d2cc318a6de329d8e | |
parent | 5cd2b945df2ee45a83218211683aaab5201b6c2c (diff) |
aco: fix exporting the viewport index if the fragment shader needs it
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>
(cherry picked from commit c4ca9e66ddb507831b2d35e927d6310775006894)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 6 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection_setup.cpp | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/.pick_status.json b/.pick_status.json index 14cdf1ccf0a..8acad3bed5d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -823,7 +823,7 @@ "description": "aco: fix exporting the viewport index if the fragment shader needs it", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index e9514345266..0b69eb51c89 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -8438,8 +8438,10 @@ static void create_vs_exports(isel_context *ctx) } for (unsigned i = 0; i <= VARYING_SLOT_VAR31; ++i) { - if (i < VARYING_SLOT_VAR0 && i != VARYING_SLOT_LAYER && - i != VARYING_SLOT_PRIMITIVE_ID) + if (i < VARYING_SLOT_VAR0 && + i != VARYING_SLOT_LAYER && + i != VARYING_SLOT_PRIMITIVE_ID && + i != VARYING_SLOT_VIEWPORT) continue; export_vs_varying(ctx, i, false, NULL); diff --git a/src/amd/compiler/aco_instruction_selection_setup.cpp b/src/amd/compiler/aco_instruction_selection_setup.cpp index 347b32deb60..5c74728ef2d 100644 --- a/src/amd/compiler/aco_instruction_selection_setup.cpp +++ b/src/amd/compiler/aco_instruction_selection_setup.cpp @@ -782,7 +782,8 @@ setup_vs_output_info(isel_context *ctx, nir_shader *nir, uint64_t mask = ctx->output_masks[nir->info.stage]; while (mask) { int idx = u_bit_scan64(&mask); - if (idx >= VARYING_SLOT_VAR0 || idx == VARYING_SLOT_LAYER || idx == VARYING_SLOT_PRIMITIVE_ID || + if (idx >= VARYING_SLOT_VAR0 || idx == VARYING_SLOT_LAYER || + idx == VARYING_SLOT_PRIMITIVE_ID || idx == VARYING_SLOT_VIEWPORT || ((idx == VARYING_SLOT_CLIP_DIST0 || idx == VARYING_SLOT_CLIP_DIST1) && export_clip_dists)) { if (outinfo->vs_output_param_offset[idx] == AC_EXP_PARAM_UNDEFINED) outinfo->vs_output_param_offset[idx] = outinfo->param_exports++; |