Commit 375a7d0f authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜 Committed by Marge Bot
Browse files

pan/bi: Ignore swizzle in unwritten component



Otherwise we can trip the assert for no good reason.
Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!4382>
parent aa77d812
......@@ -128,6 +128,10 @@ bi_adjust_src_ra(bi_instruction *ins, struct lcra_state *l, unsigned src)
unsigned components = bi_get_component_count(ins, src);
for (unsigned i = 0; i < components; ++i) {
/* If we're not writing the component, who cares? */
if (!bi_writes_component(ins, i))
continue;
unsigned off = ins->swizzle[src][i] / comps_per_reg;
off *= 4; /* 32-bit registers */
......
......@@ -144,3 +144,11 @@ bi_get_immediate(bi_instruction *ins, unsigned index)
unsigned shift = index & ~BIR_INDEX_CONSTANT;
return ins->constant.u64 >> shift;
}
bool
bi_writes_component(bi_instruction *ins, unsigned comp)
{
nir_alu_type T = ins->dest_type;
unsigned size = nir_alu_type_get_type_size(T);
return ins->writemask & (0xF << (comp * (size / 8)));
}
......@@ -539,6 +539,7 @@ unsigned bi_get_component_count(bi_instruction *ins, unsigned s);
unsigned bi_load32_components(bi_instruction *ins);
uint16_t bi_bytemask_of_read_components(bi_instruction *ins, unsigned node);
uint64_t bi_get_immediate(bi_instruction *ins, unsigned index);
bool bi_writes_component(bi_instruction *ins, unsigned comp);
/* BIR passes */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment