From eca7fc490c6a6c484055258bd92908d6b995e1eb 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: (cherry picked from commit 9bb376bbdb7ad1f49737cb9f736a1bf68da94eda) --- .pick_status.json | 2 +- src/panfrost/bifrost/bifrost_compile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bf5aa124b92..214c2a387f2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1264,7 +1264,7 @@ "description": "pan/bi: Use the correct size for UBO loads", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "2e57684d2d3ec6ddf5f0e1158af549983c306a3c" }, diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index d8be3efb954..c3ee0e7718d 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -509,7 +509,7 @@ bi_emit_load_ubo(bi_builder *b, nir_intrinsic_instr *instr) } } - 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, bi_src_index(&instr->src[0]),