From b999e41250e508ee267a8bbb29a4080f42ed8b7d Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Wed, 23 Aug 2023 07:51:57 -0700 Subject: [PATCH] lima: ppir: always use vec4 for output register gl_FragDepth is a float, but the hardware still uses a vec4 register, .x component for depth and another component for stencil, so we have to always allocate a vec4 for output. Backport-to: 23.3 Backport-to: 24.0 Reviewed-by: Erico Nunes Part-of: --- src/gallium/drivers/lima/ir/pp/nir.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/lima/ir/pp/nir.c b/src/gallium/drivers/lima/ir/pp/nir.c index 3bc129beda9..517ec628b41 100644 --- a/src/gallium/drivers/lima/ir/pp/nir.c +++ b/src/gallium/drivers/lima/ir/pp/nir.c @@ -403,6 +403,8 @@ static bool ppir_emit_intrinsic(ppir_block *block, nir_instr *ni) default: { ppir_dest *dest = ppir_node_get_dest(node); dest->ssa.out_type = out_type; + dest->ssa.num_components = 4; + dest->write_mask = u_bit_consecutive(0, 4); node->is_out = 1; return true; } @@ -415,9 +417,9 @@ static bool ppir_emit_intrinsic(ppir_block *block, nir_instr *ni) ppir_dest *dest = ppir_node_get_dest(&alu_node->node); dest->type = ppir_target_ssa; - dest->ssa.num_components = instr->num_components; + dest->ssa.num_components = 4; dest->ssa.index = 0; - dest->write_mask = u_bit_consecutive(0, instr->num_components); + dest->write_mask = u_bit_consecutive(0, 4); dest->ssa.out_type = out_type; alu_node->num_src = 1; @@ -427,7 +429,7 @@ static bool ppir_emit_intrinsic(ppir_block *block, nir_instr *ni) nir_legacy_src legacy_src = nir_legacy_chase_src(instr->src); ppir_node_add_src(block->comp, &alu_node->node, alu_node->src, &legacy_src, - u_bit_consecutive(0, instr->num_components)); + u_bit_consecutive(0, 4)); alu_node->node.is_out = 1;