shader_recompiler: list all missing instructions during translation pass

This commit is contained in:
psucien 2024-06-16 23:45:39 +02:00
parent 396812bab6
commit 0c32ea242b
5 changed files with 9 additions and 1 deletions

View File

@ -110,6 +110,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
CLS(Frontend) \ CLS(Frontend) \
CLS(Render) \ CLS(Render) \
SUB(Render, Vulkan) \ SUB(Render, Vulkan) \
SUB(Render, Recompiler) \
CLS(Input) \ CLS(Input) \
CLS(Tty) \ CLS(Tty) \
CLS(Loader) CLS(Loader)

View File

@ -77,6 +77,7 @@ enum class Class : u8 {
Frontend, ///< Emulator UI Frontend, ///< Emulator UI
Render, ///< Video Core Render, ///< Video Core
Render_Vulkan, ///< Vulkan backend Render_Vulkan, ///< Vulkan backend
Render_Recompiler, ///< Shader recompiler
Loader, ///< ROM loader Loader, ///< ROM loader
Input, ///< Input emulation Input, ///< Input emulation
Tty, ///< Debug output from emu Tty, ///< Debug output from emu

View File

@ -823,6 +823,9 @@ IR::AbstractSyntaxList BuildASL(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::
Statement& root{goto_pass.RootStatement()}; Statement& root{goto_pass.RootStatement()};
IR::AbstractSyntaxList syntax_list; IR::AbstractSyntaxList syntax_list;
TranslatePass{inst_pool, block_pool, stmt_pool, root, syntax_list, cfg.inst_list, info}; TranslatePass{inst_pool, block_pool, stmt_pool, root, syntax_list, cfg.inst_list, info};
if (info.translation_failed) {
LOG_CRITICAL(Render_Recompiler, "Shader translation has failed");
}
return syntax_list; return syntax_list;
} }

View File

@ -673,7 +673,9 @@ void Translate(IR::Block* block, std::span<const GcnInst> inst_list, Info& info)
break; break;
default: default:
const u32 opcode = u32(inst.opcode); const u32 opcode = u32(inst.opcode);
UNREACHABLE_MSG("Unknown opcode {} ({})", magic_enum::enum_name(inst.opcode), opcode); LOG_ERROR(Render_Recompiler, "Unknown opcode {} ({})",
magic_enum::enum_name(inst.opcode), opcode);
info.translation_failed = true;
} }
} }
} }

View File

@ -127,6 +127,7 @@ struct Info {
Stage stage; Stage stage;
bool uses_group_quad{}; bool uses_group_quad{};
bool translation_failed{}; // indicates that shader has unsupported instructions
template <typename T> template <typename T>
T ReadUd(u32 ptr_index, u32 dword_offset) const noexcept { T ReadUd(u32 ptr_index, u32 dword_offset) const noexcept {