From 4fcfed426aa0b44dc4e94ec919428346ff0a33a0 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Mon, 23 Sep 2019 21:20:07 -0700 Subject: [PATCH] lima/ppir: don't attempt to clone tex coords if it's not varying It makes no sense to clone texture coords if it's not varying, moreover we don't support cloning ALU nodes. Fixes: 1c1890fa7077 ("lima/ppir: clone uniforms and load_coords into each successor") Reviewed-by: Andreas Baierl Signed-off-by: Vasily Khoruzhick --- src/gallium/drivers/lima/ir/pp/node.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/lima/ir/pp/node.c b/src/gallium/drivers/lima/ir/pp/node.c index 20c48a1d36a..ded556d87c8 100644 --- a/src/gallium/drivers/lima/ir/pp/node.c +++ b/src/gallium/drivers/lima/ir/pp/node.c @@ -635,9 +635,16 @@ ppir_node_clone_tex(ppir_block *block, ppir_node *node) list_addtail(&new_tnode->node.list, &block->node_list); if (tex_coords) { - new_tex_coords = ppir_node_clone(block, tex_coords); - if (!new_tex_coords) - return NULL; + switch (tex_coords->op) { + case ppir_op_load_varying: + case ppir_op_load_coords: + new_tex_coords = ppir_node_clone(block, tex_coords); + assert(new_tex_coords); + break; + default: + new_tex_coords = tex_coords; + break; + } } ppir_dest *dest = ppir_node_get_dest(node); -- 2.30.2