From edc35c1f54a0f72b6c0f01b2156c10c904459b4f Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Wed, 22 Apr 2020 23:20:26 -0400 Subject: freedreno/ir3: fix 16-bit ssbo access Update cat6 instruction type, and shift 1 in lower_offset_for_ssbo. Signed-off-by: Jonathan Marek Part-of: --- src/freedreno/ir3/ir3_a6xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/freedreno/ir3/ir3_a6xx.c') diff --git a/src/freedreno/ir3/ir3_a6xx.c b/src/freedreno/ir3/ir3_a6xx.c index 23c1970bb36..6f0ba54dc36 100644 --- a/src/freedreno/ir3/ir3_a6xx.c +++ b/src/freedreno/ir3/ir3_a6xx.c @@ -89,7 +89,7 @@ emit_intrinsic_load_ssbo(struct ir3_context *ctx, nir_intrinsic_instr *intr, ldib->regs[0]->wrmask = MASK(intr->num_components); ldib->cat6.iim_val = intr->num_components; ldib->cat6.d = 1; - ldib->cat6.type = TYPE_U32; + ldib->cat6.type = intr->dest.ssa.bit_size == 16 ? TYPE_U16 : TYPE_U32; ldib->barrier_class = IR3_BARRIER_BUFFER_R; ldib->barrier_conflict = IR3_BARRIER_BUFFER_W; handle_bindless_cat6(ldib, intr->src[0]); @@ -118,7 +118,7 @@ emit_intrinsic_store_ssbo(struct ir3_context *ctx, nir_intrinsic_instr *intr) stib = ir3_STIB(b, ssbo_idx(ctx, intr->src[1]), 0, offset, 0, val, 0); stib->cat6.iim_val = ncomp; stib->cat6.d = 1; - stib->cat6.type = TYPE_U32; + stib->cat6.type = intr->src[0].ssa->bit_size == 16 ? TYPE_U16 : TYPE_U32; stib->barrier_class = IR3_BARRIER_BUFFER_W; stib->barrier_conflict = IR3_BARRIER_BUFFER_R | IR3_BARRIER_BUFFER_W; handle_bindless_cat6(stib, intr->src[1]); -- cgit v1.2.3