[SPIR-V] New flag: spv_disasm - Generate disassembly for spir-v shaders (disabled by default)

This commit is contained in:
DrChat 2017-12-17 13:12:10 -06:00
parent 8ec8d9778f
commit 6b4e8ee19e
1 changed files with 11 additions and 8 deletions

View File

@ -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,6 +638,7 @@ void SpirvShaderTranslator::PostTranslation(Shader* shader) {
}
}
if (FLAGS_spv_disasm) {
// TODO(benvanik): only if needed? could be slowish.
auto disasm = disassembler_.Disassemble(
reinterpret_cast<const uint32_t*>(shader->translated_binary().data()),
@ -647,6 +649,7 @@ void SpirvShaderTranslator::PostTranslation(Shader* shader) {
set_host_disassembly(shader, disasm->to_string());
}
}
}
void SpirvShaderTranslator::PreProcessControlFlowInstructions(
std::vector<ucode::ControlFlowInstruction> instrs) {