Commit 8f674e82 by John Kessenich

Fix issue #676: emit error message on failure to open spv file.

parent 0302bdf0
...@@ -5319,6 +5319,8 @@ void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName) ...@@ -5319,6 +5319,8 @@ void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName)
{ {
std::ofstream out; std::ofstream out;
out.open(baseName, std::ios::binary | std::ios::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) { for (int i = 0; i < (int)spirv.size(); ++i) {
unsigned int word = spirv[i]; unsigned int word = spirv[i];
out.write((const char*)&word, 4); out.write((const char*)&word, 4);
...@@ -5331,6 +5333,8 @@ void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, ...@@ -5331,6 +5333,8 @@ void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName,
{ {
std::ofstream out; std::ofstream out;
out.open(baseName, std::ios::binary | std::ios::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; out << "\t// " GLSLANG_REVISION " " GLSLANG_DATE << std::endl;
if (varName != nullptr) { if (varName != nullptr) {
out << "\t #pragma once" << std::endl; out << "\t #pragma once" << std::endl;
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits. // 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). // For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.1842" #define GLSLANG_REVISION "Overload400-PrecQual.1843"
#define GLSLANG_DATE "17-Feb-2017" #define GLSLANG_DATE "18-Feb-2017"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment