From 1d9d1cbce9cda14bada3723134c651c226002012 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Thu, 27 Feb 2020 19:59:37 +0100 Subject: [PATCH] aco: Use TES output info when TES runs on the VS stage. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index efd4058e254..72c5284437b 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -8816,7 +8816,13 @@ static void visit_cf_list(isel_context *ctx, static void export_vs_varying(isel_context *ctx, int slot, bool is_pos, int *next_pos) { - int offset = ctx->program->info->vs.outinfo.vs_output_param_offset[slot]; + assert(ctx->stage == vertex_vs || + ctx->stage == tess_eval_vs || + ctx->stage == gs_copy_vs); + + int offset = ctx->stage == tess_eval_vs + ? ctx->program->info->tes.outinfo.vs_output_param_offset[slot] + : ctx->program->info->vs.outinfo.vs_output_param_offset[slot]; uint64_t mask = ctx->outputs.mask[slot]; if (!is_pos && !mask) return; @@ -8882,7 +8888,13 @@ static void export_vs_psiz_layer_viewport(isel_context *ctx, int *next_pos) static void create_vs_exports(isel_context *ctx) { - radv_vs_output_info *outinfo = &ctx->program->info->vs.outinfo; + assert(ctx->stage == vertex_vs || + ctx->stage == tess_eval_vs || + ctx->stage == gs_copy_vs); + + radv_vs_output_info *outinfo = ctx->stage == tess_eval_vs + ? &ctx->program->info->tes.outinfo + : &ctx->program->info->vs.outinfo; if (outinfo->export_prim_id) { ctx->outputs.mask[VARYING_SLOT_PRIMITIVE_ID] |= 0x1; @@ -9586,7 +9598,7 @@ void select_program(Program *program, if (ctx.program->info->so.num_outputs && ctx.stage == vertex_vs) emit_streamout(&ctx, 0); - if (ctx.stage == vertex_vs) { + if (ctx.stage == vertex_vs || ctx.stage == tess_eval_vs) { create_vs_exports(&ctx); } else if (nir->info.stage == MESA_SHADER_GEOMETRY) { Builder bld(ctx.program, ctx.block); -- 2.30.2