deduplicate spirv disassembly code

This commit is contained in:
Mathias Agopian
2023-02-01 17:07:52 -08:00
committed by Mathias Agopian
parent 8afb11128d
commit f71e90fae0
2 changed files with 6 additions and 13 deletions

View File

@@ -101,7 +101,6 @@ CString ShaderExtractor::spirvToGLSL(ShaderModel shaderModel, const uint32_t* da
emitOptions.version = 450;
}
emitOptions.vulkan_semantics = true;
//emitOptions.emit_line_directives = true;
std::vector<uint32_t> spirv(data, data + wordCount);
CompilerGLSL glslCompiler(std::move(spirv));
@@ -115,7 +114,8 @@ CString ShaderExtractor::spirvToGLSL(ShaderModel shaderModel, const uint32_t* da
// uses, which lets us easily generate test cases for the spirv-cross project.
CString ShaderExtractor::spirvToText(const uint32_t* begin, size_t wordCount) {
spv_context context = spvContextCreate(SPV_ENV_UNIVERSAL_1_3);
if (SPV_SUCCESS != spvValidateBinary(context, begin, wordCount, nullptr)) {
if (spvValidateBinary(context, begin, wordCount, nullptr) != SPV_SUCCESS) {
spvContextDestroy(context);
return CString("Validation failure.");
}