UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PreshaderTypes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
6
7namespace UE
8{
9namespace Shader
10{
11
30
40
42{
43public:
44 int32 Num() const { return Values.Num(); }
45
46 void CheckEmpty() const
47 {
48 check(Values.Num() == 0);
49 check(Components.Num() == 0);
50 }
51
52 void PushValue(const FValue& InValue);
57
61
63 inline const FPreshaderType& PeekType()
64 {
65 return Values.Last();
66 }
67 inline FValueComponent* PeekComponents(int32 NumComponents)
68 {
69 return &Components[Components.Num() - NumComponents];
70 }
71
74
76 inline void OverrideTopType(EValueType ValueType)
77 {
78 check(!Values.Last().IsStruct());
79 Values.Last().ValueType = ValueType;
80 }
81
84 {
85 Values.RemoveAt(Values.Num() - 1, EAllowShrinking::No);
86 Components.RemoveAt(Components.Num() - ComponentsConsumed, ComponentsConsumed, EAllowShrinking::No);
87 Values.Last().ValueType = ValueType;
88 }
89
90 // Adjust component count, by adding or removing components by the specified amount
92 {
93 if (NumComponentChange > 0)
94 {
95 Components.AddUninitialized(NumComponentChange);
96 }
97 else if (NumComponentChange < 0)
98 {
99 Components.RemoveAt(Components.Num() + NumComponentChange, -NumComponentChange, EAllowShrinking::No);
100 }
101 }
102
103 void Reset()
104 {
105 Values.Reset();
106 Components.Reset();
107 }
108
109private:
112};
113
114} // namespace Shader
115} // namespace UE
#define check(expr)
Definition AssertionMacros.h:314
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
uint32 Offset
Definition VulkanMemory.cpp:4033
Definition ArrayView.h:139
UE_FORCEINLINE_HINT constexpr SizeType Num() const
Definition ArrayView.h:380
Definition Array.h:670
Definition PreshaderTypes.h:42
void MergeTopTwoValues(EValueType ValueType, int32 ComponentsConsumed)
Definition PreshaderTypes.h:83
int32 Num() const
Definition PreshaderTypes.h:44
void PopResult(FPreshaderValue &OutValue)
Definition Preshader.cpp:171
TArrayView< FValueComponent > PushEmptyValue(const FPreshaderType &InType)
Definition Preshader.cpp:141
FPreshaderValue PopValue()
Definition Preshader.cpp:157
void Reset()
Definition PreshaderTypes.h:103
FValueComponent * PeekComponents(int32 NumComponents)
Definition PreshaderTypes.h:67
void OverrideTopType(EValueType ValueType)
Definition PreshaderTypes.h:76
FPreshaderValue PeekValue(int32 Offset=0)
Definition Preshader.cpp:187
void CheckEmpty() const
Definition PreshaderTypes.h:46
void AdjustComponentCount(int32 NumComponentChange)
Definition PreshaderTypes.h:91
const FPreshaderType & PeekType()
Definition PreshaderTypes.h:63
Definition ShaderTypes.h:297
EValueType
Definition ShaderTypes.h:94
EValueComponentType
Definition ShaderTypes.h:56
const FValueTypeDescription & GetValueTypeDescription(EValueType Type)
Definition ShaderValue.cpp:66
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition PreshaderTypes.h:17
EValueComponentType GetComponentType(int32 Index) const
Definition Preshader.cpp:107
uint64 StructTypeHash
Definition PreshaderTypes.h:26
TArrayView< const EValueComponentType > StructComponentTypes
Definition PreshaderTypes.h:27
int32 GetNumComponents() const
Definition PreshaderTypes.h:23
bool IsStruct() const
Definition PreshaderTypes.h:22
EValueType ValueType
Definition PreshaderTypes.h:28
Definition PreshaderTypes.h:33
FPreshaderType Type
Definition PreshaderTypes.h:34
FValue AsShaderValue(const FStructTypeRegistry *TypeRegistry=nullptr) const
Definition Preshader.cpp:205
TArrayView< FValueComponent > Component
Definition PreshaderTypes.h:35
Definition ShaderTypes.h:181
int8 NumComponents
Definition ShaderTypes.h:147
Definition ShaderTypes.h:368
Definition ShaderTypes.h:343