Navigation
API > API/Runtime > API/Runtime/Renderer
FMeshDrawCommand fully describes a mesh pass draw call, captured just above the RHI. FMeshDrawCommand should contain only data needed to draw. For InitViews payloads, use FVisibleMeshDrawCommand. FMeshDrawCommands are cached at Primitive AddToScene time for vertex factories that support it (no per-frame or per-view shader binding changes). Dynamic Instancing operates at the FMeshDrawCommand level for robustness. Adding per-command shader bindings will reduce the efficiency of Dynamic Instancing, but rendering will always be correct. Any resources referenced by a command must be kept alive for the lifetime of the command. FMeshDrawCommand is not responsible for lifetime management of resources. For uniform buffers referenced by cached FMeshDrawCommand's, RHIUpdateUniformBuffer makes it possible to access per-frame data in the shader without changing bindings.
| Name | FMeshDrawCommand |
| Type | class |
| Header File | /Engine/Source/Runtime/Renderer/Public/MeshPassProcessor.h |
| Include Path | #include "MeshPassProcessor.h" |
Syntax
class FMeshDrawCommand
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMeshDrawCommand
(
const FMeshDrawCommand& Other |
MeshPassProcessor.h | ||
FMeshDrawCommand
(
FMeshDrawCommand&& Other |
MeshPassProcessor.h | ||
| MeshPassProcessor.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BaseVertexIndex | uint32 | MeshPassProcessor.h | ||
| Buffer | FRHIBuffer * | MeshPassProcessor.h | ||
| CachedPipelineId | FGraphicsMinimalPipelineStateId | PSO | MeshPassProcessor.h | |
| FirstIndex | uint32 | Draw command parameters | MeshPassProcessor.h | |
| FMeshDrawCommand | union FMeshDrawCommand | MeshPassProcessor.h | ||
| IndexBuffer | FRHIBuffer * | MeshPassProcessor.h | ||
| IndirectArgs | FMeshDrawCommand | MeshPassProcessor.h | ||
| NumInstances | uint32 | MeshPassProcessor.h | ||
| NumPrimitives | uint32 | MeshPassProcessor.h | ||
| NumVertices | uint32 | MeshPassProcessor.h | ||
| Offset | uint32 | MeshPassProcessor.h | ||
| PrimitiveIdStreamIndex | int8 | MeshPassProcessor.h | ||
| PrimitiveType | EPrimitiveType | Redundant as already present in CachedPipelineId, but need access for dynamic instancing on GPU. | MeshPassProcessor.h | |
| ShaderBindings | FMeshDrawShaderBindings | Resource bindings | MeshPassProcessor.h | |
| StencilRef | uint8 | Non-pipeline state | MeshPassProcessor.h | |
| VertexParams | FMeshDrawCommand | MeshPassProcessor.h | ||
| VertexStreams | FVertexInputStreamArray | MeshPassProcessor.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DebugData | FMeshDrawCommandDebugData | MeshPassProcessor.h | ||
| StatsData | FMeshDrawCommandStatsData | MeshPassProcessor.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearDebugPrimitiveSceneProxy() |
MeshPassProcessor.h | ||
void Finalize
(
FGraphicsMinimalPipelineStateId PipelineId, |
MeshPassProcessor.h | ||
SIZE_T GetAllocatedSize() |
MeshPassProcessor.h | ||
const FMeshDrawCommandDebugData & GetDebugData() |
MeshPassProcessor.h | ||
SIZE_T GetDebugDataSize() |
MeshPassProcessor.h | ||
uint32 GetDynamicInstancingHash() |
MeshPassProcessor.h | ||
uint64 GetPipelineStateSortingKey
(
FRHICommandList& RHICmdList, |
Returns the pipeline state sort key, which can be used for sorting material draws to reduce context switches. | MeshPassProcessor.h | |
uint64 GetPipelineStateSortingKey
(
const FGraphicsPipelineRenderTargetsInfo& RenderTargetsInfo |
Returns the pipeline state sort key, which can be used for sorting material draws to reduce context switches. | MeshPassProcessor.h | |
void GetStatsData
(
FVisibleMeshDrawCommandStatsData& OutVisibleStatsData |
MeshPassProcessor.h | ||
void InitializeShaderBindings
(
const FMeshProcessorShaders& Shaders |
Allocates room for the shader bindings. | MeshPassProcessor.h | |
bool MatchesForDynamicInstancing
(
const FMeshDrawCommand& Rhs |
MeshPassProcessor.h | ||
void SetDebugData
(
const FPrimitiveSceneProxy* PrimitiveSceneProxy, |
MeshPassProcessor.h | ||
void SetDrawParametersAndFinalize
(
const FMeshBatch& MeshBatch, |
Called when the mesh draw command is complete. | MeshPassProcessor.h | |
void SetStatsData
(
const FPrimitiveSceneProxy* PrimitiveSceneProxy |
MeshPassProcessor.h | ||
void SetStencilRef
(
uint32 InStencilRef |
MeshPassProcessor.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool SubmitDraw
(
const FMeshDrawCommand&__restrict MeshDrawCommand, |
Submits commands to the RHI Commandlist to draw the MeshDrawCommand. | MeshPassProcessor.h | |
static bool SubmitDrawBegin
(
const FMeshDrawCommand&__restrict MeshDrawCommand, |
Submits the state and shader bindings to the RHI command list, but does not invoke the draw. | MeshPassProcessor.h | |
static void SubmitDrawEnd
(
const FMeshDrawCommand& MeshDrawCommand, |
Submits just the draw primitive portion of the draw command. | MeshPassProcessor.h | |
static bool SubmitDrawIndirectBegin
(
const FMeshDrawCommand&__restrict MeshDrawCommand, |
Submits the state and shader bindings to the RHI command list, but does not invoke the draw indirect. | MeshPassProcessor.h | |
static void SubmitDrawIndirectEnd
(
const FMeshDrawCommand& MeshDrawCommand, |
Submits just the draw indirect primitive portion of the draw command. | MeshPassProcessor.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMeshDrawCommand & operator=
(
FMeshDrawCommand&& Other |
MeshPassProcessor.h | ||
FMeshDrawCommand & operator=
(
const FMeshDrawCommand& Other |
MeshPassProcessor.h |