UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FUniformExpressionSet Class Reference

#include <MaterialShared.h>

Classes

union  FVTPackedStackAndLayerIndex
 

Public Member Functions

 FUniformExpressionSet ()
 
bool IsEmpty () const
 
bool operator== (const FUniformExpressionSet &ReferenceSet) const
 
ENGINE_API FString GetSummaryString () const
 
FShaderParametersMetadataCreateBufferStruct ()
 
void SetParameterCollections (TConstArrayView< const class UMaterialParameterCollection * > Collections)
 
ENGINE_API void FillUniformBuffer (const FMaterialRenderContext &MaterialRenderContext, const FUniformExpressionCache &UniformExpressionCache, const FRHIUniformBufferLayout *UniformBufferLayout, uint8 *TempBuffer, int TempBufferSize) const
 
ENGINE_API void FillUniformBuffer (const FMaterialRenderContext &MaterialRenderContext, TConstArrayView< IAllocatedVirtualTexture * > AllocatedVTs, const FRHIUniformBufferLayout *UniformBufferLayout, uint8 *TempBuffer, int TempBufferSize) const
 
ENGINE_API uint32 GetReferencedTexture2DRHIHash (const FMaterialRenderContext &MaterialRenderContext) const
 
bool HasExternalTextureExpressions () const
 
const FRHIUniformBufferLayoutInitializerGetUniformBufferLayoutInitializer () const
 
UE::Shader::FValue GetDefaultParameterValue (EMaterialParameterType Type, uint32 Offset) const
 
const uint8GetDefaultParameterData (uint32 Offset) const
 
const FMaterialNumericParameterInfoGetNumericParameter (uint32 Index) const
 
const FMaterialTextureParameterInfoGetTextureParameter (EMaterialTextureParameterType Type, int32 Index) const
 
const FMaterialTextureCollectionParameterInfoGetTextureCollectionParameter (int32 Index) const
 
int32 GetNumTextures (EMaterialTextureParameterType Type) const
 
ENGINE_API void GetGameThreadTextureValue (EMaterialTextureParameterType Type, int32 Index, const UMaterialInterface *MaterialInterface, const FMaterial &Material, UTexture *&OutValue, bool bAllowOverride=true) const
 
ENGINE_API void GetTextureValue (EMaterialTextureParameterType Type, int32 Index, const FMaterialRenderContext &Context, const FMaterial &Material, const UTexture *&OutValue) const
 
ENGINE_API void GetTextureValue (int32 Index, const FMaterialRenderContext &Context, const FMaterial &Material, const URuntimeVirtualTexture *&OutValue) const
 
ENGINE_API void GetTextureValue (int32 Index, const FMaterialRenderContext &Context, const FMaterial &Material, const USparseVolumeTexture *&OutValue) const
 
int32 GetNumTextureCollections () const
 
ENGINE_API void GetGameThreadTextureCollectionValue (int32 Index, const UMaterialInterface *MaterialInterface, const FMaterial &Material, UTextureCollection *&OutValue) const
 
ENGINE_API void GetTextureCollectionValue (int32 Index, const FMaterialRenderContext &Context, const FMaterial &Material, const UTextureCollection *&OutValue) const
 
int32 FindOrAddTextureParameter (EMaterialTextureParameterType Type, const FMaterialTextureParameterInfo &Info)
 
int32 FindOrAddTextureCollectionParameter (const FMaterialTextureCollectionParameterInfo &Info)
 
int32 FindOrAddExternalTextureParameter (const FMaterialExternalTextureParameterInfo &Info)
 
int32 FindOrAddNumericParameter (EMaterialParameterType Type, const FMaterialParameterInfo &ParameterInfo, uint32 DefaultValueOffset)
 
uint32 AddDefaultParameterValue (const UE::Shader::FValue &Value)
 
void AddNumericParameterEvaluation (uint32 ParameterIndex, uint32 BufferOffset)
 
uint32 GetNumericParameterEvaluationOffset (uint32 ParameterIndex) const
 Returns the offset of specified parameter given with AddNumericParameterEvaluation.
 
uint32 AllocateFromUniformBuffer (uint32 NumOfFloat4s)
 
TConstArrayView< FMaterialCacheTagStackGetMaterialCacheTagStacks () const
 
TConstArrayView< FMaterialVirtualTextureStackGetVTStacks () const
 
const FMaterialVirtualTextureStackGetVTStack (int32 Index) const
 
int32 AddVTStack (int32 InPreallocatedStackTextureIndex)
 
int32 AddVTLayer (int32 StackIndex, int32 TextureIndex)
 
void SetVTLayer (int32 StackIndex, int32 VTLayerIndex, int32 TextureIndex)
 
void WriteUniformPreshaderEntry (uint32 BufferOffset, UE::Shader::EValueType EntryType, const TFunction< void(UE::Shader::FPreshaderData &)> &EntryGenerator)
 
void CountTextureCollections (uint32 &BindlessCollections, uint32 &VirtualCollections) const
 

Protected Member Functions

FVTPackedStackAndLayerIndex GetVTStackAndLayerIndex (int32 UniformExpressionIndex) const
 
 LAYOUT_FIELD (TMemoryImageArray< FMaterialUniformParameterEvaluation >, UniformParameterEvaluations)
 
 LAYOUT_FIELD (TMemoryImageArray< FMaterialUniformPreshaderHeader >, UniformPreshaders)
 
 LAYOUT_FIELD (TMemoryImageArray< FMaterialUniformPreshaderField >, UniformPreshaderFields)
 
 LAYOUT_FIELD (TMemoryImageArray< FMaterialNumericParameterInfo >, UniformNumericParameters)
 
 LAYOUT_ARRAY (TMemoryImageArray< FMaterialTextureParameterInfo >, UniformTextureParameters, NumMaterialTextureParameterTypes)
 
 LAYOUT_FIELD (TMemoryImageArray< FMaterialExternalTextureParameterInfo >, UniformExternalTextureParameters)
 
 LAYOUT_FIELD (TMemoryImageArray< FMaterialTextureCollectionParameterInfo >, UniformTextureCollectionParameters)
 
 LAYOUT_FIELD (uint32, UniformPreshaderBufferSize)
 
 LAYOUT_FIELD (UE::Shader::FPreshaderData, UniformPreshaderData)
 
 LAYOUT_FIELD (TMemoryImageArray< uint8 >, DefaultValues)
 
 LAYOUT_FIELD (TMemoryImageArray< FMaterialVirtualTextureStack >, VTStacks)
 
 LAYOUT_FIELD (TMemoryImageArray< FGuid >, ParameterCollections)
 
 LAYOUT_FIELD (FRHIUniformBufferLayoutInitializer, UniformBufferLayoutInitializer)
 

Friends

class FMaterial
 
class FHLSLMaterialTranslator
 
class FMaterialShaderMap
 
class FMaterialShader
 
class FMaterialRenderProxy
 
class FMaterialVirtualTextureStack
 
class FDebugUniformExpressionSet
 

Detailed Description

Stores all uniform expressions for a material generated from a material translation.

Constructor & Destructor Documentation

◆ FUniformExpressionSet()

FUniformExpressionSet::FUniformExpressionSet ( )
inline

Member Function Documentation

◆ AddDefaultParameterValue()

uint32 FUniformExpressionSet::AddDefaultParameterValue ( const UE::Shader::FValue Value)

◆ AddNumericParameterEvaluation()

void FUniformExpressionSet::AddNumericParameterEvaluation ( uint32  ParameterIndex,
uint32  BufferOffset 
)

Adds a new direct parameter evaluation for parameter with specified index (returned by FindOrAddNumericParameter) BufferOffset is the location in the uniform buffer in which to evaluate the parameter (in multiple of float components).

◆ AddVTLayer()

int32 FUniformExpressionSet::AddVTLayer ( int32  StackIndex,
int32  TextureIndex 
)

◆ AddVTStack()

int32 FUniformExpressionSet::AddVTStack ( int32  InPreallocatedStackTextureIndex)

◆ AllocateFromUniformBuffer()

uint32 FUniformExpressionSet::AllocateFromUniformBuffer ( uint32  NumOfFloat4s)

Allocates the specified number of float4s in the uniform buffer and returns the index of the first newly allocated float4 in the buffer. Note: multiply returned value by sizeof(float4) to know the byte offset in the buffer.

◆ CountTextureCollections()

void FUniformExpressionSet::CountTextureCollections ( uint32 BindlessCollections,
uint32 VirtualCollections 
) const

◆ CreateBufferStruct()

FShaderParametersMetadata * FUniformExpressionSet::CreateBufferStruct ( )

◆ FillUniformBuffer() [1/2]

void FUniformExpressionSet::FillUniformBuffer ( const FMaterialRenderContext MaterialRenderContext,
const FUniformExpressionCache UniformExpressionCache,
const FRHIUniformBufferLayout UniformBufferLayout,
uint8 TempBuffer,
int  TempBufferSize 
) const

◆ FillUniformBuffer() [2/2]

