11#define SHADER_COMPILER_FLOAT32_FORMAT_STRING TEXT("%#.9gf")
30 template <
typename ValueType>
35 template <
typename ValueType>
49 Result = Pairs[KeyIndex].ValueInteger;
53 Result =
FCString::Atoi(*StringValues[Pairs[KeyIndex].ValueInteger]);
58 Result = (
int32)Pairs[KeyIndex].ValueFloat;
94 Result = Pairs[KeyIndex].ValueInteger;
98 Result =
FCString::Atoi(*StringValues[Pairs[KeyIndex].ValueInteger]);
103 Result = (
int32)Pairs[KeyIndex].ValueFloat;
127 StringValues.
Empty();
131 if (InitialDefineCount)
133 *
this = *GInitialDefines;
163 KeyHashTable =
Other.KeyHashTable;
165 ValueTypes =
Other.ValueTypes;
166 StringValues =
Other.StringValues;
167 InitialDefineCount =
Other.InitialDefineCount;
168 ValueCount =
Other.ValueCount;
177 Ar <<
Defs.ValueCount;
184 Ar <<
Defs.StringValues;
188 Ar <<
Defs.ValueCount;
189 for (
uint32 ValueIndex = 0; ValueIndex <
Defs.ValueCount; ValueIndex++)
191 FShaderCompilerDefinitions::FPairType Pair;
197 Ar <<
Defs.StringValues;
209 KeyStringBuffer[0] = 0;
210 ValueStringBuffer[0] = 0;
244 return KeyStringBuffer;
249 return Defines.Pairs[
Index].Key;
259 int32 ValueInteger = Defines.Pairs[
Index].ValueInteger;
260 if (ValueInteger >= 0 && ValueInteger <= 9)
262 ValueStringBuffer[0] = (
TCHAR)ValueInteger +
'0';
263 ValueStringBuffer[1] = 0;
269 Result = ValueStringBuffer;
273 uint32 ValueUnsigned = Defines.Pairs[
Index].ValueUnsigned;
274 if (ValueUnsigned >= 0 && ValueUnsigned <= 9)
276 ValueStringBuffer[0] = (
TCHAR)ValueUnsigned +
'0';
277 ValueStringBuffer[1] = 0;
283 Result = ValueStringBuffer;
289 Result = ValueStringBuffer;
294 Result = *Defines.StringValues[Defines.Pairs[
Index].ValueInteger];
309 TCHAR ValueStringBuffer[32];
316 for (
uint32 KeyIndex = KeyHashTable.
First(KeyHash); KeyHashTable.
IsValid(KeyIndex); KeyIndex = KeyHashTable.
Next(KeyIndex))
318 if (Pairs[KeyIndex].Key == Key)
329 int32 KeyIndex = FindMapIndex(
Name, KeyHash);
332 KeyIndex = Pairs.
Add(FPairType({
Name, {0} }));
334 KeyHashTable.
Add(KeyHash, KeyIndex);
353 KeyIndex = Pairs.
Add(FPairType({
NameCache.Name, {0} }));
355 KeyHashTable.
Add(KeyHash, KeyIndex);
378 StringValues[Pairs[
Index].ValueInteger] =
Value;
461 Ar << Pair.ValueInteger;
469 uint32 InitialDefineCount;
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FArchive & operator<<(FArchive &Ar, FEnvQueryDebugProfileData::FStep &Data)
Definition EnvQueryTypes.cpp:489
const bool
Definition NetworkReplayStreaming.h:178
#define SHADER_COMPILER_FLOAT32_FORMAT_STRING
Definition ShaderCompilerDefinitions.h:11
EShaderCompilerDefineVariant
Definition ShaderCompilerDefinitions.h:14
Definition Archive.h:1208
virtual void Serialize(void *V, int64 Length)
Definition Archive.h:1689
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
UE_FORCEINLINE_HINT bool IsSaving() const
Definition Archive.h:248
Definition HashTable.h:210
void Free()
Definition HashTable.h:379
bool IsValid(uint32 Index) const
Definition HashTable.h:409
void Add(uint32 Key, uint32 Index)
Definition HashTable.h:414
uint32 First(uint32 Key) const
Definition HashTable.h:395
uint32 Next(uint32 Index) const
Definition HashTable.h:402
Definition NameTypes.h:617
static constexpr uint32 StringBufferSize
Definition NameTypes.h:708
Definition ShaderCore.h:519
Definition ShaderCompilerDefinitions.h:203
FORCEINLINE const TCHAR * Value()
Definition ShaderCompilerDefinitions.h:253
FORCEINLINE bool operator!() const
Definition ShaderCompilerDefinitions.h:222
FORCEINLINE FConstIterator(const FShaderCompilerDefinitions &InDefines)
Definition ShaderCompilerDefinitions.h:205
FORCEINLINE const FName & KeyFName() const
Definition ShaderCompilerDefinitions.h:247
FORCEINLINE const TCHAR * Key()
Definition ShaderCompilerDefinitions.h:241
FORCEINLINE int32 GetIndex() const
Definition ShaderCompilerDefinitions.h:300
FORCEINLINE FConstIterator & operator++()
Definition ShaderCompilerDefinitions.h:227
Definition ShaderCompilerDefinitions.h:24
int32 GetIntegerValue(FName Name) const
Definition ShaderCompilerDefinitions.h:40
void Empty()
Definition ShaderCompilerDefinitions.h:120
bool Contains(FName Name) const
Definition ShaderCompilerDefinitions.h:109
void SetDefine(FName Name, const FString &Value)
Definition ShaderCompilerDefinitions.h:33
friend FArchive & operator<<(FArchive &Ar, FShaderCompilerDefinitions &Defs)
Definition ShaderCompilerDefinitions.h:172
void SetDefine(FName Name, ValueType Value)
Definition ShaderCompilerDefinitions.h:31
void SetDefine(FShaderCompilerDefineNameCache &Name, const FString &Value)
Definition ShaderCompilerDefinitions.h:38
int32 GetIntegerValue(FShaderCompilerDefineNameCache &NameCache, int32 ResultIfNotFound) const
Definition ShaderCompilerDefinitions.h:64
FORCEINLINE int32 Num() const
Definition ShaderCompilerDefinitions.h:115
RENDERCORE_API FShaderCompilerDefinitions(const FShaderCompilerDefinitions &)
void SetDefine(FShaderCompilerDefineNameCache &Name, const TCHAR *Value)
Definition ShaderCompilerDefinitions.h:37
FShaderCompilerDefinitions & operator=(const FShaderCompilerDefinitions &Other)
Definition ShaderCompilerDefinitions.h:161
void Merge(const FShaderCompilerDefinitions &Other)
Definition ShaderCompilerDefinitions.h:138
friend struct FShaderInitialDefinesInitializer
Definition ShaderCompilerDefinitions.h:474
void SetDefine(FName Name, const TCHAR *Value)
Definition ShaderCompilerDefinitions.h:32
void SetDefine(FShaderCompilerDefineNameCache &Name, ValueType Value)
Definition ShaderCompilerDefinitions.h:36
UE_REWRITE SizeType Num() const
Definition Array.h:1144
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
void ToString(const FPlatformTypeLayoutParameters &LayoutParams, FMemoryToStringContext &OutContext) const
Definition Array.h:3618
void Empty(SizeType Slack=0)
Definition Array.h:2273
uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35
constexpr int32 StringLength(const CharType *InString)
Definition StringView.h:38
U16 Index
Definition radfft.cpp:71
static UE_FORCEINLINE_HINT int32 Atoi(const CharType *String)
Definition CString.h:1173
static int32 Sprintf(CharType *Dest, const FmtType &Fmt, Types... Args)
Definition CString.h:569