lima/ppir: set write mask for texture loads if dest is reg
authorVasily Khoruzhick <anarsoul@gmail.com>
Mon, 19 Aug 2019 05:48:22 +0000 (22:48 -0700)
committerVasily Khoruzhick <anarsoul@gmail.com>
Sat, 24 Aug 2019 01:19:47 +0000 (18:19 -0700)
Destination for texture load can be a reg, so we need to
set write mask in this case

Tested-by: Andreas Baierl <ichgeh@imkreisrum.de>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
src/gallium/drivers/lima/ir/pp/nir.c

index 45d8c9b28196b23af54bc56c73f223fe8aa6b0e6..d1a8bc140b69b715a7b8742ae1f9032014d56af8 100644 (file)
@@ -395,7 +395,11 @@ static ppir_node *ppir_emit_tex(ppir_block *block, nir_instr *ni)
       return NULL;
    }
 
-   node = ppir_node_create_dest(block, ppir_op_load_texture, &instr->dest, 0);
+   unsigned mask = 0;
+   if (!instr->dest.is_ssa)
+      mask = u_bit_consecutive(0, nir_tex_instr_dest_size(instr));
+
+   node = ppir_node_create_dest(block, ppir_op_load_texture, &instr->dest, mask);
    if (!node)
       return NULL;