FMeshDrawCommand

[FMeshDrawCommand](API\Runtime\Renderer\FMeshDrawCommand) fully describes a mesh pass draw call, captured just above the RHI.

Windows
MacOS
Linux

References

Module

Renderer

Header

/Engine/Source/Runtime/Renderer/Public/MeshPassProcessor.h

Include

#include "MeshPassProcessor.h"

Syntax

class FMeshDrawCommand

Remarks

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.

Variables

Name Description

Public variable

union FMeshDraw...

 

@3657

Public variable

uint32

 

BaseVertexIndex

Public variable

FRHIVertexBuffe...

 

Buffer

Public variable

FGraphicsMinima...

 

CachedPipelineId

PSO

Public variable

uint32

 

FirstIndex

Draw command parameters

Public variable

FRHIIndexBuffer...

 

IndexBuffer

Public variable

FMeshDrawComman...

 

IndirectArgs

Public variable

uint32

 

NumInstances

Public variable

uint32

 

NumPrimitives

Public variable

uint32

 

NumVertices

Public variable

uint32

 

Offset

Public variable

int8

 

PrimitiveIdStreamIndex

Public variable

FMeshDrawShader...

 

ShaderBindings

Resource bindings

Public variable

uint8

 

StencilRef

Non-pipeline state

Public variable

FMeshDrawComman...

 

VertexParams

Public variable

FVertexInputStr...

 

VertexStreams

Constructors

Name Description

Public function

FMeshDrawCommand()

Public function

FMeshDrawCommand

(
    FMeshDrawCommand&& Other
)

Public function

FMeshDrawCommand

(
    const FMeshDrawCommand& Other
)

Functions

Name Description

Public function Const

void

 

ClearDebugPrimitiveSceneProxy()

Public function

void

 

Finalize

(
    FGraphicsMinimalPipelineStateId Pip...,
    const FMeshProcessorShaders* S...
)

Public function Const

SIZE_T

 

GetAllocatedSize()

Public function Const

SIZE_T

 

GetDebugDataSize()

Public function Const

uint32

 

GetDynamicInstancingHash()

Public function Const

bool

 

MatchesForDynamicInstancing

(
    const FMeshDrawCommand& Rhs
)

Public function

void

 

SetDebugData

(
    const FPrimitiveSceneProxy* Pr...,
    const FMaterial* Material,
    const FMaterialRenderProxy* Ma...,
    const FMeshProcessorShaders& Untyp...,
    const FVertexFactory* VertexFa...
)

Public function

void

 

SetDrawParametersAndFinalize

(
    const FMeshBatch& MeshBatch,
    int32 BatchElementIndex,
    FGraphicsMinimalPipelineStateId Pip...,
    const FMeshProcessorShaders* S...
)

Called when the mesh draw command is complete.

Public function

void

 

SetShaders

(
    FRHIVertexDeclaration* VertexD...,
    const FMeshProcessorShaders& Shade...,
    FGraphicsMinimalPipelineStateInitia...
)

Sets shaders on the mesh draw command and allocates room for the shader bindings.

Public function

void

 

SetStencilRef

(
    uint32 InStencilRef
)

Public function Static

void

 

SubmitDraw

(
    const FMeshDrawCommand&restrict ...,
    const FGraphicsMinimalPipelineState...,
    FRHIVertexBuffer* ScenePrimiti...,
    int32 PrimitiveIdOffset,
    uint32 InstanceFactor,
    FRHICommandList& CommandList,
    FMeshDrawCommandStateCache&
restr...
)

Submits commands to the RHI Commandlist to draw the MeshDrawCommand.

Operators

Name Description

Public function

FMeshDrawCom...

 

operator=

(
    const FMeshDrawCommand& Other
)

Public function

FMeshDrawCom...

 

operator=

(
    FMeshDrawCommand&& Other
)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss