#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::PipelineState * | Finalize () |
| const RHI::PipelineState * | GetRHIPipelineState () const |
| RHI::RenderStates & | RenderStatesOverlay () |
| RHI::InputStreamLayout & | InputStreamLayout () |
| void | UpdateShaderVaraintId (const ShaderVariantId &shaderVariantId) |
| const RHI::PipelineStateDescriptorForDraw & | ConstDescriptor () 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 ShaderVariantId & | GetShaderVariantId () const |
| Returns the id of the shader variant being used. | |
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.
| 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()
| const RHI::PipelineState * AZ::RPI::PipelineStateForDraw::GetRHIPipelineState | ( | ) | const |
Get cached RHI::PipelineState. It triggers an assert if the pipeline state is dirty.
| 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
| 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
| 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
| 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
| 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.
| 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.