pan/bi: Fix packing with multiple constants
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 14 Apr 2020 22:32:31 +0000 (18:32 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Apr 2020 20:25:35 +0000 (16:25 -0400)
Need to use bottom nibble of the 64, not the half.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>

src/panfrost/bifrost/bi_pack.c

index 6f0767223c198d05b876f89a74fbd663e3f972b8..f53effc7275dd6fdacca626de00d617628c58806 100644 (file)
@@ -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");