void FUniformExpressionSet::FillUniformBuffer ( const FMaterialRenderContext MaterialRenderContext,
TConstArrayView< IAllocatedVirtualTexture * >  AllocatedVTs,
const FRHIUniformBufferLayout UniformBufferLayout,
uint8 TempBuffer,
int  TempBufferSize 
) const

◆ FindOrAddExternalTextureParameter()

int32 FUniformExpressionSet::FindOrAddExternalTextureParameter ( const FMaterialExternalTextureParameterInfo Info)

◆ FindOrAddNumericParameter()

int32 FUniformExpressionSet::FindOrAddNumericParameter ( EMaterialParameterType  Type,
const FMaterialParameterInfo ParameterInfo,
uint32  DefaultValueOffset 
)

◆ FindOrAddTextureCollectionParameter()

int32 FUniformExpressionSet::FindOrAddTextureCollectionParameter ( const FMaterialTextureCollectionParameterInfo Info)

◆ FindOrAddTextureParameter()

int32 FUniformExpressionSet::FindOrAddTextureParameter ( EMaterialTextureParameterType  Type,
const FMaterialTextureParameterInfo Info 
)

◆ GetDefaultParameterData()

const uint8 * FUniformExpressionSet::GetDefaultParameterData ( uint32  Offset) const
inline

◆ GetDefaultParameterValue()

UE::Shader::FValue FUniformExpressionSet::GetDefaultParameterValue ( EMaterialParameterType  Type,
uint32  Offset 
) const
inline

◆ GetGameThreadTextureCollectionValue()

void FUniformExpressionSet::GetGameThreadTextureCollectionValue ( int32  Index,
const UMaterialInterface MaterialInterface,
const FMaterial Material,
UTextureCollection *&  OutValue 
) const

◆ GetGameThreadTextureValue()

void FUniformExpressionSet::GetGameThreadTextureValue ( EMaterialTextureParameterType  Type,
int32  Index,
const UMaterialInterface MaterialInterface,
const FMaterial Material,
UTexture *&  OutValue,
bool  bAllowOverride = true 
) const

◆ GetMaterialCacheTagStacks()

TConstArrayView< FMaterialCacheTagStack > FUniformExpressionSet::GetMaterialCacheTagStacks ( ) const
inline

◆ GetNumericParameter()

const FMaterialNumericParameterInfo & FUniformExpressionSet::GetNumericParameter ( uint32  Index) const
inline

◆ GetNumericParameterEvaluationOffset()

uint32 FUniformExpressionSet::GetNumericParameterEvaluationOffset ( uint32  ParameterIndex) const

Returns the offset of specified parameter given with AddNumericParameterEvaluation.

◆ GetNumTextureCollections()

int32 FUniformExpressionSet::GetNumTextureCollections ( ) const
inline

◆ GetNumTextures()

int32 FUniformExpressionSet::GetNumTextures ( EMaterialTextureParameterType  Type) const
inline

◆ GetReferencedTexture2DRHIHash()

uint32 FUniformExpressionSet::GetReferencedTexture2DRHIHash ( const FMaterialRenderContext MaterialRenderContext) const

◆ GetSummaryString()

FString FUniformExpressionSet::GetSummaryString ( ) const

◆ GetTextureCollectionParameter()

const FMaterialTextureCollectionParameterInfo & FUniformExpressionSet::GetTextureCollectionParameter ( int32  Index) const
inline

◆ GetTextureCollectionValue()

void FUniformExpressionSet::GetTextureCollectionValue ( int32  Index,
const FMaterialRenderContext Context,
const FMaterial Material,
const UTextureCollection *&  OutValue 
) const

◆ GetTextureParameter()

const FMaterialTextureParameterInfo & FUniformExpressionSet::GetTextureParameter ( EMaterialTextureParameterType  Type,
int32  Index 
) const
inline

◆ GetTextureValue() [1/3]

void FUniformExpressionSet::GetTextureValue ( EMaterialTextureParameterType  Type,
int32  Index,
const FMaterialRenderContext Context,
const FMaterial Material,
const UTexture *&  OutValue 
) const

◆ GetTextureValue() [2/3]

void FUniformExpressionSet::GetTextureValue ( int32  Index,
const FMaterialRenderContext Context,
const FMaterial Material,
const URuntimeVirtualTexture *&  OutValue 
) const

◆ GetTextureValue() [3/3]

void FUniformExpressionSet::GetTextureValue ( int32  Index,
const FMaterialRenderContext Context,
const FMaterial Material,
const USparseVolumeTexture *&  OutValue 
) const

◆ GetUniformBufferLayoutInitializer()

const FRHIUniformBufferLayoutInitializer & FUniformExpressionSet::GetUniformBufferLayoutInitializer ( ) const
inline

