diff options
author | Georg Lehmann <dadschoorse@gmail.com> | 2022-12-17 12:39:25 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-01-11 00:00:38 +0000 |
commit | 9538d523b6fef82dad5265a458cfba72e93a02f7 (patch) | |
tree | 9dcbb9b37b3ef86ed7a2447c14df29d2d6d4edba | |
parent | 9abe4850baf17453d9faaec04b90d8937cee28ff (diff) | |
download | mesa-9538d523b6fef82dad5265a458cfba72e93a02f7.tar.gz |
aco: Validate GFX11 NSA correctly.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20370>
-rw-r--r-- | src/amd/compiler/aco_validate.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/amd/compiler/aco_validate.cpp b/src/amd/compiler/aco_validate.cpp index a668dd84b52..0494f4cc5a2 100644 --- a/src/amd/compiler/aco_validate.cpp +++ b/src/amd/compiler/aco_validate.cpp @@ -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()); + } + } } } |