mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
freedreno/ir3: fix crash
Fixes a crash in dEQP-GLES3.functional.shaders.fragdepth.compare.fragcoord_z
Fixes: 0d240c2214 freedreno/ir3: don't fetch unused tex components
Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
3e8e033f4c
commit
c19c4bf488
1 changed files with 8 additions and 14 deletions
|
|
@ -177,27 +177,21 @@ remove_unused_by_block(struct ir3_block *block)
|
||||||
if (instr->opc == OPC_META_FO) {
|
if (instr->opc == OPC_META_FO) {
|
||||||
struct ir3_instruction *src = ssa(instr->regs[1]);
|
struct ir3_instruction *src = ssa(instr->regs[1]);
|
||||||
if (src->regs[0]->wrmask > 1) {
|
if (src->regs[0]->wrmask > 1) {
|
||||||
unsigned newn, lastn;
|
|
||||||
|
|
||||||
lastn = util_last_bit(src->regs[0]->wrmask);
|
|
||||||
src->regs[0]->wrmask &= ~(1 << instr->fo.off);
|
src->regs[0]->wrmask &= ~(1 << instr->fo.off);
|
||||||
newn = util_last_bit(src->regs[0]->wrmask);
|
|
||||||
|
|
||||||
/* prune no-longer needed right-neighbors. We could
|
/* prune no-longer needed right-neighbors. We could
|
||||||
* probably do the same for left-neighbors (ie. tex
|
* probably do the same for left-neighbors (ie. tex
|
||||||
* fetch that only need .yw components), but that
|
* fetch that only need .yw components), but that
|
||||||
* makes RA a bit more confusing than it already is
|
* makes RA a bit more confusing than it already is
|
||||||
*/
|
*/
|
||||||
if (newn < lastn) {
|
struct ir3_instruction *n = instr;
|
||||||
struct ir3_instruction *n = ir3_neighbor_first(instr);
|
while (n && n->cp.right)
|
||||||
for (unsigned i = 1; i < newn; i++) {
|
n = n->cp.right;
|
||||||
n = n->cp.right;
|
while (n->flags & IR3_INSTR_UNUSED) {
|
||||||
}
|
n = n->cp.left;
|
||||||
// XXX I don't think n should be null here!
|
if (!n)
|
||||||
if (n) {
|
break;
|
||||||
debug_assert(n->cp.right->flags & IR3_INSTR_UNUSED);
|
n->cp.right = NULL;
|
||||||
n->cp.right = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue