From 023d7fc76ddf707b6fc1956218510379f41dd9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Mon, 25 Mar 2024 15:17:05 +0100 Subject: [PATCH] aco: Use tess factors when TCS jumps to epilog. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 63ae718f47b..e74001b0a86 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -11284,7 +11284,7 @@ create_tcs_jump_to_epilog(isel_context* ctx) Temp continue_pc = convert_pointer_to_64_bit(ctx, get_arg(ctx, ctx->program->info.epilog_pc)); aco_ptr jump{ - create_instruction(aco_opcode::p_jump_to_epilog, Format::PSEUDO, 9, 0)}; + create_instruction(aco_opcode::p_jump_to_epilog, Format::PSEUDO, 15, 0)}; jump->operands[0] = Operand(continue_pc); jump->operands[1] = ring_offsets; jump->operands[2] = tess_offchip_offset; @@ -11294,6 +11294,16 @@ create_tcs_jump_to_epilog(isel_context* ctx) jump->operands[6] = tcs_out_current_patch_data_offset; jump->operands[7] = invocation_id; jump->operands[8] = rel_patch_id; + + for (unsigned i = 0; i < 4; ++i) { + Temp t = ctx->outputs.temps[VARYING_SLOT_TESS_LEVEL_OUTER * 4 + i]; + jump->operands[9 + i] = t.id() ? Operand(t, vgpr_start.advance(12 + (i * 4))) : Operand(); + } + for (unsigned i = 0; i < 2; ++i) { + Temp t = ctx->outputs.temps[VARYING_SLOT_TESS_LEVEL_INNER * 4 + i]; + jump->operands[13 + i] = t.id() ? Operand(t, vgpr_start.advance(28 + (i * 4))) : Operand(); + } + ctx->block->instructions.emplace_back(std::move(jump)); }