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 <boris.brezillon@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
This commit is contained in:
Boris Brezillon
2021-06-02 10:23:06 +02:00
parent 04d6c593d0
commit 2dd13257c8
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -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),
+7
View File
@@ -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 {