glslangValidator: Exit with an error if output file cannot be written
Propagate the error from glslang::OutputSpv[Hex|Bin] and exit with an error code if there is an error.
This commit is contained in:
parent
a5bf69936d
commit
9fbc561947
3 changed files with 16 additions and 8 deletions
|
|
@ -1526,9 +1526,11 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
|
|||
if (! (Options & EOptionMemoryLeakMode)) {
|
||||
printf("%s", logger.getAllMessages().c_str());
|
||||
if (Options & EOptionOutputHexadecimal) {
|
||||
glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName);
|
||||
if (!glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName))
|
||||
exit(EFailUsage);
|
||||
} else {
|
||||
glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
|
||||
if (!glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage)))
|
||||
exit(EFailUsage);
|
||||
}
|
||||
|
||||
outputFiles.push_back(GetBinaryName((EShLanguage)stage));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue