UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MeshPassProcessor.h File Reference

Go to the source code of this file.

Classes

class  FMeshPassMask
 
struct  FMinimalBoundShaderStateInput
 
class  FGraphicsMinimalPipelineStateInitializer
 
class  FGraphicsMinimalPipelineStateId
 
class  FShaderBindingState
 
struct  FMeshProcessorShaders
 
struct  FMeshDrawCommandDebugData
 
struct  FMeshDrawCommandStatsData
 
class  FMeshDrawCommandStateCache
 
class  FMeshDrawShaderBindings
 
class  FReadOnlyMeshDrawSingleShaderBindings
 
struct  FMeshDrawCommandOverrideArgs
 
struct  FMeshDrawCommandSceneArgs
 
class  FMeshDrawCommand
 
class  FMeshDrawCommandSortKey
 
struct  FPersistentPrimitiveIndex
 
struct  FMeshDrawCommandPrimitiveIdInfo
 
struct  FMeshDrawCommandCullingPayload
 
class  FMeshPassDrawListContext
 
class  FDynamicMeshDrawCommandStorage
 
class  FVisibleMeshDrawCommand
 
struct  FCompareFMeshDrawCommands
 
struct  TUseBitwiseSwap< FVisibleMeshDrawCommand >
 
class  FDynamicPassMeshDrawListContext
 
class  FCachedMeshDrawCommandInfo
 
class  FCachedPassMeshDrawList
 
struct  FMeshDrawCommandCount
 
struct  MeshDrawCommandKeyFuncs
 
class  FCachedPassMeshDrawListContext
 
struct  FCachedPassMeshDrawListContext::FMeshPassScope
 
class  FCachedPassMeshDrawListContextImmediate
 
class  FCachedPassMeshDrawListContextDeferred
 
struct  TMeshProcessorShaders< VertexType, PixelType, GeometryType, RayTracingType, ComputeType >
 
struct  FMeshPassProcessorRenderState
 
class  FMeshPassProcessor
 
struct  FMeshPassProcessor::FMeshDrawingPolicyOverrideSettings
 
class  FPassProcessorManager
 
class  FRegisterPassProcessorCreateFunction
 

Namespaces

namespace  EMeshPass
 

Macros

#define MESH_DRAW_COMMAND_DEBUG_DATA   ((!UE_BUILD_SHIPPING && !UE_BUILD_TEST) || VALIDATE_MESH_COMMAND_BINDINGS || WANTS_DRAW_MESH_EVENTS || WITH_DEBUG_VIEW_MODES)
 
#define COMPARE_FIELD_BEGIN(Field)
 
#define COMPARE_FIELD(Field)
 
#define COMPARE_FIELD_END    else { return false; }
 
#define COMPARE_OP   <
 
#define COMPARE_OP   >
 
#define REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR(Name, MeshPassProcessorCreateFunction, ShadingPath, MeshPass, MeshPassFlags)
 

Typedefs

typedef Experimental::TRobinHoodHashSet< FGraphicsMinimalPipelineStateInitializerFGraphicsMinimalPipelineStateSet
 
typedef TArray< FVisibleMeshDrawCommand, SceneRenderingAllocatorFMeshCommandOneFrameArray
 
typedef TMap< int32, FUniformBufferRHIRef, SceneRenderingSetAllocatorFTranslucentSelfShadowUniformBufferMap
 
using FDrawCommandIndices = TArray< int32, TInlineAllocator< 5 > >
 
using FStateBucketMap = Experimental::TRobinHoodHashMap< FMeshDrawCommand, FMeshDrawCommandCount, MeshDrawCommandKeyFuncs >
 
