panfrost: Fix BI_BLEND packing

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4505>
This commit is contained in:
Alyssa Rosenzweig
2020-04-09 23:04:41 -04:00
committed by Tomeu Vizoso
parent e34add229f
commit 3439c24bdb
4 changed files with 15 additions and 8 deletions

View File

@@ -1014,16 +1014,17 @@ bi_pack_add_atest(bi_clause *clause, bi_instruction *ins, struct bi_registers *r
}
static unsigned
bi_pack_add_blend(bi_instruction *ins, struct bi_registers *regs)
bi_pack_add_blend(bi_clause *clause, bi_instruction *ins, struct bi_registers *regs)
{
struct bifrost_add_inst pack = {
.src0 = bi_get_src(ins, regs, 0, false),
.src0 = bi_get_src(ins, regs, 1, false),
.op = BIFROST_ADD_OP_BLEND
};
/* TODO: Pack location in uniform_const */
assert(ins->blend_location == 0);
bi_read_data_register(clause, ins);
RETURN_PACKED(pack);
}
@@ -1065,7 +1066,7 @@ bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs)
case BI_CMP:
return BIFROST_ADD_NOP;
case BI_BLEND:
return bi_pack_add_blend(bundle.add, regs);
return bi_pack_add_blend(clause, bundle.add, regs);
case BI_BITWISE:
case BI_CONVERT:
case BI_DISCARD:

View File

@@ -156,6 +156,12 @@ bi_schedule(bi_context *ctx)
u->data_register_write_barrier = true;
}
if (ins->type == BI_ATEST)
u->dependencies |= (1 << 6);
if (ins->type == BI_BLEND)
u->dependencies |= (1 << 6) | (1 << 7);
ids = ids & 1;
last_id = u->scoreboard_id;
u->back_to_back = false;

View File

@@ -31,7 +31,7 @@ unsigned bi_class_props[BI_NUM_CLASSES] = {
[BI_ATEST] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD,
[BI_BRANCH] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD,
[BI_CMP] = BI_GENERIC | BI_MODS | BI_SCHED_ALL,
[BI_BLEND] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR,
[BI_BLEND] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR | BI_DATA_REG_SRC,
[BI_BITWISE] = BI_GENERIC | BI_SCHED_ALL,
[BI_COMBINE] = 0,
[BI_CONVERT] = BI_SCHED_ALL | BI_SWIZZLABLE,

View File

@@ -147,16 +147,16 @@ bi_emit_frag_out(bi_context *ctx, nir_intrinsic_instr *instr)
.type = BI_BLEND,
.blend_location = nir_intrinsic_base(instr),
.src = {
bir_src_index(&instr->src[0]),
BIR_INDEX_REGISTER | 60 /* Can this be arbitrary? */,
bir_src_index(&instr->src[0])
},
.src_types = {
nir_type_uint32,
nir_type_float32,
nir_type_uint32
},
.swizzle = {
{ 0 },
{ 0, 1, 2, 3 }
{ 0, 1, 2, 3 },
{ 0 }
},
.dest = BIR_INDEX_REGISTER | 48 /* Looks like magic */,
.dest_type = nir_type_uint32,