vc4: Use the original bit size when scalarizing uniform loads.
authorEric Anholt <eric@anholt.net>
Sun, 16 Dec 2018 03:42:57 +0000 (19:42 -0800)
committerJason Ekstrand <jason@jlekstrand.net>
Sun, 16 Dec 2018 21:03:01 +0000 (21:03 +0000)
Prevents a regression in jekstrand's 1-bit series.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/gallium/drivers/vc4/vc4_nir_lower_io.c

index b7969a562a6bc20302a56ac5be2a7dee3ebd253f..fc2baee1b9a7de25ad5dafe69b3740bcdbe5dda9 100644 (file)
@@ -330,7 +330,8 @@ vc4_nir_lower_uniform(struct vc4_compile *c, nir_builder *b,
                 nir_intrinsic_instr *intr_comp =
                         nir_intrinsic_instr_create(c->s, intr->intrinsic);
                 intr_comp->num_components = 1;
-                nir_ssa_dest_init(&intr_comp->instr, &intr_comp->dest, 1, 32, NULL);
+                nir_ssa_dest_init(&intr_comp->instr, &intr_comp->dest, 1,
+                                  intr->dest.ssa.bit_size, NULL);
 
                 /* Convert the uniform offset to bytes.  If it happens
                  * to be a constant, constant-folding will clean up