pan/bi: Specialize BLEND emit for Valhall

Fewer arguments compared to Bifrost; the corresponding information is encoded in
a Valhall-specific blend shader prologue instead.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15793>
This commit is contained in:
Alyssa Rosenzweig
2021-07-29 17:39:14 -04:00
committed by Marge Bot
parent a8afe6f7fb
commit 9091b6261b

View File

@@ -512,6 +512,9 @@ static void
bi_emit_blend_op(bi_builder *b, bi_index rgba, nir_alu_type T,
bi_index rgba2, nir_alu_type T2, unsigned rt)
{
/* On Valhall, BLEND does not encode the return address */
bool bifrost = b->shader->arch <= 8;
/* Reads 2 or 4 staging registers to cover the input */
unsigned size = nir_alu_type_get_type_size(T);
unsigned size_2 = nir_alu_type_get_type_size(T2);
@@ -535,18 +538,24 @@ bi_emit_blend_op(bi_builder *b, bi_index rgba, nir_alu_type T,
} else if (b->shader->inputs->is_blend) {
uint64_t blend_desc = b->shader->inputs->blend.bifrost_blend_desc;
bi_index desc = bi_temp(b->shader);
bi_mov_i32_to(b, bi_word(desc, 0), bi_imm_u32(blend_desc));
bi_mov_i32_to(b, bi_word(desc, 1), bi_imm_u32(blend_desc >> 32));
/* Blend descriptor comes from the compile inputs */
/* Put the result in r0 */
bi_blend_to(b, bi_register(0), rgba,
bi_blend_to(b, bifrost ? bi_register(0) : bi_null(), rgba,
bi_register(60),
bi_imm_u32(blend_desc & 0xffffffff),
bi_imm_u32(blend_desc >> 32),
bi_word(desc, 0),
bi_word(desc, 1),
bi_null(), regfmt, sr_count, 0);
} else {
/* Blend descriptor comes from the FAU RAM. By convention, the
* return address is stored in r48 and will be used by the
* blend shader to jump back to the fragment shader after */
bi_blend_to(b, bi_register(48), rgba,
* return address on Bifrost is stored in r48 and will be used
* by the blend shader to jump back to the fragment shader */
bi_blend_to(b, bifrost ? bi_register(48) : bi_null(), rgba,
bi_register(60),
bi_fau(BIR_FAU_BLEND_0 + rt, false),
bi_fau(BIR_FAU_BLEND_0 + rt, true),