◆ GetVTStack()

const FMaterialVirtualTextureStack & FUniformExpressionSet::GetVTStack ( int32  Index) const
inline

◆ GetVTStackAndLayerIndex()

FUniformExpressionSet::FVTPackedStackAndLayerIndex FUniformExpressionSet::GetVTStackAndLayerIndex ( int32  UniformExpressionIndex) const
protected

◆ GetVTStacks()

TConstArrayView< FMaterialVirtualTextureStack > FUniformExpressionSet::GetVTStacks ( ) const
inline

◆ HasExternalTextureExpressions()

bool FUniformExpressionSet::HasExternalTextureExpressions ( ) const
inline

◆ IsEmpty()

bool FUniformExpressionSet::IsEmpty ( ) const

◆ LAYOUT_ARRAY()

FUniformExpressionSet::LAYOUT_ARRAY ( TMemoryImageArray< FMaterialTextureParameterInfo ,
UniformTextureParameters  ,
NumMaterialTextureParameterTypes   
)
protected

◆ LAYOUT_FIELD() [1/12]

FUniformExpressionSet::LAYOUT_FIELD ( FRHIUniformBufferLayoutInitializer  ,
UniformBufferLayoutInitializer   
)
protected

◆ LAYOUT_FIELD() [2/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FGuid ,
ParameterCollections   
)
protected

Material cache tag stacks found during translation Ids of parameter collections referenced by the material that was translated.

◆ LAYOUT_FIELD() [3/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FMaterialExternalTextureParameterInfo ,
UniformExternalTextureParameters   
)
protected

◆ LAYOUT_FIELD() [4/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FMaterialNumericParameterInfo ,
UniformNumericParameters   
)
protected

◆ LAYOUT_FIELD() [5/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FMaterialTextureCollectionParameterInfo ,
UniformTextureCollectionParameters   
)
protected

◆ LAYOUT_FIELD() [6/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FMaterialUniformParameterEvaluation ,
UniformParameterEvaluations   
)
protected

◆ LAYOUT_FIELD() [7/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FMaterialUniformPreshaderField ,
UniformPreshaderFields   
)
protected

◆ LAYOUT_FIELD() [8/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FMaterialUniformPreshaderHeader ,
UniformPreshaders   
)
protected

◆ LAYOUT_FIELD() [9/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< FMaterialVirtualTextureStack ,
VTStacks   
)
protected

Virtual texture stacks found during compilation

◆ LAYOUT_FIELD() [10/12]

FUniformExpressionSet::LAYOUT_FIELD ( TMemoryImageArray< uint8 ,
DefaultValues   
)
protected

◆ LAYOUT_FIELD() [11/12]

FUniformExpressionSet::LAYOUT_FIELD ( UE::Shader::FPreshaderData  ,
UniformPreshaderData   
)
protected

◆ LAYOUT_FIELD() [12/12]

FUniformExpressionSet::LAYOUT_FIELD ( uint32  ,
UniformPreshaderBufferSize   
)
protected

◆ operator==()

bool FUniformExpressionSet::operator== ( const FUniformExpressionSet ReferenceSet) const

◆ SetParameterCollections()

void FUniformExpressionSet::SetParameterCollections ( TConstArrayView< const class UMaterialParameterCollection * >  Collections)

◆ SetVTLayer()

void FUniformExpressionSet::SetVTLayer ( int32  StackIndex,
int32  VTLayerIndex,
int32  TextureIndex 
)

◆ WriteUniformPreshaderEntry()

void FUniformExpressionSet::WriteUniformPreshaderEntry ( uint32  BufferOffset,
UE::Shader::EValueType  EntryType,
const TFunction< void(UE::Shader::FPreshaderData &)> &  EntryGenerator 
)

Writes a new uniform preshader entry.

Parameters
BufferOffsetSpecifies the location in the preshader buffer where the result of the preshader instruction will be written to. See FMaterialUniformPreshaderField::BufferOffset.
EntryTypeSpecifies the value type of the preshader instruction output. See FMaterialUniformPreshaderField::Type.
EntryGeneratorCallback that writes the preshader opcodes.

Friends And Related Symbol Documentation

◆ FDebugUniformExpressionSet

◆ FHLSLMaterialTranslator

friend class FHLSLMaterialTranslator
friend

◆ FMaterial

friend class FMaterial
friend

◆ FMaterialRenderProxy

◆ FMaterialShader

friend class FMaterialShader
friend

◆ FMaterialShaderMap

friend class FMaterialShaderMap
friend

◆ FMaterialVirtualTextureStack


The documentation for this class was generated from the following files: