}
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);
}
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:
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;
[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,
.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,