Module: Mesa Branch: main Commit: 65c3d1869d302d269efc68af629c24e65bc40d82 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=65c3d1869d302d269efc68af629c24e65bc40d82
Author: Qiang Yu <[email protected]> Date: Sun Apr 23 16:39:11 2023 +0800 aco: allow no export instruction for gfx10+ fs radeonsi will generate no export instruction when no discard and no output. Reviewed-by: Rhys Perry <[email protected]> Signed-off-by: Qiang Yu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22727> --- src/amd/compiler/aco_assembler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_assembler.cpp b/src/amd/compiler/aco_assembler.cpp index e05f6dc730b..37179646d32 100644 --- a/src/amd/compiler/aco_assembler.cpp +++ b/src/amd/compiler/aco_assembler.cpp @@ -1010,7 +1010,10 @@ fix_exports(asm_context& ctx, std::vector<uint32_t>& out, Program* program) } } - if (!exported) { + /* GFX10+ FS may not export anything if no discard is used. */ + bool may_skip_export = program->stage.hw == HWStage::FS && program->gfx_level >= GFX10; + + if (!exported && !may_skip_export) { /* Abort in order to avoid a GPU hang. */ bool is_vertex_or_ngg = (program->stage.hw == HWStage::VS || program->stage.hw == HWStage::NGG);
