freedreno: Fix UBO load range detection on booleans.
authorEric Anholt <eric@anholt.net>
Thu, 6 Jun 2019 19:19:06 +0000 (12:19 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 22 Jun 2019 00:14:43 +0000 (17:14 -0700)
NIR 1-bit bool dests will have a bit size of 1, and thus a calculated
"bytes" of 0.  load_ubo is always loading from dwords in the source.

Fixes: 893425a607a6 ("freedreno/ir3: Push UBOs to constant file")
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c

index 312c06446234ca804a816063169f6e07e716e8df..aaf962977b36efcd87ac1828139ada97b11116c0 100644 (file)
@@ -32,8 +32,7 @@ get_ubo_load_range(nir_intrinsic_instr *instr)
 {
        struct ir3_ubo_range r;
 
-       const int bytes = nir_intrinsic_dest_components(instr) *
-               (nir_dest_bit_size(instr->dest) / 8);
+       const int bytes = nir_intrinsic_dest_components(instr) * 4;
 
        r.start = ROUND_DOWN_TO(nir_src_as_uint(instr->src[1]), 16 * 4);
        r.end = ALIGN(r.start + bytes, 16 * 4);