class Pass

Class defining a single pass of a variation (of a material).

Pass may contain multiple GPU programs (vertex, fragment, geometry, etc.), and a set of pipeline states (blend, rasterizer, etc.). When initially created the pass is in its uncompiled state. It needs to be explicitly compiled by calling Compile() before use.

Public

Methods

~Pass

virtual ~Pass() noexcept = default

Compile

void Compile()

Initializes the pass internals by compiling the GPU programs and creating the relevant pipeline state.

This method must be called before pass pipelines can be retrieved. After initial compilation further calls do this method will perform no operation.

staticCreate

static SPtr<Pass> Create(const PassCreateInformation &desc)

Creates a new empty pass.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

~TPass<IsRenderProxy>

virtual ~TPass<IsRenderProxy>() = default

HasBlending

bool HasBlending() const

Returns true if this pass has some element of transparency.

IsCompute

bool IsCompute() const

Returns true if the pass executes a compute program.

GetStencilRefValue

u32 GetStencilRefValue() const

Gets the stencil reference value that is used when performing operations using the stencil buffer.

GetGpuProgramCreateInformation

const GpuProgramCreateInformation &GetGpuProgramCreateInformation(GpuProgramType type) const

Returns the GPU program descriptor for the specified GPU program type.

GetGraphicsPipelineState

const SPtr<GpuGraphicsPipelineState> &GetGraphicsPipelineState() const

Returns the graphics pipeline state describing this pass, or null if its a compute pass.

Only valid after Compile() has been called.

GetComputePipelineState

const SPtr<GpuComputePipelineState> &GetComputePipelineState() const

Returns the compute pipeline state describing this pass, or null if its a graphics pass.

Only valid after compile has been called.

Protected

Constructors

Pass

Pass() = default

Pass

Pass(const PassCreateInformation &createInformation)

Methods

CreateRenderProxySyncPacket

RenderProxySyncPacket *CreateRenderProxySyncPacket(FrameAllocator &allocator, u32 flags) override

Creates a data packet that will be used for syncing the core object with it's render proxy.

Caller must free the retrieved packet using the provided allocator when done using it.

CreateRenderProxy

SPtr<render::RenderProxy> CreateRenderProxy() const override

Creates an object that contains render thread specific data and methods for this object.

Can be null if such object is not required.

staticCreateEmpty

static SPtr<Pass> CreateEmpty()

Creates a new empty pass but doesn't initialize it.

CreatePipelineState

void CreatePipelineState()

Creates either the graphics or the compute pipeline state from the stored pass data.

Fields

mData

mGraphicsPipelineState

SPtr<GpuGraphicsPipelineState> mGraphicsPipelineState

mComputePipelineState

SPtr<GpuComputePipelineState> mComputePipelineState