6#include "Containers/Array.h"
29 void AddSourceBlock(
int32 OriginalLineNum,
int32 StrippedLineNum)
31 AddSourceBlock(OriginalLineNum, StrippedLineNum, FString());
33 void AddSourceBlock(
int32 OriginalLineNum,
int32 StrippedLineNum, FString&& OriginalPath);
39 const FString& Filename;
44 FRemapData GetRemapData(
int32 StrippedLineNum)
const;
49 int32 StrippedLineNum;
52 int32 OriginalLineNum;
72 return PreprocessedSource.
GetView();
77 return PreprocessedSource.
GetView();
82 if (WideSource.IsEmpty())
84 WideSource = FString(PreprocessedSource.
GetView());
97 if (OriginalPreprocessedSource.
IsEmpty())
99 if (WideSource.IsEmpty())
101 WideSource = FString(PreprocessedSource.
GetView());
107 if (WideSourceUnstripped.IsEmpty())
109 WideSourceUnstripped = FString(OriginalPreprocessedSource.
GetView());
117 return PreprocessedSource;
123 int32 EndIndex = 0, LineIndex = 0, StartIndex = 0;
124 while (StartIndex < Source.Len())
129 EndIndex = Source.Len();
132 StartIndex = EndIndex + 1;
133 Callback(
Line, LineIndex++);
183 for (FString&
Directive : PragmaDirectives)
213 inline void LogError(FString&& FilePath, FString&& Message,
int32 LineNumber)
231 return PreprocessTime;
236 return ShaderDiagnosticDatas;
241 return ShaderDiagnosticDatas;
258 OriginalPreprocessedSource.
Compress();
261 void DecompressCode()
277 mutable FString WideSource;
278 mutable FString WideSourceUnstripped;
288 double PreprocessTime = 0.0;
289 bool bSucceeded =
false;
290 bool bIsSecondary =
false;
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const TCHAR * LexToString(EAnalyticsRecordEventMode Mode)
Definition IAnalyticsProvider.cpp:5
UE_FORCEINLINE_HINT bool IsValid(const UObject *Test)
Definition Object.h:1875
RENDERCORE_API FStringView GetShaderSourceDebugHashPrefixWide()
Definition ShaderPreprocessTypes.cpp:75
RENDERCORE_API FShaderSource::FViewType GetShaderSourceDebugHashPrefix()
Definition ShaderPreprocessTypes.cpp:70
TStringView< TCHAR > FStringView
Definition StringFwd.h:45
#define ANSITEXTVIEW(str)
Definition StringView.h:555
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint32 Offset
Definition VulkanMemory.cpp:4033
Definition Archive.h:1208
Definition ShaderCore.cpp:1801
Definition ShaderCompilerJobTypes.h:331
Definition ShaderPreprocessTypes.h:64
FStringView GetUnstrippedSourceView() const
Definition ShaderPreprocessTypes.h:89
bool IsSecondary() const
Definition ShaderPreprocessTypes.h:189
FAnsiStringView GetSourceViewAnsi() const
Definition ShaderPreprocessTypes.h:75
TArray< FShaderCompilerError > & EditErrors()
Definition ShaderPreprocessTypes.h:219
void VisitDirectives(TFunction< void(const FString *)> Action) const
Definition ShaderPreprocessTypes.h:151
void LogError(FString &&FilePath, FString &&Message, FString &&LineNumberStr)
Definition ShaderPreprocessTypes.h:205
TConstArrayView< FShaderCompilerError > GetErrors() const
Definition ShaderPreprocessTypes.h:224
FShaderPreprocessOutput()
Definition ShaderPreprocessTypes.h:66
friend FArchive & operator<<(FArchive &Ar, FShaderPreprocessOutput &PreprocessOutput)
Definition ShaderPreprocessTypes.cpp:394
TArray< FShaderDiagnosticData > & EditDiagnosticDatas()
Definition ShaderPreprocessTypes.h:234
FShaderSource & EditSource()
Definition ShaderPreprocessTypes.h:115
FShaderSource::FViewType GetSourceView() const
Definition ShaderPreprocessTypes.h:70
bool HasDirective(const FString &Directive) const
Definition ShaderPreprocessTypes.h:137
void VisitDirectivesWithPrefix(const TCHAR *Prefix, TFunction< void(const FString *)> Action) const
Definition ShaderPreprocessTypes.h:161
void LogError(FString &&Message)
Definition ShaderPreprocessTypes.h:199
void AddDirective(FString &&Directive)
Definition ShaderPreprocessTypes.h:174
double GetPreprocessTime() const
Definition ShaderPreprocessTypes.h:229
FStringView GetSourceViewWide() const
Definition ShaderPreprocessTypes.h:80
void ForEachLine(TFunction< void(FAnsiStringView Line, int32 LineIndex)> Callback) const
Definition ShaderPreprocessTypes.h:120
void LogError(FString &&FilePath, FString &&Message, int32 LineNumber)
Definition ShaderPreprocessTypes.h:213
bool GetSucceeded() const
Definition ShaderPreprocessTypes.h:194
void MoveDirectives(TArray< FString > &OutDirectives)
Definition ShaderPreprocessTypes.h:181
const TArray< FShaderDiagnosticData > & GetDiagnosticDatas() const
Definition ShaderPreprocessTypes.h:239
Definition ShaderSource.h:19
RENDERCORE_API void Decompress()
Definition ShaderSource.cpp:76
RENDERCORE_API void Compress()
Definition ShaderSource.cpp:48
bool IsEmpty() const
Definition ShaderSource.h:109
FViewType GetView() const
Definition ShaderSource.h:91
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
ElementType & AddDefaulted_GetRef() UE_LIFETIMEBOUND
Definition Array.h:2815
Definition AndroidPlatformMisc.h:14
Definition ShaderCore.h:544
Definition ShaderCompilerCore.h:411
FString StrippedErrorMessage
Definition ShaderCompilerCore.h:446
FString ErrorVirtualFilePath
Definition ShaderCompilerCore.h:444
Definition ShaderCompilerCore.h:491
Definition ShaderPreprocessTypes.h:24