From 10fb5fb460b83f0cc2eca24557fbddf32cb1d0a9 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 14 Apr 2020 18:32:31 -0400 Subject: [PATCH] pan/bi: Fix packing with multiple constants Need to use bottom nibble of the 64, not the half. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 6f0767223c1..f53effc7275 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -164,7 +164,8 @@ bi_assign_uniform_constant_single( bool b64 = nir_alu_type_get_type_size(ins->src_types[s]) > 32; uint64_t cons = bi_get_immediate(ins, s); unsigned idx = bi_lookup_constant(clause, cons, &hi, b64); - unsigned f = bi_constant_field(idx) | (cons & 0xF); + unsigned lo = clause->constants[idx] & 0xF; + unsigned f = bi_constant_field(idx) | lo; if (assigned && regs->uniform_constant != f) unreachable("Mismatched uniform/const field: imm"); -- 2.30.2