Fix issue #676: emit error message on failure to open spv file.
diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp
index 5b1240c..4014525 100755
--- a/SPIRV/GlslangToSpv.cpp
+++ b/SPIRV/GlslangToSpv.cpp
@@ -5319,6 +5319,8 @@
{
std::ofstream out;
out.open(baseName, std::ios::binary | std::ios::out);
+ if (out.fail())
+ printf("ERROR: Failed to open file: %s\n", baseName);
for (int i = 0; i < (int)spirv.size(); ++i) {
unsigned int word = spirv[i];
out.write((const char*)&word, 4);
@@ -5331,6 +5333,8 @@
{
std::ofstream out;
out.open(baseName, std::ios::binary | std::ios::out);
+ if (out.fail())
+ printf("ERROR: Failed to open file: %s\n", baseName);
out << "\t// " GLSLANG_REVISION " " GLSLANG_DATE << std::endl;
if (varName != nullptr) {
out << "\t #pragma once" << std::endl;
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index 26f4b6c..cf04afd 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -662,7 +662,7 @@
if (! (Options & EOptionMemoryLeakMode)) {
printf("%s", logger.getAllMessages().c_str());
if (Options & EOptionOutputHexadecimal) {
- glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName);
+ glslang::OutputSpvHex(spirv, GetBinaryName((EShLanguage)stage), variableName);
} else {
glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
}
@@ -999,8 +999,8 @@
"\n"
" --keep-uncalled don't eliminate uncalled functions when linking\n"
" --ku synonym for --keep-uncalled\n"
- " --variable-name <name> Creates a C header file that contains a uint32_t array named <name> initialized with the shader binary code.\n"
- " --vn <name> synonym for --variable-name <name>.\n"
+ " --variable-name <name> Creates a C header file that contains a uint32_t array named <name> initialized with the shader binary code.\n"
+ " --vn <name> synonym for --variable-name <name>.\n"
);
exit(EFailUsage);
diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h
index 0b08d22..50deb64 100644
--- a/glslang/Include/revision.h
+++ b/glslang/Include/revision.h
@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
-#define GLSLANG_REVISION "Overload400-PrecQual.1842"
-#define GLSLANG_DATE "17-Feb-2017"
+#define GLSLANG_REVISION "Overload400-PrecQual.1843"
+#define GLSLANG_DATE "18-Feb-2017"