typedef FMeshPassProcessor *(* DeprecatedPassProcessorCreateFunction) (const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 
typedef FMeshPassProcessor *(* PassProcessorCreateFunction) (ERHIFeatureLevel::Type FeatureLevel, const FScene *Scene, const FSceneView *InViewIfDynamicMeshCommand, FMeshPassDrawListContext *InDrawListContext)
 

Enumerations

enum  EMeshPass::Type : uint8 {
  EMeshPass::DepthPass , EMeshPass::SecondStageDepthPass , EMeshPass::BasePass , EMeshPass::AnisotropyPass ,
  EMeshPass::SkyPass , EMeshPass::SingleLayerWaterPass , EMeshPass::SingleLayerWaterDepthPrepass , EMeshPass::CSMShadowDepth ,
  EMeshPass::VSMShadowDepth , EMeshPass::OnePassPointLightShadowDepth , EMeshPass::Distortion , EMeshPass::Velocity ,
  EMeshPass::TranslucentVelocity , EMeshPass::TranslucentVelocityClippedDepth , EMeshPass::TranslucencyStandard , EMeshPass::TranslucencyStandardModulate ,
  EMeshPass::TranslucencyAfterDOF , EMeshPass::TranslucencyAfterDOFModulate , EMeshPass::TranslucencyAfterMotionBlur , EMeshPass::TranslucencyHoldout ,
  EMeshPass::TranslucencyAll , EMeshPass::LightmapDensity , EMeshPass::DebugViewMode , EMeshPass::CustomDepth ,
  EMeshPass::MobileBasePassCSM , EMeshPass::VirtualTexture , EMeshPass::LumenCardCapture , EMeshPass::LumenCardNanite ,
  EMeshPass::LumenTranslucencyRadianceCacheMark , EMeshPass::LumenFrontLayerTranslucencyGBuffer , EMeshPass::DitheredLODFadingOutMaskPass , EMeshPass::NaniteMeshPass ,
  EMeshPass::MeshDecal_DBuffer , EMeshPass::MeshDecal_SceneColorAndGBuffer , EMeshPass::MeshDecal_SceneColorAndGBufferNoNormal , EMeshPass::MeshDecal_SceneColor ,
  EMeshPass::MeshDecal_AmbientOcclusion , EMeshPass::WaterInfoTextureDepthPass , EMeshPass::WaterInfoTexturePass , EMeshPass::Num ,
  EMeshPass::NumBits = 6
}
 
enum class  EFVisibleMeshDrawCommandFlags : uint8 {
  Default = 0U , MaterialUsesWorldPositionOffset = 1U << 0U , MaterialAlwaysEvaluatesWorldPositionOffset = 1U << 1U , HasPrimitiveIdStreamIndex = 1U << 2U ,
  ForceInstanceCulling = 1U << 3U , PreserveInstanceOrder = 1U << 4U , FetchInstanceCountFromScene = 1U << 5U , All = MaterialUsesWorldPositionOffset | HasPrimitiveIdStreamIndex | ForceInstanceCulling | PreserveInstanceOrder | FetchInstanceCountFromScene ,
  NumBits = 6U
}
 
enum class  EMeshDrawCommandCullingPayloadFlags : uint8 {
  Default = 0U , MinScreenSizeCull = 1U , MaxScreenSizeCull = 2U , NoScreenSizeCull = Default ,
  All = MinScreenSizeCull | MaxScreenSizeCull , NumBits = 2U
}
 
enum class  EMeshPassFeatures { Default = 0 , PositionOnly = 1 << 0 , PositionAndNormalOnly = 1 << 1 }
 
enum class  EDrawingPolicyOverrideFlags {
  None = 0 , TwoSided = 1 << 0 , DitheredLODTransition = 1 << 1 , Wireframe = 1 << 2 ,
  ReverseCullMode = 1 << 3
}
 
enum class  EMeshPassFlags { None = 0 , CachedMeshCommands = 1 << 0 , MainView = 1 << 1 }
 

Functions

const TCHARGetMeshPassName (EMeshPass::Type MeshPass)
 
 ENUM_CLASS_FLAGS (EFVisibleMeshDrawCommandFlags)
 
 ENUM_CLASS_FLAGS (EMeshDrawCommandCullingPayloadFlags)
 
 ENUM_CLASS_FLAGS (EMeshPassFeatures)
 
 ENUM_CLASS_FLAGS (EDrawingPolicyOverrideFlags)
 
 ENUM_CLASS_FLAGS (EMeshPassFlags)
 
RENDERER_API void SubmitMeshDrawCommands (const FMeshCommandOneFrameArray &VisibleMeshDrawCommands, const FGraphicsMinimalPipelineStateSet &GraphicsMinimalPipelineStateSet, const FMeshDrawCommandSceneArgs &SceneArgs, uint32 PrimitiveIdBufferStride, bool bDynamicInstancing, uint32 InstanceFactor, FRHICommandList &RHICmdList)
 
void SubmitMeshDrawCommandsRange (const FMeshCommandOneFrameArray &VisibleMeshDrawCommands, const FGraphicsMinimalPipelineStateSet &GraphicsMinimalPipelineStateSet, const FMeshDrawCommandSceneArgs &SceneArgs, uint32 PrimitiveIdBufferStride, bool bDynamicInstancing, int32 StartIndex, int32 NumMeshDrawCommands, uint32 InstanceFactor, FRHICommandList &RHICmdList)
 
void ApplyViewOverridesToMeshDrawCommands (const FSceneView &View, FMeshCommandOneFrameArray &VisibleMeshDrawCommands, FDynamicMeshDrawCommandStorage &DynamicMeshDrawCommandStorage, FGraphicsMinimalPipelineStateSet &GraphicsMinimalPipelineStateSet, bool &NeedsShaderInitialisation)
 
RENDERER_API void DrawDynamicMeshPassPrivate (const FSceneView &View, FRHICommandList &RHICmdList, FMeshCommandOneFrameArray &VisibleMeshDrawCommands, FDynamicMeshDrawCommandStorage &DynamicMeshDrawCommandStorage, FGraphicsMinimalPipelineStateSet &GraphicsMinimalPipelineStateSet, bool &InNeedsShaderInitialisation, uint32 InstanceFactor)
 
RENDERER_API FMeshDrawCommandSortKey CalculateMeshStaticSortKey (const FMeshMaterialShader *VertexShader, const FMeshMaterialShader *PixelShader)
 
RENDERER_API void AddRenderTargetInfo (EPixelFormat PixelFormat, ETextureCreateFlags CreateFlags, FGraphicsPipelineRenderTargetsInfo &RenderTargetsInfo)
 
RENDERER_API void SetupDepthStencilInfo (EPixelFormat DepthStencilFormat, ETextureCreateFlags DepthStencilCreateFlags, ERenderTargetLoadAction DepthTargetLoadAction, ERenderTargetLoadAction StencilTargetLoadAction, FExclusiveDepthStencil DepthStencilAccess, FGraphicsPipelineRenderTargetsInfo &RenderTargetsInfo)
 
RENDERER_API void SetupGBufferRenderTargetInfo (const FSceneTexturesConfig &SceneTexturesConfig, FGraphicsPipelineRenderTargetsInfo &RenderTargetsInfo, bool bSetupDepthStencil, EGBufferLayout Layout=GBL_Default)
 
RENDERER_API void ApplyTargetsInfo (FGraphicsPipelineStateInitializer &GraphicsPSOInit, const FGraphicsPipelineRenderTargetsInfo &RenderTargetsInfo)
 
RENDERER_API ESubpassHint GetSubpassHint (const FStaticShaderPlatform Platform, bool bIsUsingGBuffers, bool bMultiViewRendering, uint32 NumSamples)
 
FMeshDrawCommandSortKey CalculateMeshStaticSortKey (const TShaderRef< FMeshMaterialShader > &VertexShader, const TShaderRef< FMeshMaterialShader > &PixelShader)
 

Variables

const int32 NumInlineShaderBindings = 10
 

Macro Definition Documentation

◆ COMPARE_FIELD

#define COMPARE_FIELD (   Field)
Value:
else if (Field != rhs.Field) \
{ return Field COMPARE_OP rhs.Field; }
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define COMPARE_OP
Definition FieldSystemNoiseAlgo.cpp:6

◆ COMPARE_FIELD_BEGIN

#define COMPARE_FIELD_BEGIN (   Field)
Value:
if (Field != rhs.Field) \
{ return Field COMPARE_OP rhs.Field; }

◆ COMPARE_FIELD_END

#define COMPARE_FIELD_END    else { return false; }

◆ COMPARE_OP [1/2]

#define COMPARE_OP   <

◆ COMPARE_OP [2/2]

#define COMPARE_OP   >

◆ MESH_DRAW_COMMAND_DEBUG_DATA

◆ REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR

#define REGISTER_MESHPASSPROCESSOR_AND_PSOCOLLECTOR (   Name,
  MeshPassProcessorCreateFunction,
  ShadingPath,
  MeshPass,
  MeshPassFlags 
)
Value:
{ \
return MeshPassProcessorCreateFunction(FeatureLevel, nullptr, nullptr, nullptr); \
} \
const TCHAR * GetMeshPassName(EMeshPass::Type MeshPass)
Definition MeshPassProcessor.h:93
Definition PSOPrecacheMaterial.h:96
Definition MeshPassProcessor.h:2399
Definition PSOPrecacheMaterial.h:24
Type
Definition RHIFeatureLevel.h:20

