From 250b511f8e7c89933af25583398799d7bd61d944 Mon Sep 17 00:00:00 2001 From: Erico Nunes Date: Fri, 15 Jan 2021 01:33:16 +0100 Subject: [PATCH] lima/ppir: fix creation of mov node for non-ssa tex dest In ppir when a texture node has only a single successor, it is used directly to output the texture lookup value, in order to save the insertion of a mov. However, a sequence like this can happen: r0 = (float)tex r8 (coord), 0 (texture), 0 (sampler) r1 = mov r0.z In this case, even if the mov is a single successor, the assumption that only the elements needed by the successor node cannot be made. The target register can also be read or written elsewhere and so the simplification cannot be made. Add an exception to cover this case. Signed-off-by: Erico Nunes Reviewed-by: Andreas Baierl Reviewed-by: Vasily Khoruzhick Part-of: --- src/gallium/drivers/lima/ir/pp/lower.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/lima/ir/pp/lower.c b/src/gallium/drivers/lima/ir/pp/lower.c index 2480d79ffc0..c16d0f19147 100644 --- a/src/gallium/drivers/lima/ir/pp/lower.c +++ b/src/gallium/drivers/lima/ir/pp/lower.c @@ -162,7 +162,7 @@ static bool ppir_lower_texture(ppir_block *block, ppir_node *node) { ppir_dest *dest = ppir_node_get_dest(node); - if (ppir_node_has_single_succ(node)) { + if (ppir_node_has_single_succ(node) && dest->type == ppir_target_ssa) { ppir_node *succ = ppir_node_first_succ(node); dest->type = ppir_target_pipeline; dest->pipeline = ppir_pipeline_reg_sampler;