aco: Validate GFX11 NSA correctly.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20370>
This commit is contained in:
@@ -653,13 +653,20 @@ validate_ir(Program* program)
|
||||
check(instr->operands.size() == 4 || program->gfx_level >= GFX10,
|
||||
"NSA is only supported on GFX10+", instr.get());
|
||||
for (unsigned i = 3; i < instr->operands.size(); i++) {
|
||||
if (instr->operands.size() == 4) {
|
||||
check(instr->operands[i].hasRegClass() &&
|
||||
instr->operands[i].regClass().type() == RegType::vgpr,
|
||||
"MIMG operands[3] (VADDR) must be VGPR", instr.get());
|
||||
} else {
|
||||
check(instr->operands[i].regClass() == v1, "MIMG VADDR must be v1 if NSA is used",
|
||||
instr.get());
|
||||
check(instr->operands[i].hasRegClass() &&
|
||||
instr->operands[i].regClass().type() == RegType::vgpr,
|
||||
"MIMG operands[3+] (VADDR) must be VGPR", instr.get());
|
||||
if (instr->operands.size() > 4) {
|
||||
if (program->gfx_level < GFX11) {
|
||||
check(instr->operands[i].regClass() == v1,
|
||||
"GFX10 MIMG VADDR must be v1 if NSA is used", instr.get());
|
||||
} else {
|
||||
if (instr->opcode != aco_opcode::image_bvh_intersect_ray &&
|
||||
instr->opcode != aco_opcode::image_bvh64_intersect_ray && i < 7) {
|
||||
check(instr->operands[i].regClass() == v1,
|
||||
"first 4 GFX11 MIMG VADDR must be v1 if NSA is used", instr.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user