class render::Shader

Render thread version of Shader.

Public

Methods

staticCreate

static SPtr<Shader> Create(const String &name, const ShaderCreateInformation &createInformation)

Creates a new shader resource using the provided descriptor and variations.

staticCreateEmpty

static SPtr<Shader> CreateEmpty()

Creates an empty shader.

GetShaderName

String GetShaderName() const

Returns the name of the shader.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

~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.

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

Constructors

Shader

Shader(const String &name, const ShaderCreateInformation &createInformation, u32 id)

Fields

mName

String mName

mInformation

ShaderInformationType mInformation

mShaderId

u32 mShaderId

Private

Constructors

Shader

Shader(u32 id)

*********************************************************************