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

#include <ShaderVariant.h>

Public Member Functions

 AZ_DEFAULT_COPY_MOVE (ShaderVariant)
 
void ConfigurePipelineState (RHI::PipelineStateDescriptor &descriptor, const ShaderVariantId &specialization) const
 
void ConfigurePipelineState (RHI::PipelineStateDescriptor &descriptor, const ShaderOptionGroup &specialization) const
 
void ConfigurePipelineState (RHI::PipelineStateDescriptor &descriptor) const
 
const ShaderVariantIdGetShaderVariantId () const
 
bool IsFullyBaked () const
 
bool IsFullySpecialized () const
 Returns whether the variant is using specialization constants for all of the options.
 
bool UseSpecializationConstants () const
 Return true if this shader variant has at least one shader option using specialization constant.
 
bool UseKeyFallback () const
 Return true if this variant needs the ShaderVariantKeyFallbackValue to be correctly set when drawing.
 
bool IsRootVariant () const
 
ShaderVariantStableId GetStableId () const
 
const Data::Asset< ShaderAsset > & GetShaderAsset () const
 
const Data::Asset< ShaderVariantAsset > & GetShaderVariantAsset () const
 

Friends

class Shader
 

Detailed Description

Represents the concrete state to configure a PipelineStateDescriptor. ShaderVariant's match the RHI::PipelineStateType of the parent Shader instance. For shaders on the raster pipeline, the RHI::DrawFilterTag is also provided.

Member Function Documentation

◆ ConfigurePipelineState() [1/3]

void AZ::RPI::ShaderVariant::ConfigurePipelineState ( RHI::PipelineStateDescriptor descriptor) const

Fills a pipeline state descriptor with settings provided by the ShaderVariant. Only use this function if the shader variant is not using ANY specialization constant. Otherwise an error will be raised and the default values will be used.

◆ ConfigurePipelineState() [2/3]

void AZ::RPI::ShaderVariant::ConfigurePipelineState ( RHI::PipelineStateDescriptor descriptor,
const ShaderOptionGroup specialization 
) const

Fills a pipeline state descriptor with settings provided by the ShaderVariant. It also configures the specialization constants if they are being used by the shader variant.

◆ ConfigurePipelineState() [3/3]

void AZ::RPI::ShaderVariant::ConfigurePipelineState ( RHI::PipelineStateDescriptor descriptor,
const ShaderVariantId specialization 
) const

Fills a pipeline state descriptor with settings provided by the ShaderVariant. It also configures the specialization constants if they are being used by the shader variant. (Note that this does not fill the InputStreamLayout or OutputAttachmentLayout as that also requires information from the mesh data and pass system and must be done as a separate step).

◆ IsFullyBaked()

bool AZ::RPI::ShaderVariant::IsFullyBaked ( ) const
inline

Returns whether the variant is fully baked variant (all options are static branches), or false if the variant uses dynamic branches for some shader options. If the shader variant is not fully baked, the ShaderVariantKeyFallbackValue must be correctly set when drawing.


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