6#include "Containers/Array.h"
11#define SHADER_SOURCE_ANSI 1 UE_DEPRECATED_MACRO(5.6, "SHADER_SOURCE_ANSI has been deprecated and should be assumed to always be 1")
12#define SHADER_SOURCE_LITERAL(S) S UE_DEPRECATED_MACRO(5.6, "SHADER_SOURCE_LITERAL has been deprecated and should be replaced with just plain string literal")
13#define SHADER_SOURCE_VIEWLITERAL(S) ANSITEXTVIEW(S) UE_DEPRECATED_MACRO(5.6, "SHADER_SOURCE_VIEWLITERAL has been deprecated and should be replaced with ANSITEXTVIEW")
26 SourceCompressed.
Empty();
27 DecompressedCharCount = 0;
36 template <
int NumChars>
40 UE_DEPRECATED(5.6,
"Shader code is always assumed to be ANSI")
43 UE_DEPRECATED(5.6,
"Shader code is always assumed to be ANSI, so GetSimdCharCount() is always 16")
46 UE_DEPRECATED(5.6,
"Shader code is always assumed to be ANSI, so GetSingleCharMask() is always 1")
79 checkf(
Num <=
Len(),
TEXT(
"Trying to shrink to %d characters but existing allocation is smaller (%d characters)"),
Num,
Len());
117 return Source.
Num() - ShaderSourceSimdPadding;
122 return DecompressedCharCount != 0;
140 static_assert(
sizeof(
CharType) == 1);
141 static constexpr int32 ShaderSourceSimdPadding = 15;
144 int32 DecompressedCharCount = 0;
EAllowShrinking
Definition AllowShrinking.h:10
#define UE_ALLOWSHRINKING_BOOL_DEPRECATED(FunctionName)
Definition AllowShrinking.h:31
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition Archive.h:1208
Definition ShaderSource.h:19
void ShrinkToLen(int32 Num, EAllowShrinking AllowShrinking=EAllowShrinking::Default)
Definition ShaderSource.h:77
int32 Len() const
Definition ShaderSource.h:114
RENDERCORE_API void Decompress()
Definition ShaderSource.cpp:76
RENDERCORE_API void Compress()
Definition ShaderSource.cpp:48
bool IsCompressed() const
Definition ShaderSource.h:120
RENDERCORE_API FShaderSource & operator=(FStringType &&InSrc)
Definition ShaderSource.cpp:35
ANSICHAR CharType
Definition ShaderSource.h:31
FShaderSource()
Definition ShaderSource.h:50
CharType * GetData()
Definition ShaderSource.h:100
FCStringAnsi FCStringType
Definition ShaderSource.h:34
bool IsEmpty() const
Definition ShaderSource.h:109
static constexpr int32 GetSimdCharCount()
Definition ShaderSource.h:44
static constexpr bool IsWide()
Definition ShaderSource.h:41
int32 GetDecompressedSize() const
Definition ShaderSource.h:125
FAnsiStringView FViewType
Definition ShaderSource.h:32
FViewType GetView() const
Definition ShaderSource.h:91
FAnsiString FStringType
Definition ShaderSource.h:33
friend FArchive & operator<<(FArchive &Ar, FShaderSource &ShaderSource)
Definition ShaderSource.cpp:87
static constexpr int32 GetSingleCharMask()
Definition ShaderSource.h:47
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
void SetNumUninitialized(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2369
void Empty(SizeType Slack=0)
Definition Array.h:2273
Definition StringBuilder.h:509
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131