diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 5d5aeca6b14..edc2e5ea7bd 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -990,16 +990,18 @@ panfrost_upload_multisampled_sysval(struct panfrost_batch *batch, } static void -panfrost_upload_rt_conversion_sysval(struct panfrost_batch *batch, unsigned rt, - struct sysval_uniform *uniform) +panfrost_upload_rt_conversion_sysval(struct panfrost_batch *batch, + unsigned size_and_rt, struct sysval_uniform *uniform) { struct panfrost_context *ctx = batch->ctx; struct panfrost_device *dev = pan_device(ctx->base.screen); + unsigned rt = size_and_rt & 0xF; + unsigned size = size_and_rt >> 4; if (rt < batch->key.nr_cbufs && batch->key.cbufs[rt]) { enum pipe_format format = batch->key.cbufs[rt]->format; uniform->u[0] = - pan_blend_get_bifrost_desc(dev, format, rt, 32) >> 32; + pan_blend_get_bifrost_desc(dev, format, rt, size) >> 32; } else { pan_pack(&uniform->u[0], BIFROST_INTERNAL_CONVERSION, cfg) cfg.memory_format = dev->formats[PIPE_FORMAT_NONE].hw; diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 7352a1ed181..a27a7dc8b6a 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -920,6 +920,7 @@ static void bi_emit_ld_tile(bi_builder *b, nir_intrinsic_instr *instr) { unsigned rt = b->shader->inputs->blend.rt; + unsigned size = nir_dest_bit_size(instr->dest); /* Get the render target */ if (!b->shader->inputs->is_blend) { @@ -943,7 +944,7 @@ bi_emit_ld_tile(bi_builder *b, nir_intrinsic_instr *instr) bi_index desc = b->shader->inputs->is_blend ? bi_imm_u32(b->shader->inputs->blend.bifrost_blend_desc >> 32) : - bi_load_sysval(b, PAN_SYSVAL(RT_CONVERSION, rt), 1, 0); + bi_load_sysval(b, PAN_SYSVAL(RT_CONVERSION, rt | (size << 4)), 1, 0); uint32_t indices = 0; memcpy(&indices, &pix, sizeof(indices));