From 9bb376bbdb7ad1f49737cb9f736a1bf68da94eda Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Thu, 11 Feb 2021 23:51:10 +1300 Subject: [PATCH] pan/bi: Use the correct size for UBO loads Multiply by the destination bit size to get the number of bits to load instead of assuming 32 bits. Fixes: 2e57684d2d3 ("pan/bi: Implement load_ubo with the builder") Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 68a4a928f3e..3b62029a008 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -550,7 +550,7 @@ bi_emit_load_ubo(bi_builder *b, nir_intrinsic_instr *instr) uint32_t const_offset = offset_is_const ? nir_src_as_uint(*offset) : 0; bool kernel_input = (instr->intrinsic == nir_intrinsic_load_kernel_input); - bi_load_to(b, instr->num_components * 32, + bi_load_to(b, instr->num_components * nir_dest_bit_size(instr->dest), bi_dest_index(&instr->dest), offset_is_const ? bi_imm_u32(const_offset) : dyn_offset, kernel_input ? bi_zero() : bi_src_index(&instr->src[0]),