From: Rob Clark Date: Mon, 4 Feb 2019 15:22:38 +0000 (-0500) Subject: freedreno/ir3: fix ncomp for _store_image() src X-Git-Tag: upstream/19.3.0~9739 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75f3a5245e54d1be5b75db66ba50d7c2f5dee4fc;p=platform%2Fupstream%2Fmesa.git freedreno/ir3: fix ncomp for _store_image() src Signed-off-by: Rob Clark --- diff --git a/src/freedreno/ir3/ir3_a4xx.c b/src/freedreno/ir3/ir3_a4xx.c index a327a5c..dfaeb5b 100644 --- a/src/freedreno/ir3/ir3_a4xx.c +++ b/src/freedreno/ir3/ir3_a4xx.c @@ -263,6 +263,7 @@ emit_intrinsic_store_image(struct ir3_context *ctx, nir_intrinsic_instr *intr) struct ir3_instruction * const *coords = ir3_get_src(ctx, &intr->src[1]); unsigned ncoords = ir3_get_image_coords(var, NULL); unsigned tex_idx = ir3_get_image_slot(ctx, nir_src_as_deref(intr->src[0])); + unsigned ncomp = ir3_get_num_components_for_glformat(var->data.image.format); /* src0 is value * src1 is coords @@ -277,10 +278,10 @@ emit_intrinsic_store_image(struct ir3_context *ctx, nir_intrinsic_instr *intr) */ stib = ir3_STIB(b, create_immed(b, tex_idx), 0, - ir3_create_collect(ctx, value, 4), 0, + ir3_create_collect(ctx, value, ncomp), 0, ir3_create_collect(ctx, coords, ncoords), 0, offset, 0); - stib->cat6.iim_val = 4; + stib->cat6.iim_val = ncomp; stib->cat6.d = ncoords; stib->cat6.type = ir3_get_image_type(var); stib->cat6.typed = true;