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

#include <VertexFactory.h>

+ Inheritance diagram for FVertexFactory:

Classes

struct  FVertexStream
 

Public Member Functions

 FVertexFactory (ERHIFeatureLevel::Type InFeatureLevel)
 
virtual RENDERCORE_API ~FVertexFactory ()
 
virtual FVertexFactoryTypeGetType () const
 
RENDERCORE_API void GetStreams (ERHIFeatureLevel::Type InFeatureLevel, EVertexInputStreamType VertexStreamType, FVertexInputStreamArray &OutVertexStreams) const
 
RENDERCORE_API void OffsetInstanceStreams (uint32 InstanceOffset, EVertexInputStreamType VertexStreamType, FVertexInputStreamArray &VertexStreams) const
 
virtual RENDERCORE_API void ReleaseRHI ()
 
FVertexDeclarationRHIRefGetDeclaration ()
 
void SetDeclaration (FVertexDeclarationRHIRef &NewDeclaration)
 
const FVertexDeclarationRHIRefGetDeclaration (EVertexInputStreamType InputStreamType) const
 
virtual bool SupportsPositionOnlyStream () const
 
virtual bool SupportsPositionAndNormalOnlyStream () const
 
bool SupportsNullPixelShader () const
 
bool SupportsTriangleSorting () const
 
virtual FShaderResourceViewRHIRef GetTriangleSortingPositionSRV () const
 
virtual bool RendersPrimitivesAsCameraFacingSprites () const
 
bool NeedsDeclaration () const
 
bool SupportsManualVertexFetch (const FStaticFeatureLevel InFeatureLevel) const
 
int32 GetPrimitiveIdStreamIndex (const FStaticFeatureLevel InFeatureLevel, EVertexInputStreamType InputStreamType) const
 
bool SupportsGPUScene (const FStaticFeatureLevel InFeatureLevel) const
 
- Public Member Functions inherited from FRenderResource
RENDERCORE_API FRenderResource ()
 
RENDERCORE_API FRenderResource (ERHIFeatureLevel::Type InFeatureLevel)
 
RENDERCORE_API FRenderResource (const FRenderResource &)
 
RENDERCORE_API FRenderResource (FRenderResource &&)
 
RENDERCORE_API FRenderResourceoperator= (const FRenderResource &Other)
 
RENDERCORE_API FRenderResourceoperator= (FRenderResource &&Other)
 
virtual RENDERCORE_API ~FRenderResource ()
 
virtual void InitRHI (FRHICommandListBase &RHICmdList)
 
virtual RENDERCORE_API void InitResource (FRHICommandListBase &RHICmdList)
 
virtual RENDERCORE_API void ReleaseResource ()
 
RENDERCORE_API void UpdateRHI (FRHICommandListBase &RHICmdList)
 
virtual FString GetFriendlyName () const
 
bool IsInitialized () const
 
int32 GetListIndex () const
 
EInitPhase GetInitPhase () const
 
void SetOwnerName (FName InOwnerName)
 
FName GetOwnerName () const
 
void SetResourceName (FName InResourceName)
 
FName GetResourceName () const
 

Static Public Member Functions

