mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
aco: workaround GFX9 hardware bug for D16 image instructions
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13592>
This commit is contained in:
parent
8f1483cd5c
commit
626aa7b648
1 changed files with 14 additions and 0 deletions
|
|
@ -220,6 +220,20 @@ struct DefInfo {
|
||||||
stride = DIV_ROUND_UP(stride, 4);
|
stride = DIV_ROUND_UP(stride, 4);
|
||||||
}
|
}
|
||||||
assert(stride > 0);
|
assert(stride > 0);
|
||||||
|
} else if (instr->isMIMG() && instr->mimg().d16 && ctx.program->chip_class <= GFX9) {
|
||||||
|
/* Workaround GFX9 hardware bug for D16 image instructions: FeatureImageGather4D16Bug
|
||||||
|
*
|
||||||
|
* The register use is not calculated correctly, and the hardware assumes a
|
||||||
|
* full dword per component. Don't use the last registers of the register file.
|
||||||
|
* Otherwise, the instruction will be skipped.
|
||||||
|
*
|
||||||
|
* https://reviews.llvm.org/D81172
|
||||||
|
*/
|
||||||
|
bool imageGather4D16Bug = operand == -1 && rc == v2 && instr->mimg().dmask != 0xF;
|
||||||
|
assert(ctx.program->chip_class == GFX9 && "Image D16 on GFX8 not supported.");
|
||||||
|
|
||||||
|
if (imageGather4D16Bug)
|
||||||
|
bounds.size -= rc.bytes() / 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue