From 9c3d8404deaab24e1a4186035398250dbd6f542b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Mon, 14 Sep 2020 09:58:56 +0200 Subject: [PATCH] aco/ngg: Allow NGG GS to create VS exports. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NGG GS need to use the same instructions to export vertex attributes at the end. Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 83105173019..f613184ba87 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -9741,13 +9741,9 @@ static void create_null_export(isel_context *ctx) static bool export_vs_varying(isel_context *ctx, int slot, bool is_pos, int *next_pos) { - assert(ctx->stage == vertex_vs || - ctx->stage == tess_eval_vs || - ctx->stage == gs_copy_vs || - ctx->stage == ngg_vertex_gs || - ctx->stage == ngg_tess_eval_gs); + assert(ctx->stage & (hw_vs | hw_ngg_gs)); - int offset = (ctx->stage & sw_tes) + int offset = ((ctx->stage & sw_tes) && !(ctx->stage & sw_gs)) ? 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]; @@ -9844,13 +9840,9 @@ static void create_export_phis(isel_context *ctx) static void create_vs_exports(isel_context *ctx) { - assert(ctx->stage == vertex_vs || - ctx->stage == tess_eval_vs || - ctx->stage == gs_copy_vs || - ctx->stage == ngg_vertex_gs || - ctx->stage == ngg_tess_eval_gs); + assert(ctx->stage & (hw_vs | hw_ngg_gs)); - radv_vs_output_info *outinfo = (ctx->stage & sw_tes) + radv_vs_output_info *outinfo = ((ctx->stage & sw_tes) && !(ctx->stage & sw_gs)) ? &ctx->program->info->tes.outinfo : &ctx->program->info->vs.outinfo;