class TShader

template<bool IsRenderProxy>

Templated version of Shader used for implementing both main and render thread counterparts.

Public

Constructors

TShader<IsRenderProxy>

TShader<IsRenderProxy>(u32 id)

TShader<IsRenderProxy>

TShader<IsRenderProxy>(const ShaderCreateInformationType &createInformation, u32 id)

Methods

~TShader<IsRenderProxy>

virtual ~TShader<IsRenderProxy>()

GetVariationCount

u32 GetVariationCount() const

Returns the total number of variations in this shader.

GetCompatibleVariations

Vector<SPtr<VariationType>> GetCompatibleVariations() const

Returns the list of all supported variations based on current render API and renderer.

GetCompatibleVariations

Vector<SPtr<VariationType>> GetCompatibleVariations(const ShaderVariationParameters &variationParameters, bool exact) const

Returns the list of all supported variations based on current render API and renderer, and limits the variations to only those implementing the specified variation parameters.

variationParameters
Object containing variation parameters to compare to check.
exact
When true the variation needs to have the exact number of parameters with identical contents to the provided parameters. When false, only the provided subset of parameters is used for comparison, while any extra parameters present in the variation are not compared.

GetVariations

const Vector<SPtr<VariationType>> &GetVariations() const

Returns a list of all variations in this shader.

GetVariationParameters

const Vector<ShaderVariationParameterInformation> &GetVariationParameters() const

Returns the list of all variation parameters supported by this shader, possible values of each parameter and other meta-data.

GetQueueSortType

QueueSortType GetQueueSortType() const

Returns currently active queue sort type.

GetQueuePriority

i32 GetQueuePriority() const

Returns currently active queue priority.

GetAllowSeparablePasses

bool GetAllowSeparablePasses() const

Returns if separable passes are allowed.

GetFlags

ShaderFlags GetFlags() const

Returns flags that control how the renderer interprets the shader.

Actual interpretation of the flags depends on the active renderer.

GetDataParameterDescription

const ShaderDataParameterInformation *GetDataParameterDescription(const String &name) const

Returns description for a data parameter with the specified name.

Returns null if it doesn't exist.

GetTextureParameterDescription

const ShaderObjectParameterInformation *GetTextureParameterDescription(const String &name) const

Returns description for a texture parameter with the specified name.

Returns null if it doesn't exist.

GetSamplerParameterDescription

const ShaderObjectParameterInformation *GetSamplerParameterDescription(const String &name) const

Returns description for a sampler parameter with the specified name.

Returns null if it doesn't exist.

GetBufferParameterInformation

const ShaderObjectParameterInformation *GetBufferParameterInformation(const String &name) const

Returns description for a buffer parameter with the specified name.

Returns null if it doesn't exist.

HasDataParameter

bool HasDataParameter(const String &name) const

Checks if the parameter with the specified name exists, and is a data parameter.

HasTextureParameter

bool HasTextureParameter(const String &name) const

Checks if the parameter with the specified name exists, and is a texture parameter.

HasSamplerParameter

bool HasSamplerParameter(const String &name) const

Checks if the parameter with the specified name exists, and is a sampler parameter.

HasBufferParameter

bool HasBufferParameter(const String &name) const

Checks if the parameter with the specified name exists, and is a buffer parameter.

HasUniformBuffer

bool HasUniformBuffer(const String &name) const

Checks if the uniform buffer with the specified name exists.

GetDataParameters

const Map<String, ShaderDataParameterInformation> &GetDataParameters() const

Returns a map of all data parameters in the shader.

GetTextureParameters

const Map<String, ShaderObjectParameterInformation> &GetTextureParameters() const

Returns a map of all texture parameters in the shader.

GetBufferParameters

const Map<String, ShaderObjectParameterInformation> &GetBufferParameters() const

Returns a map of all buffer parameters in the shader.

GetSamplerParameters

const Map<String, ShaderObjectParameterInformation> &GetSamplerParameters() const

Returns a map of all sampler parameters in the shader.

GetUniformBuffers

const Map<String, ShaderUniformBufferInformation> &GetUniformBuffers() const

Returns a map of all uniform buffers.

GetParameterAttributes

const Vector<ShaderParameterAttribute> &GetParameterAttributes() const

Returns a list of all parameter attributes, as referenced by individual parameters.

GetDefault2DTexture

TextureType GetDefault2DTexture(u32 index) const

Returns a default 2D texture for a parameter that has the specified default value index (retrieved from the parameters descriptor).

GetDefault3DTexture

TextureType GetDefault3DTexture(u32 index) const

Returns a default 3D texture for a parameter that has the specified default value index (retrieved from the parameters descriptor).

GetDefaultSampler

SPtr<SamplerState> GetDefaultSampler(u32 index) const

Returns a default sampler state for a parameter that has the specified default value index (retrieved from the parameters descriptor).

GetDefaultValue

u8 *GetDefaultValue(u32 index) const

Returns a pointer to the internal buffer containing the default value for a data parameter that has the specified default value index (retrieved from the parameters descriptor).

GetShaderId

u32 GetShaderId() const

Returns the unique shader ID.

Internal

Methods

GetCompilerMetaData

const SPtr<ShaderCompilerMetaData> &GetCompilerMetaData() const

Returns the meta-data required by the shader compiler to compile individual shader variations.

Protected

Fields

mInformation

ShaderInformationType mInformation

mShaderId

u32 mShaderId