Typedef Documentation

◆ DeprecatedPassProcessorCreateFunction

◆ FDrawCommandIndices

◆ FGraphicsMinimalPipelineStateSet

◆ FMeshCommandOneFrameArray

◆ FStateBucketMap

◆ FTranslucentSelfShadowUniformBufferMap

◆ PassProcessorCreateFunction

Enumeration Type Documentation

◆ EDrawingPolicyOverrideFlags

Enumerator
None 
TwoSided 
DitheredLODTransition 
Wireframe 
ReverseCullMode 

◆ EFVisibleMeshDrawCommandFlags

Flags that may be passed along with a visible mesh draw command OR stored with a cached one.

Enumerator
Default 
MaterialUsesWorldPositionOffset 

If set, the FMaterial::MaterialUsesWorldPositionOffset_RenderThread() indicates that WPO is active for the given material.

MaterialAlwaysEvaluatesWorldPositionOffset 

If set, the FMaterial::ShouldAlwaysEvaluateWorldPositionOffset() indicates that WPO is ALWAYS active for the given material. NOTE: This flag is only set if MaterialUsesWorldPositionOffset is also set.

HasPrimitiveIdStreamIndex 

If set, the mesh draw command supports primitive ID steam (required for dynamic instancing and GPU-Scene instance culling).

