HLSL: return correct error when HLSL parsing fails.
At least partially addresses issue #510.
This commit is contained in:
@@ -119,14 +119,15 @@ bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner&
|
||||
|
||||
HlslScanContext scanContext(*this, ppContext);
|
||||
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
|
||||
// the line through most UIs.
|
||||
const glslang::TSourceLoc& sourceLoc = input.getSourceLoc();
|
||||
printf("\n%s(%i): error at column %i, HLSL translation failed.\n", sourceLoc.name, sourceLoc.line,
|
||||
sourceLoc.column);
|
||||
return false;
|
||||
}
|
||||
|
||||
return numErrors == 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user