lima/ppir: fix alignment on regalloc spilling loads
authorErico Nunes <nunes.erico@gmail.com>
Sun, 21 Jul 2019 22:55:24 +0000 (00:55 +0200)
committerErico Nunes <nunes.erico@gmail.com>
Tue, 23 Jul 2019 08:24:19 +0000 (08:24 +0000)
The spilling code spills entire vec4 registers regardless of the
components used by the spilled uses.
The inserted stores code force the 4 components, but these loads were
using a variable number of components, causing bugs on loading the
spilled registers.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
src/gallium/drivers/lima/ir/pp/regalloc.c

index 62401150e3e6ce87af745dbd2d36e636867e4608..3bd8569cf151f6eca16eb8620234e4520e6641dd 100644 (file)
@@ -410,7 +410,7 @@ static ppir_alu_node* ppir_update_spilled_src(ppir_compiler *comp,
    ppir_load_node *load = ppir_node_to_load(load_node);
 
    load->index = -comp->prog->stack_size; /* index sizes are negative */
-   load->num_components = src->reg->num_components;
+   load->num_components = 4;
 
    ppir_dest *ld_dest = &load->dest;
    ld_dest->type = ppir_target_pipeline;