Fixed highlighted line in DXC error message.

#rb none
#jira UE-83064
#rnx

#ROBOMERGE-SOURCE: CL 10271524 in //UE4/Release-4.24/...
#ROBOMERGE-BOT: RELEASE (Release-4.24 -> Main) (v591-10236483)

[CL 10271528 by lukas hermanns in Main branch]
This commit is contained in:
lukas hermanns
2019-11-15 18:15:09 -05:00
parent 4ea60b7048
commit 9d0084acb1
2 changed files with 19 additions and 17 deletions
@@ -774,6 +774,21 @@ struct FShaderCompilerError
}
}
/** Returns the error message with source file and source line (if present), as well as a line marker seperated with a LINE_TERMINATOR. */
FString GetErrorStringWithLineMarker() const
{
if (HasLineMarker())
{
// Append highlighted line and its marker to the same error message with line terminators
// to get a similar multiline error output as with DXC
return (GetErrorString() + LINE_TERMINATOR + TEXT("\t") + HighlightedLine + LINE_TERMINATOR + TEXT("\t") + HighlightedLineMarker);
}
else
{
return GetErrorString();
}
}
/**
Returns true if this error message has a marker string for the highlighted source line where the error occurred. Example:
/Engine/Private/MySourceFile.usf(120): error: undeclared identifier 'a'
@@ -790,7 +805,7 @@ struct FShaderCompilerError
friend FArchive& operator<<(FArchive& Ar,FShaderCompilerError& Error)
{
return Ar << Error.ErrorVirtualFilePath << Error.ErrorLineString << Error.StrippedErrorMessage;
return Ar << Error.ErrorVirtualFilePath << Error.ErrorLineString << Error.StrippedErrorMessage << Error.HighlightedLine << Error.HighlightedLineMarker;
}
};