aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima/ir
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/lima/ir')
-rw-r--r--src/gallium/drivers/lima/ir/pp/lower.c19
-rw-r--r--src/gallium/drivers/lima/ir/pp/nir.c1
2 files changed, 18 insertions, 2 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/lower.c b/src/gallium/drivers/lima/ir/pp/lower.c
index ada735a160e..2480d79ffc0 100644
--- a/src/gallium/drivers/lima/ir/pp/lower.c
+++ b/src/gallium/drivers/lima/ir/pp/lower.c
@@ -162,7 +162,22 @@ static bool ppir_lower_texture(ppir_block *block, ppir_node *node)
{
ppir_dest *dest = ppir_node_get_dest(node);
- /* Always create move node since there can be successors in other blocks */
+ if (ppir_node_has_single_succ(node)) {
+ ppir_node *succ = ppir_node_first_succ(node);
+ dest->type = ppir_target_pipeline;
+ dest->pipeline = ppir_pipeline_reg_sampler;
+
+ for (int i = 0; i < ppir_node_get_src_num(succ); i++) {
+ ppir_src *src = ppir_node_get_src(succ, i);
+ if (src && src->node == node) {
+ src->type = ppir_target_pipeline;
+ src->pipeline = ppir_pipeline_reg_sampler;
+ }
+ }
+ return true;
+ }
+
+ /* Create move node as fallback */
ppir_node *move = ppir_node_insert_mov(node);
if (unlikely(!move))
return false;
@@ -170,7 +185,7 @@ static bool ppir_lower_texture(ppir_block *block, ppir_node *node)
ppir_debug("lower texture create move %d for %d\n",
move->index, node->index);
- ppir_src *mov_src= ppir_node_get_src(move, 0);
+ ppir_src *mov_src = ppir_node_get_src(move, 0);
mov_src->type = dest->type = ppir_target_pipeline;
mov_src->pipeline = dest->pipeline = ppir_pipeline_reg_sampler;
diff --git a/src/gallium/drivers/lima/ir/pp/nir.c b/src/gallium/drivers/lima/ir/pp/nir.c
index bb42c35dd76..a2f3406e414 100644
--- a/src/gallium/drivers/lima/ir/pp/nir.c
+++ b/src/gallium/drivers/lima/ir/pp/nir.c
@@ -349,6 +349,7 @@ static bool ppir_emit_intrinsic(ppir_block *block, nir_instr *ni)
node = block->comp->var_nodes[instr->src->ssa->index];
switch (node->op) {
case ppir_op_load_uniform:
+ case ppir_op_load_texture:
case ppir_op_const:
break;
default: