Skip to content

Commit

Permalink
Assert that disassemble was successful
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Jul 26, 2023
1 parent f536c70 commit 6e99b60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/filamat/src/GLSLPostProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,11 @@ void GLSLPostProcessor::fixupClipDistance(
if (!config.usesClipDistance) {
return;
}
// This should match the version of SPIR-V used in GLSLTools::prepareShaderParser.
SpirvTools tools(SPV_ENV_UNIVERSAL_1_3);
std::string disassembly;
tools.Disassemble(spirv, &disassembly);
const bool result = tools.Disassemble(spirv, &disassembly);
assert_invariant(result);
if (filamat::fixupClipDistance(disassembly)) {
spirv.clear();
tools.Assemble(disassembly, &spirv);
Expand Down

0 comments on commit 6e99b60

Please sign in to comment.