diff --git a/src/xenia/gpu/spirv_shader_translator.cc b/src/xenia/gpu/spirv_shader_translator.cc index 0b24a47c4..b0c4779e2 100644 --- a/src/xenia/gpu/spirv_shader_translator.cc +++ b/src/xenia/gpu/spirv_shader_translator.cc @@ -20,6 +20,7 @@ #include "xenia/gpu/spirv/passes/control_flow_simplification_pass.h" DEFINE_bool(spv_validate, false, "Validate SPIR-V shaders after generation"); +DEFINE_bool(spv_disasm, false, "Disassemble SPIR-V shaders after generation"); namespace xe { namespace gpu { @@ -637,14 +638,16 @@ void SpirvShaderTranslator::PostTranslation(Shader* shader) { } } - // TODO(benvanik): only if needed? could be slowish. - auto disasm = disassembler_.Disassemble( - reinterpret_cast(shader->translated_binary().data()), - shader->translated_binary().size() / 4); - if (disasm->has_error()) { - XELOGE("Failed to disassemble SPIRV - invalid?"); - } else { - set_host_disassembly(shader, disasm->to_string()); + if (FLAGS_spv_disasm) { + // TODO(benvanik): only if needed? could be slowish. + auto disasm = disassembler_.Disassemble( + reinterpret_cast(shader->translated_binary().data()), + shader->translated_binary().size() / 4); + if (disasm->has_error()) { + XELOGE("Failed to disassemble SPIRV - invalid?"); + } else { + set_host_disassembly(shader, disasm->to_string()); + } } }