ForceInstanceCulling 

If set, forces individual instances to always be culled independently from the primitive

PreserveInstanceOrder 

If set, requires that instances preserve their original draw order in the draw command

FetchInstanceCountFromScene 

If set, the instance culling machinery will pull the instance count from the primitive in FScene, making it possible to bypass MDC re-caching

All 
NumBits 

◆ EMeshDrawCommandCullingPayloadFlags

Flags stored on visible mesh commands to indicate how to interpret the culling payload.

Enumerator
Default 
MinScreenSizeCull 
MaxScreenSizeCull 
NoScreenSizeCull 
All 
NumBits 

◆ EMeshPassFeatures

enum class EMeshPassFeatures
strong
Enumerator
Default 
PositionOnly 
PositionAndNormalOnly 

◆ EMeshPassFlags

enum class EMeshPassFlags
strong
Enumerator
None 
CachedMeshCommands 
MainView 

Function Documentation

◆ AddRenderTargetInfo()

RENDERER_API void AddRenderTargetInfo ( EPixelFormat  PixelFormat,
ETextureCreateFlags  CreateFlags,
FGraphicsPipelineRenderTargetsInfo RenderTargetsInfo 
)
extern

◆ ApplyTargetsInfo()

RENDERER_API void ApplyTargetsInfo ( FGraphicsPipelineStateInitializer GraphicsPSOInit,
const FGraphicsPipelineRenderTargetsInfo RenderTargetsInfo 
)
extern

◆ ApplyViewOverridesToMeshDrawCommands()

void ApplyViewOverridesToMeshDrawCommands ( const FSceneView View,
FMeshCommandOneFrameArray VisibleMeshDrawCommands,
FDynamicMeshDrawCommandStorage DynamicMeshDrawCommandStorage,
FGraphicsMinimalPipelineStateSet GraphicsMinimalPipelineStateSet,
bool NeedsShaderInitialisation 
)
extern

◆ CalculateMeshStaticSortKey() [1/2]

RENDERER_API FMeshDrawCommandSortKey CalculateMeshStaticSortKey ( const FMeshMaterialShader VertexShader,
const FMeshMaterialShader PixelShader 
)
extern

◆ CalculateMeshStaticSortKey() [2/2]

