From 2dd13257c88d2b453b91f2f78129851cf3574392 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 2 Jun 2021 10:23:06 +0200 Subject: [PATCH] pan/bi: Allow passing RT conversion descriptors to fragment shaders The Vulkan copy shaders sometimes need to partially write a texel and issue a load on the FRAGOUT variable in that case, but they do know the format of the tile buffer in advance in that case. Let's not add an RT_CONVERSION sysval if we can avoid it. Signed-off-by: Boris Brezillon Acked-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 2 ++ src/panfrost/util/pan_ir.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 3c4cf106d5e..92c7c86becc 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1078,6 +1078,8 @@ 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) : + b->shader->inputs->bifrost.static_rt_conv ? + bi_imm_u32(b->shader->inputs->bifrost.rt_conv[rt]) : bi_load_sysval(b, PAN_SYSVAL(RT_CONVERSION, rt | (size << 4)), 1, 0); bi_ld_tile_to(b, bi_dest_index(&instr->dest), bi_pixel_indices(b, rt), diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 1ff240b3070..c4425c49b2d 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -132,6 +132,13 @@ struct panfrost_compile_inputs { enum pipe_format rt_formats[8]; unsigned nr_cbufs; + + union { + struct { + bool static_rt_conv; + uint32_t rt_conv[8]; + } bifrost; + }; }; struct pan_shader_varying {