Open 3D Engine Atom Gem API Reference 25.05.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::PipelineStateForDraw Class Reference

#include <PipelineState.h>

Inherits AZStd::intrusive_base, and ShaderReloadNotificationBus::MultiHandler.

Public Member Functions

 AZ_CLASS_ALLOCATOR (PipelineStateForDraw, SystemAllocator)
 
 PipelineStateForDraw (const PipelineStateForDraw &right)
 
void Init (const Data::Instance< Shader > &shader, const ShaderOptionList *optionAndValues=nullptr)
 
void Init (const Data::Instance< Shader > &shader, const ShaderVariantId &shaderVariantId)
 
void SetOutputFromScene (const Scene *scene, RHI::DrawListTag overrideDrawListTag=RHI::DrawListTag())
 
void SetOutputFromPass (RenderPass *pass)
 
void SetInputStreamLayout (const RHI::InputStreamLayout &inputStreamLayout)
 Set input stream.
 
const RHI::PipelineStateFinalize ()
 
const RHI::PipelineStateGetRHIPipelineState () const
 
RHI::RenderStatesRenderStatesOverlay ()
 
RHI::InputStreamLayoutInputStreamLayout ()
 
void UpdateShaderVaraintId (const ShaderVariantId &shaderVariantId)
 
const RHI::PipelineStateDescriptorForDrawConstDescriptor () const
 
const Data::Instance< Shader > & GetShader () const
 Get the shader which is associated with this PipelineState.
 
bool UpdateSrgVariantFallback (Data::Instance< ShaderResourceGroup > &srg) const
 
void Shutdown ()
 Clear all the states and references.
 
const ShaderVariantIdGetShaderVariantId () const
 Returns the id of the shader variant being used.
 

Detailed Description

The PipelineStateForDraw caches descriptor for RHI::PipelineState's creation so the RHI::PipelineState can be created or updated later when Scene's render pipelines changed or any other data in the descriptor has changed.

Member Function Documentation

◆ Finalize()

const RHI::PipelineState * AZ::RPI::PipelineStateForDraw::Finalize ( )

Re-create the RHI::PipelineState for the input Scene. The created RHI::PipelineState will be cached and can be acquired by using GetPipelineState()

◆ GetRHIPipelineState()

const RHI::PipelineState * AZ::RPI::PipelineStateForDraw::GetRHIPipelineState ( ) const

Get cached RHI::PipelineState. It triggers an assert if the pipeline state is dirty.

◆ Init()

void AZ::RPI::PipelineStateForDraw::Init ( const Data::Instance< Shader > &  shader,
const ShaderOptionList *  optionAndValues = nullptr 
)

Initialize the pipeline state from a shader and one of its shader variant The previous data will be reset

◆ InputStreamLayout()

RHI::InputStreamLayout & AZ::RPI::PipelineStateForDraw::InputStreamLayout ( )

Return the reference of the pipeline state descriptor's m_inputStreamLayout which can be modified directly It sets this pipeline state to dirty whenever it's called. Use ConstDescriptor() to access read-only InputStreamLayout

◆ RenderStatesOverlay()

RHI::RenderStates & AZ::RPI::PipelineStateForDraw::RenderStatesOverlay ( )

Return the reference of the RenderStates overlay which will be applied to original m_renderState which are loaded from shader variant Use this function to modify pipeline states RenderStates. It sets this pipeline state to dirty whenever it's called. Use ConstDescriptor() to access read-only RenderStates

◆ SetOutputFromScene()

void AZ::RPI::PipelineStateForDraw::SetOutputFromScene ( const Scene scene,
RHI::DrawListTag  overrideDrawListTag = RHI::DrawListTag() 
)

Update the pipeline state descriptor for the specified scene This is usually called when Scene's render pipelines changed

◆ UpdateShaderVaraintId()

void AZ::RPI::PipelineStateForDraw::UpdateShaderVaraintId ( const ShaderVariantId shaderVariantId)

Updates the current shader variant id. It sets this pipeline state to dirty whenever it's called.

◆ UpdateSrgVariantFallback()

bool AZ::RPI::PipelineStateForDraw::UpdateSrgVariantFallback ( Data::Instance< ShaderResourceGroup > &  srg) const

Setup the shader variant fallback key to a shader resource group if the shader variant is not ready Return true if the srg was modified.


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