diff options
author | Samuel Pitoiset <[email protected]> | 2020-04-15 08:49:32 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-17 16:23:24 +0000 |
commit | c4ca9e66ddb507831b2d35e927d6310775006894 (patch) | |
tree | 1674b3cc8c6b5a15d663e58a6b6ec549050c99e9 | |
parent | b424d49ac05563fd7d9f217fae9c25fc602f4330 (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: <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Rhys Perry <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4564>
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 3 | ||||
-rw-r--r-- | src/amd/compiler/aco_instruction_selection_setup.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 8552b06bf89..b4db7a0d66d 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9769,7 +9769,8 @@ 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) + 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 dba3bf075f1..7d404b42568 100644 --- a/src/amd/compiler/aco_instruction_selection_setup.cpp +++ b/src/amd/compiler/aco_instruction_selection_setup.cpp @@ -751,7 +751,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++; |