Mesa (master): pan/bi: Use the correct size for UBO loads

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 16 13:24:56 UTC 2021


Module: Mesa
Branch: master
Commit: 9bb376bbdb7ad1f49737cb9f736a1bf68da94eda
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9bb376bbdb7ad1f49737cb9f736a1bf68da94eda

Author: Icecream95 <ixn at disroot.org>
Date:   Thu Feb 11 23:51:10 2021 +1300

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 <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9071>

---

 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]),



More information about the mesa-commit mailing list