You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fix crash when cooking Android OpenGLES on Linux by replacing swscanf based parser with native FindNextHLSLDefinitionOfType
#jira UE-205727 #rnx #rb dan.elksnitis, Dmitriy.Dyomin, Florin.Pascu [CL 32299451 by matthew sorrels in ue5-main branch]
This commit is contained in:
@@ -360,6 +360,27 @@ const TCHAR* ParseHLSLSymbolName(const TCHAR* SearchString, FString& SymbolName)
|
||||
return Result.GetData() + Result.Len();
|
||||
}
|
||||
|
||||
FStringView FindNextHLSLDefinitionOfType(FStringView Typename, FStringView StartPos)
|
||||
{
|
||||
// handle both the case where identifier for declaration immediately precedes a ; and has whitespace separating the two
|
||||
const TCHAR* NextWhitespace;
|
||||
const TCHAR* NextNonWhitespace;
|
||||
FStringView SymbolName;
|
||||
|
||||
NextWhitespace = FindNextWhitespace(StartPos.GetData());
|
||||
if (NextWhitespace == StartPos.GetData())
|
||||
{
|
||||
NextNonWhitespace = FindNextNonWhitespace(NextWhitespace);
|
||||
SymbolName = ParseHLSLSymbolName<TCHAR, FStringView>(NextNonWhitespace);
|
||||
NextNonWhitespace = FindNextNonWhitespace(NextNonWhitespace + SymbolName.Len());
|
||||
if (NextNonWhitespace && (*NextNonWhitespace == ';'))
|
||||
{
|
||||
return SymbolName;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
FStringView UE::ShaderCompilerCommon::RemoveConstantBufferPrefix(FStringView InName)
|
||||
{
|
||||
return UE::String::RemoveFromStart(InName, FStringView(UE::ShaderCompilerCommon::kUniformBufferConstantBufferPrefix));
|
||||
|
||||
Reference in New Issue
Block a user