static void ModifyCompilationEnvironment (const FVertexFactoryShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
 
static void ValidateCompiledResult (const FVertexFactoryType *Type, EShaderPlatform Platform, const FShaderParameterMap &ParameterMap, TArray< FString > &OutErrors)
 
static void GetPSOPrecacheVertexFetchElements (EVertexInputStreamType VertexInputStreamType, FVertexDeclarationElementList &Elements)
 
- Static Public Member Functions inherited from FRenderResource
static RENDERCORE_API void ReleaseRHIForAllResources ()
 
static RENDERCORE_API void InitPreRHIResources ()
 
static RENDERCORE_API void ChangeFeatureLevel (ERHIFeatureLevel::Type NewFeatureLevel)
 
static RENDERCORE_API FName SetScopeName (FName Name)
 

Protected Types

typedef TArray< FVertexStream, TInlineAllocator< 8 > > FVertexStreamList
 

Protected Member Functions

void SetPrimitiveIdStreamIndex (const FStaticFeatureLevel InFeatureLevel, EVertexInputStreamType InputStreamType, int32 StreamIndex)
 
RENDERCORE_API bool AddPrimitiveIdStreamElement (EVertexInputStreamType InputStreamType, FVertexDeclarationElementList &Elements, uint8 AttributeIndex, uint8 AttributeIndex_Mobile)
 
FVertexElement AccessStreamComponent (const FVertexStreamComponent &Component, uint8 AttributeIndex)
 
RENDERCORE_API FVertexElement AccessStreamComponent (const FVertexStreamComponent &Component, uint8 AttributeIndex, EVertexInputStreamType InputStreamType)
 
RENDERCORE_API void InitDeclaration (const FVertexDeclarationElementList &Elements, EVertexInputStreamType StreamType=EVertexInputStreamType::Default)
 
- Protected Member Functions inherited from FRenderResource
void SetFeatureLevel (const FStaticFeatureLevel InFeatureLevel)
 
const FStaticFeatureLevel GetFeatureLevel () const
 
bool HasValidFeatureLevel () const
 
template<typename T >
FBufferRHIRef CreateRHIBuffer (FRHICommandListBase &RHICmdList, T &InOutResourceObject, uint32 ResourceCount, EBufferUsageFlags InBufferUsageFlags, const TCHAR *InDebugName)
 
void SetInitPhase (EInitPhase InInitPhase)
 

Static Protected Member Functions

template<typename VertexStreamListType >
static FVertexElement AccessStreamComponent (const FVertexStreamComponent &Component, uint8 AttributeIndex, VertexStreamListType &InOutStreams)
 
- Static Protected Member Functions inherited from FRenderResource
static RENDERCORE_API FRHICommandListBaseGetImmediateCommandList ()
 

Protected Attributes

FVertexStreamList Streams
 
bool bNeedsDeclaration = true
 

Additional Inherited Members

- Public Types inherited from FRenderResource
enum class  EInitPhase : uint8 { Pre , Default , MAX }
 
- Public Attributes inherited from FRenderResource
ERenderResourceState ResourceState = ERenderResourceState::Default
 

Detailed Description

Encapsulates a vertex data source which can be linked into a vertex shader.

Member Typedef Documentation

◆ FVertexStreamList

Constructor & Destructor Documentation

◆ FVertexFactory()

FVertexFactory::FVertexFactory ( ERHIFeatureLevel::Type  InFeatureLevel)
inline

◆ ~FVertexFactory()

FVertexFactory::~FVertexFactory ( )
virtualdefault

Member Function Documentation

◆ AccessStreamComponent() [1/3]

FVertexElement FVertexFactory::AccessStreamComponent ( const FVertexStreamComponent Component,
uint8  AttributeIndex 
)
inlineprotected

Creates a vertex element for a vertex stream components. Adds a unique stream index for the vertex buffer used by the component.

Parameters
Component- The vertex stream component.
AttributeIndex- The attribute index to which the stream component is bound.
Returns
The vertex element which corresponds to Component.

◆ AccessStreamComponent() [2/3]

FVertexElement FVertexFactory::AccessStreamComponent ( const FVertexStreamComponent Component,
uint8  AttributeIndex,
EVertexInputStreamType  InputStreamType 
)
protected

Creates a vertex element for a vertex stream component. Adds a unique position stream index for the vertex buffer used by the component.

Parameters
Component- The vertex stream component.
Usage- The vertex element usage semantics.
AttributeIndex- The attribute index to which the stream component is bound.
Returns
The vertex element which corresponds to Component.

◆ AccessStreamComponent() [3/3]

static FVertexElement FVertexFactory::AccessStreamComponent ( const FVertexStreamComponent Component,
uint8  AttributeIndex,
VertexStreamListType InOutStreams 
)
inlinestaticprotected

Creates a vertex element for a vertex stream components. Adds a unique stream index for the vertex buffer used by the component.

Parameters
Component- The vertex stream component.
AttributeIndex- The attribute index to which the stream component is bound.
AttributeIndex- Stream array where to add the new streams.
Returns
The vertex element which corresponds to Component.

◆ AddPrimitiveIdStreamElement()

bool FVertexFactory::AddPrimitiveIdStreamElement ( EVertexInputStreamType  InputStreamType,
FVertexDeclarationElementList Elements,
uint8  AttributeIndex,
uint8  AttributeIndex_Mobile 
)
protected

◆ GetDeclaration() [1/2]

FVertexDeclarationRHIRef & FVertexFactory::GetDeclaration ( )
inline

◆ GetDeclaration() [2/2]

const FVertexDeclarationRHIRef & FVertexFactory::GetDeclaration ( EVertexInputStreamType  InputStreamType) const
inline

◆ GetPrimitiveIdStreamIndex()

int32 FVertexFactory::GetPrimitiveIdStreamIndex ( const FStaticFeatureLevel  InFeatureLevel,
EVertexInputStreamType  InputStreamType 
) const
inline

◆ GetPSOPrecacheVertexFetchElements()

static void FVertexFactory::GetPSOPrecacheVertexFetchElements ( EVertexInputStreamType  VertexInputStreamType,
FVertexDeclarationElementList Elements 
)
inlinestatic

Can be overridden by FVertexFactory subclasses which have EVertexFactoryFlags::SupportsPSOPrecaching set - this function will only be called when that flag is set

◆ GetStreams()

void FVertexFactory::GetStreams ( ERHIFeatureLevel::Type  InFeatureLevel,
EVertexInputStreamType  VertexStreamType,
FVertexInputStreamArray OutVertexStreams 
) const

◆ GetTriangleSortingPositionSRV()

virtual FShaderResourceViewRHIRef FVertexFactory::GetTriangleSortingPositionSRV ( ) const
inlinevirtual

◆ GetType()

virtual FVertexFactoryType * FVertexFactory::GetType ( ) const
inlinevirtual

◆ InitDeclaration()

void FVertexFactory::InitDeclaration ( const FVertexDeclarationElementList Elements,
EVertexInputStreamType  StreamType = EVertexInputStreamType::Default 
)
protected

Initializes the vertex declaration.

Parameters
Elements- The elements of the vertex declaration.

◆ ModifyCompilationEnvironment()

static void FVertexFactory::ModifyCompilationEnvironment ( const FVertexFactoryShaderPermutationParameters Parameters,
FShaderCompilerEnvironment OutEnvironment 
)
inlinestatic

Can be overridden by FVertexFactory subclasses to modify their compile environment just before compilation occurs.

◆ NeedsDeclaration()

bool FVertexFactory::NeedsDeclaration ( ) const
inline

◆ OffsetInstanceStreams()

void FVertexFactory::OffsetInstanceStreams ( uint32  InstanceOffset,
EVertexInputStreamType  VertexStreamType,
FVertexInputStreamArray VertexStreams 
) const

◆ ReleaseRHI()

void FVertexFactory::ReleaseRHI ( )
virtual

Releases the RHI resources used by this resource. Called when leaving the state where both the resource and the RHI have been initialized. This is only called by the rendering thread.

Reimplemented from FRenderResource.

Reimplemented in FGeometryCollectionVertexFactory, FGPUBaseSkinVertexFactory, TGPUSkinVertexFactory< BoneInfluenceType >, TGPUSkinAPEXClothVertexFactory< BoneInfluenceType >, and FLocalVertexFactory.

◆ RendersPrimitivesAsCameraFacingSprites()

virtual bool FVertexFactory::RendersPrimitivesAsCameraFacingSprites ( ) const
inlinevirtual

◆ SetDeclaration()

void FVertexFactory::SetDeclaration ( FVertexDeclarationRHIRef NewDeclaration)
inline

◆ SetPrimitiveIdStreamIndex()

void FVertexFactory::SetPrimitiveIdStreamIndex ( const FStaticFeatureLevel  InFeatureLevel,
EVertexInputStreamType  InputStreamType,
int32  StreamIndex 
)
inlineprotected

◆ SupportsGPUScene()

bool FVertexFactory::SupportsGPUScene ( const FStaticFeatureLevel  InFeatureLevel) const
inline

◆ SupportsManualVertexFetch()

bool FVertexFactory::SupportsManualVertexFetch ( const FStaticFeatureLevel  InFeatureLevel) const
inline

◆ SupportsNullPixelShader()

bool FVertexFactory::SupportsNullPixelShader ( ) const
inline

Indicates whether the vertex factory supports a null pixel shader.

◆ SupportsPositionAndNormalOnlyStream()

virtual bool FVertexFactory::SupportsPositionAndNormalOnlyStream ( ) const
inlinevirtual

Indicates whether the vertex factory supports a position-and-normal-only stream.

Reimplemented in FGPUSkinPassthroughVertexFactory.

◆ SupportsPositionOnlyStream()

virtual bool FVertexFactory::SupportsPositionOnlyStream ( ) const
inlinevirtual

Indicates whether the vertex factory supports a position-only stream.

Reimplemented in FGPUSkinPassthroughVertexFactory.

◆ SupportsTriangleSorting()

bool FVertexFactory::SupportsTriangleSorting ( ) const
inline

◆ ValidateCompiledResult()

static void FVertexFactory::ValidateCompiledResult ( const FVertexFactoryType Type,
EShaderPlatform  Platform,
const FShaderParameterMap ParameterMap,
TArray< FString > &  OutErrors 
)
inlinestatic

Can be overridden by FVertexFactory subclasses to fail a compile based on compilation output.

Member Data Documentation

◆ bNeedsDeclaration

bool FVertexFactory::bNeedsDeclaration = true
protected

◆ Streams

FVertexStreamList FVertexFactory::Streams
protected

The vertex streams used to render the factory.


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