From 8f25d9f821d6f7770b30e8149f502a56325c6540 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Wed, 30 Sep 2020 14:41:54 +0200 Subject: [PATCH] aco/ngg: Allow NGG GS to store ES outputs. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We can reuse the existing ES output code. Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 18cbfc2..6d8feaa 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -4192,9 +4192,10 @@ void visit_store_ls_or_es_output(isel_context *ctx, nir_intrinsic_instr *instr) } else { Temp lds_base; - if (ctx->stage == vertex_geometry_gs || ctx->stage == tess_eval_geometry_gs) { + if (ctx->stage == vertex_geometry_gs || ctx->stage == tess_eval_geometry_gs || + ctx->stage == ngg_vertex_geometry_gs || ctx->stage == ngg_tess_eval_geometry_gs) { /* GFX9+: ES stage is merged into GS, data is passed between them using LDS. */ - unsigned itemsize = ctx->stage == vertex_geometry_gs + unsigned itemsize = (ctx->stage & sw_vs) ? ctx->program->info->vs.es_info.esgs_itemsize : ctx->program->info->tes.es_info.esgs_itemsize; Temp vertex_idx = thread_id_in_threadgroup(ctx); @@ -4305,12 +4306,9 @@ void visit_store_output(isel_context *ctx, nir_intrinsic_instr *instr) isel_err(instr->src[1].ssa->parent_instr, "Unimplemented output offset instruction"); abort(); } - } else if (ctx->stage == vertex_es || - ctx->stage == vertex_ls || - ctx->stage == tess_eval_es || + } else if ((ctx->stage & (hw_ls | hw_es)) || (ctx->stage == vertex_tess_control_hs && ctx->shader->info.stage == MESA_SHADER_VERTEX) || - (ctx->stage == vertex_geometry_gs && ctx->shader->info.stage == MESA_SHADER_VERTEX) || - (ctx->stage == tess_eval_geometry_gs && ctx->shader->info.stage == MESA_SHADER_TESS_EVAL)) { + ((ctx->stage & sw_gs) && ctx->shader->info.stage != MESA_SHADER_GEOMETRY)) { visit_store_ls_or_es_output(ctx, instr); } else if (ctx->shader->info.stage == MESA_SHADER_TESS_CTRL) { visit_store_tcs_output(ctx, instr, false); -- 2.7.4