UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ShaderTypes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
9
10class FMemStackBase;
11class UTexture;
12
13namespace UE::Shader
14{
15
16struct FStructType;
17
19{
22 IntMin,
23 NegOne,
24 Zero,
25 One,
26 IntMax,
29};
30
31inline EComponentBound MinBound(EComponentBound Lhs, EComponentBound Rhs) { return (EComponentBound)FMath::Min((uint8)Lhs, (uint8)Rhs); }
32inline EComponentBound MaxBound(EComponentBound Lhs, EComponentBound Rhs) { return (EComponentBound)FMath::Max((uint8)Lhs, (uint8)Rhs); }
33
42inline bool operator==(const FComponentBounds& Lhs, const FComponentBounds& Rhs)
43{
44 return Lhs.Min == Rhs.Min && Lhs.Max == Rhs.Max;
45}
46inline bool operator!=(const FComponentBounds& Lhs, const FComponentBounds& Rhs)
47{
48 return !operator==(Lhs, Rhs);
49}
50
51inline FComponentBounds MinBound(FComponentBounds Lhs, FComponentBounds Rhs) { return FComponentBounds(MinBound(Lhs.Min, Rhs.Min), MinBound(Lhs.Max, Rhs.Max)); }
52inline FComponentBounds MaxBound(FComponentBounds Lhs, FComponentBounds Rhs) { return FComponentBounds(MaxBound(Lhs.Min, Rhs.Min), MaxBound(Lhs.Max, Rhs.Max)); }
53inline bool IsWithinBounds(FComponentBounds Lhs, FComponentBounds Rhs) { return (uint8)Lhs.Min >= (uint8)Rhs.Min && (uint8)Lhs.Max <= (uint8)Rhs.Max; }
54
56{
57 Void,
58 Float,
59 Double,
60 Int,
61 Bool,
62
63 // May be any numeric type, stored internally as 'double' within FValue
64 Numeric,
65
66 Num,
67};
68static constexpr int32 NumValueComponentTypes = (int32)EValueComponentType::Num;
69
79
83inline bool IsNumericType(EValueComponentType Type) { return Type != EValueComponentType::Void; }
85
87
91inline bool IsLWCType(EValueComponentType Type) { return Type == EValueComponentType::Double; }
92
93enum class EValueType : uint8
94{
95 Void,
96
97 Float1,
98 Float2,
99 Float3,
100 Float4,
101
102 Double1,
103 Double2,
104 Double3,
105 Double4,
106
107 Int1,
108 Int2,
109 Int3,
110 Int4,
111
112 Bool1,
113 Bool2,
114 Bool3,
115 Bool4,
116
117 // Any scalar/vector type
118 Numeric1,
119 Numeric2,
120 Numeric3,
121 Numeric4,
122
123 // float4x4
124 Float4x4,
125
126 // Both of these are double4x4 on CPU
127 // On GPU, they map to FDFMatrix and FDFInverseMatrix
128 Double4x4,
130
131 // Any matrix type
133
134 Struct,
135 Object,
136 Any,
137
138 Num,
139};
141
150
153inline bool IsLWCType(EValueType Type) { return IsLWCType(GetValueTypeDescription(Type).ComponentType); }
154inline bool IsGenericType(EValueType Type) { return Type == EValueType::Any || IsGenericType(GetValueTypeDescription(Type).ComponentType); }
155ENGINE_API EValueType MakeValueType(EValueComponentType ComponentType, int32 NumComponents);
156ENGINE_API EValueType MakeValueType(EValueType BaseType, int32 NumComponents);
161
162inline bool IsNumericType(EValueType Type) { return IsNumericType(GetValueTypeDescription(Type).ComponentType); }
163
165{
166 const FValueTypeDescription TypeDesc = GetValueTypeDescription(Type);
167 return IsNumericType(TypeDesc.ComponentType) && TypeDesc.NumComponents == 1;
168}
170{
171 const FValueTypeDescription TypeDesc = GetValueTypeDescription(Type);
172 return IsNumericType(TypeDesc.ComponentType) && TypeDesc.NumComponents <= 4;
173}
175{
176 const FValueTypeDescription TypeDesc = GetValueTypeDescription(Type);
177 return IsNumericType(TypeDesc.ComponentType) && TypeDesc.NumComponents == 16;
178}
179
180struct FType
181{
186
187 const TCHAR* GetName() const;
188 FType GetDerivativeType() const;
191 bool IsVoid() const { return ValueType == EValueType::Void; }
192 bool IsStruct() const { return ValueType == EValueType::Struct; }
193 bool IsObject() const { return ValueType == EValueType::Object; }
194 bool IsAny() const { return ValueType == EValueType::Any; }
195 bool IsGeneric() const { return !IsStruct() && !IsObject() && IsGenericType(ValueType); }
196 bool IsNumeric() const { return !IsStruct() && !IsObject() && IsNumericType(ValueType); }
197 bool IsNumericScalar() const { return !IsStruct() && !IsObject() && IsNumericScalarType(ValueType); }
198 bool IsNumericVector() const { return !IsStruct() && !IsObject() && IsNumericVectorType(ValueType); }
199 bool IsNumericMatrix() const { return !IsStruct() && !IsObject() && IsNumericMatrixType(ValueType); }
200 bool IsNumericLWC() const { return IsNumeric() && IsLWCType(ValueType); }
201 int32 GetNumComponents() const;
202 int32 GetNumFlatFields() const;
205
206 inline operator EValueType() const { return ValueType; }
207 inline operator bool() const { return !IsVoid(); }
208 inline bool operator!() const { return IsVoid(); }
209
210 const FStructType* StructType = nullptr;
213};
214
215inline bool operator==(const FType& Lhs, const FType& Rhs)
216{
217 if (Lhs.ValueType != Rhs.ValueType) return false;
218 if (Lhs.ValueType == EValueType::Struct && Lhs.StructType != Rhs.StructType) return false;
219 if (Lhs.ValueType == EValueType::Object && Lhs.ObjectType != Rhs.ObjectType) return false;
220 return true;
221}
222inline bool operator!=(const FType& Lhs, const FType& Rhs)
223{
224 return !operator==(Lhs, Rhs);
225}
226
227inline bool operator==(const FType& Lhs, const EValueType& Rhs)
228{
229 return !Lhs.IsStruct() && Lhs.ValueType == Rhs;
230}
231inline bool operator!=(const FType& Lhs, const EValueType& Rhs)
232{
233 return !operator==(Lhs, Rhs);
234}
235
236inline bool operator==(const EValueType& Lhs, const FType& Rhs)
237{
238 return !Rhs.IsStruct() && Lhs == Rhs.ValueType;
239}
240inline bool operator!=(const EValueType& Lhs, const FType& Rhs)
241{
242 return !operator==(Lhs, Rhs);
243}
244
245ENGINE_API FType CombineTypes(const FType& Lhs, const FType& Rhs, bool bMergeMatrixTypes = false);
246
256
279
288
295
297{
298public:
300
302
304
307
308 const FStructType* FindType(uint64 Hash) const;
309
310private:
311 FMemStackBase* Allocator;
313};
314
315template<typename T>
316struct TValue
317{
318 inline T& operator[](int32 i) { check(i >= 0 && i < 4); return Component[i]; }
319 inline const T& operator[](int32 i) const { check(i >= 0 && i < 4); return Component[i]; }
320
322};
327
329{
331 HLSL,
332};
333
335{
336 static const uint32 MaxSize = sizeof(double) * 16;
339};
340
343{
348 FValueComponent(bool InValue) : Packed(0u) { Bool = InValue ? 1 : 0; }
349
350 // 'Bool' is stored as uint8 to avoid changing on different compilers
351 bool AsBool() const { return Bool != 0u; }
352
353 const TCHAR* ToString(EValueComponentType Type, FStringBuilderBase& OutString) const;
354
356 double Double;
357 float Float;
360};
361static_assert(sizeof(FValueComponent) == sizeof(uint64), "bad packing");
362
367struct FValue
368{
369 FValue() = default;
370
371 explicit FValue(const FType& InType) : Type(InType)
372 {
373 Component.AddDefaulted(InType.GetNumComponents());
374 }
375
380
381 inline FValue(float v) : Type(EValueType::Float1)
382 {
383 Component.Add(v);
384 }
385
386 inline FValue(float X, float Y) : Type(EValueType::Float2)
387 {
388 Component.Add(X);
389 Component.Add(Y);
390 }
391
392 inline FValue(float X, float Y, float Z) : Type(EValueType::Float3)
393 {
394 Component.Add(X);
395 Component.Add(Y);
396 Component.Add(Z);
397 }
398
399 inline FValue(float X, float Y, float Z, float W) : Type(EValueType::Float4)
400 {
401 Component.Add(X);
402 Component.Add(Y);
403 Component.Add(Z);
404 Component.Add(W);
405 }
406
407 inline FValue(double v) : Type(EValueType::Double1)
408 {
409 Component.Add(v);
410 }
411
412 inline FValue(double X, double Y) : Type(EValueType::Double2)
413 {
414 Component.Add(X);
415 Component.Add(Y);
416 }
417
418 inline FValue(double X, double Y, double Z) : Type(EValueType::Double3)
419 {
420 Component.Add(X);
421 Component.Add(Y);
422 Component.Add(Z);
423 }
424
425 inline FValue(double X, double Y, double Z, double W) : Type(EValueType::Double4)
426 {
427 Component.Add(X);
428 Component.Add(Y);
429 Component.Add(Z);
430 Component.Add(W);
431 }
432
434 {
435 Component.Add(Value.R);
436 Component.Add(Value.G);
437 Component.Add(Value.B);
438 Component.Add(Value.A);
439 }
440
442 {
443 Component.Add(Value.X);
444 Component.Add(Value.Y);
445 }
446
448 {
449 Component.Add(Value.X);
450 Component.Add(Value.Y);
451 Component.Add(Value.Z);
452 }
453
455 {
456 Component.Add(Value.X);
457 Component.Add(Value.Y);
458 Component.Add(Value.Z);
459 }
460
462 {
463 Component.Add(Value.X);
464 Component.Add(Value.Y);
465 Component.Add(Value.Z);
466 Component.Add(Value.W);
467 }
468
470 {
471 Component.Add(Value.X);
472 Component.Add(Value.Y);
473 Component.Add(Value.Z);
474 Component.Add(Value.W);
475 }
476
477 inline FValue(bool v) : Type(EValueType::Bool1)
478 {
479 Component.Add(v);
480 }
481
482 inline FValue(bool X, bool Y, bool Z, bool W) : Type(EValueType::Bool4)
483 {
484 Component.Add(X);
485 Component.Add(Y);
486 Component.Add(Z);
487 Component.Add(W);
488 }
489
491 {
492 Component.Add(v);
493 }
494
495 inline const FType& GetType() const { return Type; }
496 inline int32 GetNumComponents() const { return Type.GetNumComponents(); }
497
499 {
500 // Return scalar value for any request to xyzw
501 const int32 ComponentIndex = (Type.IsNumericScalar() && Index >= 0 && Index < 4) ? 0 : Index;
502 if (Component.IsValidIndex(ComponentIndex))
503 {
504 return Component[ComponentIndex];
505 }
506 return FValueComponent();
507 }
508
509 static FValue FromMemoryImage(EValueType Type, const void* Data, uint32* OutSizeInBytes = nullptr);
511
512 FFloatValue AsFloat() const;
513 FDoubleValue AsDouble() const;
514 FIntValue AsInt() const;
515 FBoolValue AsBool() const;
516
518 FVector4d AsVector4d() const;
519 float AsFloatScalar() const;
520 bool AsBoolScalar() const;
521
522 bool IsZero() const;
523
524 const TCHAR* ToString(EValueStringFormat Format, FStringBuilderBase& OutString) const;
525
528};
529
530ENGINE_API bool operator==(const FValue& Lhs, const FValue& Rhs);
531inline bool operator!=(const FValue& Lhs, const FValue& Rhs) { return !operator==(Lhs, Rhs); }
532ENGINE_API uint32 GetTypeHash(const FType& Type);
533ENGINE_API uint32 GetTypeHash(const FValue& Value);
534
535ENGINE_API FValue Neg(const FValue& Value);
536ENGINE_API FValue Abs(const FValue& Value);
537ENGINE_API FValue Saturate(const FValue& Value);
538ENGINE_API FValue Floor(const FValue& Value);
539ENGINE_API FValue Ceil(const FValue& Value);
540ENGINE_API FValue Round(const FValue& Value);
541ENGINE_API FValue Trunc(const FValue& Value);
542ENGINE_API FValue Sign(const FValue& Value);
543ENGINE_API FValue Frac(const FValue& Value);
544ENGINE_API FValue Fractional(const FValue& Value);
545ENGINE_API FValue Sqrt(const FValue& Value);
546ENGINE_API FValue Rcp(const FValue& Value);
547ENGINE_API FValue Exp(const FValue& Value);
548ENGINE_API FValue Exp2(const FValue& Value);
549ENGINE_API FValue Log(const FValue& Value);
550ENGINE_API FValue Log2(const FValue& Value);
551ENGINE_API FValue Log10(const FValue& Value);
552ENGINE_API FValue Sin(const FValue& Value);
553ENGINE_API FValue Cos(const FValue& Value);
554ENGINE_API FValue Tan(const FValue& Value);
555ENGINE_API FValue Asin(const FValue& Value);
556ENGINE_API FValue Acos(const FValue& Value);
557ENGINE_API FValue Atan(const FValue& Value);
558
559ENGINE_API FValue Add(const FValue& Lhs, const FValue& Rhs);
560ENGINE_API FValue Sub(const FValue& Lhs, const FValue& Rhs);
561ENGINE_API FValue Mul(const FValue& Lhs, const FValue& Rhs);
562ENGINE_API FValue Div(const FValue& Lhs, const FValue& Rhs);
563ENGINE_API FValue Less(const FValue& Lhs, const FValue& Rhs);
564ENGINE_API FValue Greater(const FValue& Lhs, const FValue& Rhs);
565ENGINE_API FValue LessEqual(const FValue& Lhs, const FValue& Rhs);
566ENGINE_API FValue GreaterEqual(const FValue& Lhs, const FValue& Rhs);
567ENGINE_API FValue Min(const FValue& Lhs, const FValue& Rhs);
568ENGINE_API FValue Max(const FValue& Lhs, const FValue& Rhs);
569ENGINE_API FValue Clamp(const FValue& Value, const FValue& Low, const FValue& High);
570ENGINE_API FValue Fmod(const FValue& Lhs, const FValue& Rhs);
571ENGINE_API FValue Modulo(const FValue& Lhs, const FValue& Rhs);
572ENGINE_API FValue Atan2(const FValue& Lhs, const FValue& Rhs);
573ENGINE_API FValue Dot(const FValue& Lhs, const FValue& Rhs);
574ENGINE_API FValue Cross(const FValue& Lhs, const FValue& Rhs);
575ENGINE_API FValue Append(const FValue& Lhs, const FValue& Rhs);
576
577ENGINE_API FValue Cast(const FValue& Value, EValueType Type);
578
579// In place versions of certain functions. Only works on numeric types. Overwrites input components in place,
580// possibly changing their type (returns the new type).
604
615
616} // namespace UE::Shader
617
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int8 int8
An 8-bit signed integer.
Definition Platform.h:1121
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define X(Name, Desc)
Definition FormatStringSan.h:47
#define DECLARE_INTRINSIC_TYPE_LAYOUT(T)
Definition MemoryLayout.h:760
const bool
Definition NetworkReplayStreaming.h:178
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition MemStack.h:78
Definition NameTypes.h:617
Definition ArrayView.h:139
UE_FORCEINLINE_HINT constexpr SizeType Num() const
Definition ArrayView.h:380
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition ShaderTypes.h:297
const FStructType * FindType(uint64 Hash) const
Definition ShaderValue.cpp:913
const FStructType * NewExternalType(FStringView Name)
Definition ShaderValue.cpp:897
void EmitDeclarationsCode(FStringBuilderBase &OutCode) const
Definition ShaderValue.cpp:764
const FStructType * NewType(const FStructTypeInitializer &Initializer)
Definition ShaderValue.cpp:813
Definition Texture.h:1219
Definition SparseVolumeTexture.h:19
bool IsLWCType(EValueComponentType Type)
Definition ShaderTypes.h:91
EValueType MinInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1897
EValueType FracInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1802
EValueType FmodInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1907
EValueType FloorInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1777
FValue Cast(const FValue &Value, EValueType Type)
Definition ShaderValue.cpp:1738
EValueType ModuloInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1912
bool IsWithinBounds(FComponentBounds Lhs, FComponentBounds Rhs)
Definition ShaderTypes.h:53
EValueType MakeDerivativeType(EValueType Type)
Definition ShaderValue.cpp:749
uint32 GetTypeHash(const FType &Type)
Definition ShaderValue.cpp:1358
EValueType AsinInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1862
EValueType Log2InPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1837
bool IsNumericScalarType(EValueType Type)
Definition ShaderTypes.h:164
EComponentBound MaxBound(EComponentBound Lhs, EComponentBound Rhs)
Definition ShaderTypes.h:32
EValueType SqrtInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1812
EValueType RcpInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1817
EValueType CeilInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1782
EValueType AcosInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1867
EValueType NegInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1762
EValueType AtanInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1872
bool IsNumericVectorType(EValueType Type)
Definition ShaderTypes.h:169
EValueType SinInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1847
EValueType MakeValueType(EValueComponentType ComponentType, int32 NumComponents)
Definition ShaderValue.cpp:644
EValueType SubInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1882
constexpr int32 NumValueTypes
Definition ShaderTypes.h:140
EValueType
Definition ShaderTypes.h:94
bool operator!=(const FComponentBounds &Lhs, const FComponentBounds &Rhs)
Definition ShaderTypes.h:46
EValueType AddInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1877
EValueComponentType CombineComponentTypes(EValueComponentType Lhs, EValueComponentType Rhs)
Definition ShaderValue.cpp:530
EValueType FractionalInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1807
EValueType Atan2InPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1917
const TCHAR * GetComponentTypeName(EValueComponentType Type)
Definition ShaderTypes.h:81
bool IsComponentTypeWithinBounds(EValueComponentType Type, FComponentBounds Bounds)
Definition ShaderTypes.h:84
EValueType MulInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1887
bool IsNumericMatrixType(EValueType Type)
Definition ShaderTypes.h:174
EValueType SaturateInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1772
EValueComponentType
Definition ShaderTypes.h:56
EValueType TanInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1857
EValueType Log10InPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1842
FValueComponentTypeDescription GetValueComponentTypeDescription(EValueComponentType Type)
Definition ShaderValue.cpp:516
EValueType MaxInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1902
bool IsNumericType(EValueComponentType Type)
Definition ShaderTypes.h:83
EComponentBound MinBound(EComponentBound Lhs, EComponentBound Rhs)
Definition ShaderTypes.h:31
EValueType DivInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1892
EValueType MakeConcreteType(EValueType Type)
Definition ShaderValue.cpp:738
EValueType Exp2InPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1827
EValueType TruncInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1792
EValueType MakeNonLWCType(EValueType Type)
Definition ShaderValue.cpp:727
EValueType SignInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1797
EValueType FindValueType(FName Name)
Definition ShaderValue.cpp:630
EComponentBound
Definition ShaderTypes.h:19
bool operator==(const FValue &Lhs, const FValue &Rhs)
Definition ShaderValue.cpp:1340
EValueStringFormat
Definition ShaderTypes.h:329
EValueType CosInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1852
EValueType MakeValueTypeWithRequestedNumComponents(EValueType BaseType, int8 RequestedNumComponents)
Definition ShaderValue.cpp:721
EValueType ExpInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1822
uint32 GetComponentTypeSizeInBytes(EValueComponentType Type)
Definition ShaderTypes.h:82
const FValueTypeDescription & GetValueTypeDescription(EValueType Type)
Definition ShaderValue.cpp:66
FType CombineTypes(const FType &Lhs, const FType &Rhs, bool bMergeMatrixTypes)
Definition ShaderValue.cpp:174
EValueType AppendInPlace(EValueType LhsType, EValueType RhsType, TArrayView< FValueComponent > Component, int32 &OutComponentsConsumed)
Definition ShaderValue.cpp:1922
EValueType RoundInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1787
EValueType LogInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1832
EValueType AbsInPlace(EValueType Type, TArrayView< FValueComponent > Component)
Definition ShaderValue.cpp:1767
bool IsGenericType(EValueComponentType Type)
Definition ShaderTypes.h:90
float v
Definition radaudio_mdct.cpp:62
U16 Index
Definition radfft.cpp:71
Definition Color.h:48
Definition ShaderTypes.h:35
EComponentBound Min
Definition ShaderTypes.h:39
EComponentBound Max
Definition ShaderTypes.h:40
FComponentBounds(EComponentBound InMin, EComponentBound InMax)
Definition ShaderTypes.h:37
Definition ShaderTypes.h:335
uint8 Bytes[MaxSize]
Definition ShaderTypes.h:337
uint32 Size
Definition ShaderTypes.h:338
static const uint32 MaxSize
Definition ShaderTypes.h:336
Definition ShaderTypes.h:281
FStructFieldInitializer(const FStringView &InName, const FType &InType)
Definition ShaderTypes.h:283
FType Type
Definition ShaderTypes.h:286
FStringView Name
Definition ShaderTypes.h:285
Definition ShaderTypes.h:248
int32 FlatFieldIndex
Definition ShaderTypes.h:252
const TCHAR * Name
Definition ShaderTypes.h:249
FType Type
Definition ShaderTypes.h:250
int32 ComponentIndex
Definition ShaderTypes.h:251
int32 GetNumComponents() const
Definition ShaderTypes.h:254
Definition ShaderTypes.h:290
TArrayView< const FStructFieldInitializer > Fields
Definition ShaderTypes.h:292
FStringView Name
Definition ShaderTypes.h:291
bool bIsDerivativeType
Definition ShaderTypes.h:293
Definition ShaderTypes.h:258
const FStructType * DerivativeType
Definition ShaderTypes.h:261
TArrayView< const FStructField > Fields
Definition ShaderTypes.h:262
int32 GetNumComponents() const
Definition ShaderTypes.h:275
TArrayView< const EValueType > FlatFieldTypes
Definition ShaderTypes.h:272
bool IsExternal() const
Definition ShaderTypes.h:274
TArrayView< const EValueComponentType > ComponentTypes
Definition ShaderTypes.h:267
const FStructField * FindFieldByName(const TCHAR *InName) const
Definition ShaderValue.cpp:208
const TCHAR * Name
Definition ShaderTypes.h:260
uint64 Hash
Definition ShaderTypes.h:259
Definition ShaderTypes.h:181
bool IsNumericLWC() const
Definition ShaderTypes.h:200
FType GetNonLWCType() const
Definition ShaderTypes.h:189
int32 GetNumComponents() const
Definition ShaderValue.cpp:104
EValueType ValueType
Definition ShaderTypes.h:212
FType(FName InObjectType)
Definition ShaderTypes.h:185
bool IsNumericScalar() const
Definition ShaderTypes.h:197
FType GetDerivativeType() const
Definition ShaderValue.cpp:88
const TCHAR * GetName() const
Definition ShaderValue.cpp:74
EValueType GetFlatFieldType(int32 Index) const
Definition ShaderValue.cpp:161
bool IsNumericMatrix() const
Definition ShaderTypes.h:199
const FStructType * StructType
Definition ShaderTypes.h:210
bool IsNumericVector() const
Definition ShaderTypes.h:198
bool operator!() const
Definition ShaderTypes.h:208
bool IsGeneric() const
Definition ShaderTypes.h:195
int32 GetNumFlatFields() const
Definition ShaderValue.cpp:121
FType GetConcreteType() const
Definition ShaderTypes.h:190
bool IsAny() const
Definition ShaderTypes.h:194
bool IsObject() const
Definition ShaderTypes.h:193
bool IsStruct() const
Definition ShaderTypes.h:192
FName ObjectType
Definition ShaderTypes.h:211
EValueComponentType GetComponentType(int32 Index) const
Definition ShaderValue.cpp:133
FType(const FStructType *InStruct)
Definition ShaderTypes.h:184
FType(EValueType InValueType)
Definition ShaderTypes.h:183
FType()
Definition ShaderTypes.h:182
bool IsVoid() const
Definition ShaderTypes.h:191
bool IsNumeric() const
Definition ShaderTypes.h:196
FValueComponentTypeDescription(const TCHAR *InName, uint32_t InSizeInBytes, EComponentBound InMin, EComponentBound InMax)
Definition ShaderTypes.h:73
FComponentBounds Bounds
Definition ShaderTypes.h:77
uint32_t SizeInBytes
Definition ShaderTypes.h:76
const TCHAR * Name
Definition ShaderTypes.h:75
Definition ShaderTypes.h:143
int8 NumComponents
Definition ShaderTypes.h:147
EValueComponentType ComponentType
Definition ShaderTypes.h:146
const TCHAR * Name
Definition ShaderTypes.h:144
int8 ComponentSizeInBytes
Definition ShaderTypes.h:148
EValueType ValueType
Definition ShaderTypes.h:145
Definition ShaderTypes.h:368
FValueComponent GetComponent(int32 Index) const
Definition ShaderTypes.h:498
FLinearColor AsLinearColor() const
Definition ShaderValue.cpp:453
bool IsZero() const
Definition ShaderValue.cpp:499
FValue(double X, double Y, double Z, double W)
Definition ShaderTypes.h:425
FValue(double X, double Y)
Definition ShaderTypes.h:412
FValue(const FVector3d &Value)
Definition ShaderTypes.h:454
FValue(const FVector2f &Value)
Definition ShaderTypes.h:441
FValue(float X, float Y)
Definition ShaderTypes.h:386
const FType & GetType() const
Definition ShaderTypes.h:495
FIntValue AsInt() const
Definition ShaderValue.cpp:465
FValue(EValueComponentType InComponentType, int8 InNumComponents)
Definition ShaderTypes.h:376
FDoubleValue AsDouble() const
Definition ShaderValue.cpp:446
FFloatValue AsFloat() const
Definition ShaderValue.cpp:439
FValue(float v)
Definition ShaderTypes.h:381
FVector4d AsVector4d() const
Definition ShaderValue.cpp:459
FValue(int32 v)
Definition ShaderTypes.h:490
FValue(float X, float Y, float Z)
Definition ShaderTypes.h:392
FValue(double v)
Definition ShaderTypes.h:407
FValue(bool X, bool Y, bool Z, bool W)
Definition ShaderTypes.h:482
FValue(const FVector4d &Value)
Definition ShaderTypes.h:469
TArray< FValueComponent, TInlineAllocator< 16 > > Component
Definition ShaderTypes.h:527
FType Type
Definition ShaderTypes.h:526
FValue(double X, double Y, double Z)
Definition ShaderTypes.h:418
FValue(float X, float Y, float Z, float W)
Definition ShaderTypes.h:399
FValue(bool v)
Definition ShaderTypes.h:477
FValue(const FType &InType)
Definition ShaderTypes.h:371
FValue(const FVector3f &Value)
Definition ShaderTypes.h:447
FBoolValue AsBool() const
Definition ShaderValue.cpp:472
static FValue FromMemoryImage(EValueType Type, const void *Data, uint32 *OutSizeInBytes=nullptr)
Definition ShaderValue.cpp:395
FValue(const FVector4f &Value)
Definition ShaderTypes.h:461
float AsFloatScalar() const
Definition ShaderValue.cpp:479
FMemoryImageValue AsMemoryImage() const
Definition ShaderValue.cpp:418
FValue(const FLinearColor &Value)
Definition ShaderTypes.h:433
bool AsBoolScalar() const
Definition ShaderValue.cpp:486
int32 GetNumComponents() const
Definition ShaderTypes.h:496
Definition ShaderTypes.h:317
T Component[4]
Definition ShaderTypes.h:321
const T & operator[](int32 i) const
Definition ShaderTypes.h:319
T & operator[](int32 i)
Definition ShaderTypes.h:318
Definition ShaderTypes.h:343
double Double
Definition ShaderTypes.h:356
FValueComponent(int32 InValue)
Definition ShaderTypes.h:347
FValueComponent(bool InValue)
Definition ShaderTypes.h:348
float Float
Definition ShaderTypes.h:357
FValueComponent(float InValue)
Definition ShaderTypes.h:345
bool AsBool() const
Definition ShaderTypes.h:351
uint8 Bool
Definition ShaderTypes.h:359
FValueComponent()
Definition ShaderTypes.h:344
uint64 Packed
Definition ShaderTypes.h:355
int32 Int
Definition ShaderTypes.h:358
FValueComponent(double InValue)
Definition ShaderTypes.h:346