[SPIR-V] New flag: spv_disasm - Generate disassembly for spir-v shaders (disabled by default)
This commit is contained in:
parent
8ec8d9778f
commit
6b4e8ee19e
|
@ -20,6 +20,7 @@
|
||||||
#include "xenia/gpu/spirv/passes/control_flow_simplification_pass.h"
|
#include "xenia/gpu/spirv/passes/control_flow_simplification_pass.h"
|
||||||
|
|
||||||
DEFINE_bool(spv_validate, false, "Validate SPIR-V shaders after generation");
|
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 xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
@ -637,14 +638,16 @@ void SpirvShaderTranslator::PostTranslation(Shader* shader) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(benvanik): only if needed? could be slowish.
|
if (FLAGS_spv_disasm) {
|
||||||
auto disasm = disassembler_.Disassemble(
|
// TODO(benvanik): only if needed? could be slowish.
|
||||||
reinterpret_cast<const uint32_t*>(shader->translated_binary().data()),
|
auto disasm = disassembler_.Disassemble(
|
||||||
shader->translated_binary().size() / 4);
|
reinterpret_cast<const uint32_t*>(shader->translated_binary().data()),
|
||||||
if (disasm->has_error()) {
|
shader->translated_binary().size() / 4);
|
||||||
XELOGE("Failed to disassemble SPIRV - invalid?");
|
if (disasm->has_error()) {
|
||||||
} else {
|
XELOGE("Failed to disassemble SPIRV - invalid?");
|
||||||
set_host_disassembly(shader, disasm->to_string());
|
} else {
|
||||||
|
set_host_disassembly(shader, disasm->to_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue