Skip to content

Commit

Permalink
Fall back to unoptimized SPIRV when the optimizer fails
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Oct 4, 2023
1 parent 27a2e40 commit 7b0d8ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/SpirVTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,8 @@ void SpirVTranslator::outputCode(const Target& target, const char* sourcefilenam
bool success = optimizer.Run(spirv.data(), spirv.size(), &optimizedSpirv);

if (!success) {
throw spirv_cross::CompilerError("Optimizer error");
fprintf(stderr, "Optimizer error, falling back to unoptimized SPIRV.\n");
optimizedSpirv = spirv;
}

outputLength = (int)(optimizedSpirv.size() * 4);
Expand Down

0 comments on commit 7b0d8ff

Please sign in to comment.