#include <ShaderOptionGroupLayout.h>
Inherits AZStd::intrusive_base.
Public Member Functions | |
AZ_TYPE_INFO (AZ::RPI::ShaderOptionGroupLayout, "{32E269DE-12A2-4B65-B4F8-BAE93DD39D7E}") | |
AZ_CLASS_ALLOCATOR (ShaderOptionGroupLayout, AZ::ThreadPoolAllocator) | |
AZ_DISABLE_COPY_MOVE (ShaderOptionGroupLayout) | |
bool | IsFinalized () const |
Returns whether the layout is finalized. | |
void | Clear () |
Clears the layout to an empty state. | |
void | Finalize () |
bool | AddShaderOption (const ShaderOptionDescriptor &shaderOption) |
ShaderOptionIndex | FindShaderOptionIndex (const Name &optionName) const |
Finds a shader option index from an option name. Returns an empty handle if the option name was not found. | |
ShaderOptionValue | FindValue (const Name &optionName, const Name &valueName) const |
Finds a shader value from an option name. Returns an empty handle if the value name was not found. | |
ShaderOptionValue | FindValue (const ShaderOptionIndex &optionIndex, const Name &valueName) const |
Finds a shader value from a value name. Returns an empty handle if the value name was not found. | |
uint32_t | GetBitSize () const |
Returns the number of ShaderVariantKey bits used by this layout. The max is ShaderVariantKeyBitCount. | |
const AZStd::vector< ShaderOptionDescriptor > & | GetShaderOptions () const |
Returns a list of all shader options in the ShaderOptionGroupLayout. | |
const ShaderOptionDescriptor & | GetShaderOption (ShaderOptionIndex optionIndex) const |
Returns the shader option descriptor associated with the requested index. | |
size_t | GetShaderOptionCount () const |
Returns the total number of shader options. | |
ShaderVariantKey | GetBitMask () const |
Returns the mask that is the complete set of bits used by options in the layout. | |
bool | IsValidShaderVariantKey (const ShaderVariantKey &shaderVariantKey) const |
Returns whether the key contains all valid bits for the given layout. | |
HashValue64 | GetHash () const |
Static Public Member Functions | |
static void | Reflect (ReflectContext *context) |
static Ptr< ShaderOptionGroupLayout > | Create () |
Friends | |
template<typename , typename > | |
struct | AnyTypeInfoConcept |
template<typename , bool , bool > | |
struct | Serialize::InstanceFactory |
Describes a complete layout of shader options and how they map to a ShaderKey. Contains information on how to construct shader keys from shader option key/value pair data. Does not contain actual shader option values (those reside in ShaderOptionGroup).
bool AZ::RPI::ShaderOptionGroupLayout::AddShaderOption | ( | const ShaderOptionDescriptor & | shaderOption | ) |
Adds a new shader option paired with a mask. If the mask overlaps an existing mask, the function fails and returns false. Otherwise, the mask is added to the set and the function returns true.
void AZ::RPI::ShaderOptionGroupLayout::Finalize | ( | ) |
Finalizes the layout. Clear must be called before mutating the layout again. Finalization is preserved when serializing; it is unnecessary to call Finalize after serialization assuming it was called prior to serialization.