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: 2e57684d2d ("pan/bi: Implement load_ubo with the builder")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9071>
(cherry picked from commit 9bb376bbdb)
This commit is contained in:
Icecream95 2021-02-11 23:51:10 +13:00 committed by Dylan Baker
parent 379d31bc6c
commit eca7fc490c
2 changed files with 2 additions and 2 deletions

View file

@ -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"
},

View file

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