Commit 7f702124 by John Kessenich

HLSL: return correct error when HLSL parsing fails.

At least partially addresses issue #510.
parent 315b6b9f
...@@ -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.1482" #define GLSLANG_REVISION "Overload400-PrecQual.1485"
#define GLSLANG_DATE "12-Sep-2016" #define GLSLANG_DATE "15-Sep-2016"
...@@ -119,14 +119,15 @@ bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& ...@@ -119,14 +119,15 @@ bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner&
HlslScanContext scanContext(*this, ppContext); HlslScanContext scanContext(*this, ppContext);
HlslGrammar grammar(scanContext, *this); HlslGrammar grammar(scanContext, *this);
if (!grammar.parse()) if (!grammar.parse()) {
{
// Print a message formated such that if you click on the message it will take you right to // Print a message formated such that if you click on the message it will take you right to
// the line through most UIs. // the line through most UIs.
const glslang::TSourceLoc& sourceLoc = input.getSourceLoc(); const glslang::TSourceLoc& sourceLoc = input.getSourceLoc();
printf("\n%s(%i): error at column %i, HLSL translation failed.\n", sourceLoc.name, sourceLoc.line, printf("\n%s(%i): error at column %i, HLSL translation failed.\n", sourceLoc.name, sourceLoc.line,
sourceLoc.column); sourceLoc.column);
return false;
} }
return numErrors == 0; return numErrors == 0;
} }
......
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