FMeshDrawCommandSortKey CalculateMeshStaticSortKey ( const TShaderRef< FMeshMaterialShader > &  VertexShader,
const TShaderRef< FMeshMaterialShader > &  PixelShader 
)
inline

◆ DrawDynamicMeshPassPrivate()

RENDERER_API void DrawDynamicMeshPassPrivate ( const FSceneView View,
FRHICommandList RHICmdList,
FMeshCommandOneFrameArray VisibleMeshDrawCommands,
FDynamicMeshDrawCommandStorage DynamicMeshDrawCommandStorage,
FGraphicsMinimalPipelineStateSet GraphicsMinimalPipelineStateSet,
bool InNeedsShaderInitialisation,
uint32  InstanceFactor 
)
extern

◆ ENUM_CLASS_FLAGS() [1/5]

ENUM_CLASS_FLAGS ( EDrawingPolicyOverrideFlags  )

◆ ENUM_CLASS_FLAGS() [2/5]

ENUM_CLASS_FLAGS ( EFVisibleMeshDrawCommandFlags  )

◆ ENUM_CLASS_FLAGS() [3/5]

ENUM_CLASS_FLAGS ( EMeshDrawCommandCullingPayloadFlags  )

◆ ENUM_CLASS_FLAGS() [4/5]

ENUM_CLASS_FLAGS ( EMeshPassFeatures  )

◆ ENUM_CLASS_FLAGS() [5/5]

ENUM_CLASS_FLAGS ( EMeshPassFlags  )

◆ GetMeshPassName()

const TCHAR * GetMeshPassName ( EMeshPass::Type  MeshPass)
inline

◆ GetSubpassHint()

RENDERER_API ESubpassHint GetSubpassHint ( const FStaticShaderPlatform  Platform,
bool  bIsUsingGBuffers,
bool  bMultiViewRendering,
uint32  NumSamples 
)
extern

◆ SetupDepthStencilInfo()

RENDERER_API void SetupDepthStencilInfo ( EPixelFormat  DepthStencilFormat,
ETextureCreateFlags  DepthStencilCreateFlags,
ERenderTargetLoadAction  DepthTargetLoadAction,
ERenderTargetLoadAction  StencilTargetLoadAction,
FExclusiveDepthStencil  DepthStencilAccess,
FGraphicsPipelineRenderTargetsInfo RenderTargetsInfo 
)
extern

◆ SetupGBufferRenderTargetInfo()

RENDERER_API void SetupGBufferRenderTargetInfo ( const FSceneTexturesConfig SceneTexturesConfig,
FGraphicsPipelineRenderTargetsInfo RenderTargetsInfo,
bool  bSetupDepthStencil,
EGBufferLayout  Layout = GBL_Default 
)
extern

◆ SubmitMeshDrawCommands()

RENDERER_API void SubmitMeshDrawCommands ( const FMeshCommandOneFrameArray VisibleMeshDrawCommands,
const FGraphicsMinimalPipelineStateSet GraphicsMinimalPipelineStateSet,
const FMeshDrawCommandSceneArgs SceneArgs,
uint32  PrimitiveIdBufferStride,
bool  bDynamicInstancing,
uint32  InstanceFactor,
FRHICommandList RHICmdList 
)
extern

◆ SubmitMeshDrawCommandsRange()

void SubmitMeshDrawCommandsRange ( const FMeshCommandOneFrameArray VisibleMeshDrawCommands,
const FGraphicsMinimalPipelineStateSet GraphicsMinimalPipelineStateSet,
const FMeshDrawCommandSceneArgs SceneArgs,
uint32  PrimitiveIdBufferStride,
bool  bDynamicInstancing,
int32  StartIndex,
int32  NumMeshDrawCommands,
uint32  InstanceFactor,
FRHICommandList RHICmdList 
)
extern

Variable Documentation

◆ NumInlineShaderBindings

const int32 NumInlineShaderBindings = 10
inline

Number of resource bindings to allocate inline within a FMeshDrawCommand. This is tweaked so that the bindings for BasePass shaders of an average material using a FLocalVertexFactory fit into the inline storage. Overflow of the inline storage will cause a heap allocation per draw (and corresponding cache miss on traversal)