![]() |
Murl Engine API
Version 2018.3
|
The IShader video object interface. More...
#include <murl_video_i_shader.h>
The IShader video object interface.
This interface represents a GPU shader to be attached to an IProgram.
Used internally by Graph::Shader.
Inherited by Murl::Video::Shader.
Public Member Functions | |
virtual IObject * | GetObjectInterface ()=0 |
Get the mutable Video::IObject interface. More... | |
virtual const IObject * | GetObjectInterface () const =0 |
Get the constant Video::IObject interface. More... | |
virtual Bool | AttachToProgram (void *handle)=0 |
Attach the shader to a program. More... | |
virtual Bool | DetachFromProgram (void *handle)=0 |
Detach the shader from a program. More... | |
virtual Bool | SetType (IEnums::ShaderType type)=0 |
Set the shader type. More... | |
virtual IEnums::ShaderType | GetType () const =0 |
Get the shader type. More... | |
virtual Bool | SetSource (const String &source)=0 |
Directly set the shader's source code from a given string. More... | |
virtual const String & | GetSource () const =0 |
Get the shader's source code, if it was explicitly set via SetSource(). More... | |
virtual Bool | SetData (const ConstData &data)=0 |
Set the shader binary. More... | |
virtual const ConstData & | GetData () const =0 |
Get the shader binary, if it was set via SetData(). More... | |
virtual SInt32 | AddConstantBuffer (const String &name, UInt32 location, IEnums::ConstantBufferItem item)=0 |
Add a constant buffer descriptor. More... | |
virtual SInt32 | AddConstantBufferAlternativeName (UInt32 index, const String &name)=0 |
Add an alternative name for a previously added constant buffer. More... | |
virtual SInt32 | GetConstantBufferIndex (UInt32 location) const =0 |
Get the zero-based index of the constant buffer at a given location. More... | |
virtual UInt32 | GetNumberOfConstantBuffers () const =0 |
Get the total number of constant buffers present in the shader. More... | |
virtual SInt32 | GetConstantBufferLocation (UInt32 constantBufferIndex) const =0 |
Get the location (register number) of a constant buffer at a given index. More... | |
virtual IEnums::ConstantBufferItem | GetConstantBufferItem (UInt32 constantBufferIndex) const =0 |
Get the predefined item of a constant buffer at a given index. More... | |
virtual const String & | GetConstantBufferName (UInt32 constantBufferIndex) const =0 |
Get the name of a constant buffer at a given index. More... | |
virtual UInt32 | GetNumberOfConstantBufferAlternativeNames (UInt32 constantBufferIndex) const =0 |
Get the number of alternative names of a constant buffer at a given index. More... | |
virtual const String & | GetConstantBufferAlternativeName (UInt32 constantBufferIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative name of a constant buffer at a given index. More... | |
virtual SInt32 | AddUniform (const String &name, UInt32 location, IEnums::UniformItem item, IEnums::UniformType type)=0 |
Add a uniform descriptor. More... | |
virtual SInt32 | AddUniformAlternativeName (UInt32 index, const String &name)=0 |
Add an alternative name for a previously added uniform. More... | |
virtual SInt32 | GetUniformIndex (UInt32 location) const =0 |
Get the zero-based index of the uniform at a given location. More... | |
virtual UInt32 | GetNumberOfUniforms () const =0 |
Get the total number of uniforms present in the shader. More... | |
virtual SInt32 | GetUniformLocation (UInt32 uniformIndex) const =0 |
Get the location (register number) of a uniform at a given index. More... | |
virtual IEnums::UniformItem | GetUniformItem (UInt32 uniformIndex) const =0 |
Get the predefined item of a uniform at a given index. More... | |
virtual IEnums::UniformType | GetUniformType (UInt32 uniformIndex) const =0 |
Get the data type of a uniform at a given index. More... | |
virtual const String & | GetUniformName (UInt32 uniformIndex) const =0 |
Get the name of a uniform at a given index. More... | |
virtual UInt32 | GetNumberOfUniformAlternativeNames (UInt32 uniformIndex) const =0 |
Get the number of alternative names of a uniform at a given index. More... | |
virtual const String & | GetUniformAlternativeName (UInt32 uniformIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative name of a uniform at a given index. More... | |
virtual SInt32 | AddAttribute (const String &name, UInt32 location, IEnums::AttributeItem item, IEnums::AttributeType type)=0 |
Add an attribute descriptor. More... | |
virtual SInt32 | AddAttributeAlternativeName (UInt32 index, const String &name)=0 |
Add an alternative name for a previously added attribute. More... | |
virtual SInt32 | GetAttributeIndex (UInt32 location) const =0 |
Get the zero-based index of the attribute at a given location. More... | |
virtual UInt32 | GetNumberOfAttributes () const =0 |
Get the total number of attributes present in the shader. More... | |
virtual SInt32 | GetAttributeLocation (UInt32 attributeIndex) const =0 |
Get the location (register number) of an attribute at a given index. More... | |
virtual IEnums::AttributeItem | GetAttributeItem (UInt32 attributeIndex) const =0 |
Get the predefined item of an attribute at a given index. More... | |
virtual IEnums::AttributeType | GetAttributeType (UInt32 attributeIndex) const =0 |
Get the data type of an attribute at a given index. More... | |
virtual const String & | GetAttributeName (UInt32 attributeIndex) const =0 |
Get the name of an attribute at a given index. More... | |
virtual UInt32 | GetNumberOfAttributeAlternativeNames (UInt32 attributeIndex) const =0 |
Get the number of alternative names of an attribute at a given index. More... | |
virtual const String & | GetAttributeAlternativeName (UInt32 attributeIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative name of an attribute at a given index. More... | |
virtual SInt32 | AddTexture (const String &name, UInt32 location, IEnums::TextureType type, const IEnums::TextureSemantic *semantics, const UInt32 *semanticIndices)=0 |
Add a texture sampler descriptor. More... | |
virtual SInt32 | AddTextureAlternativeName (UInt32 index, const String &name)=0 |
Add an alternative name for a previously added texture sampler. More... | |
virtual SInt32 | GetTextureIndex (UInt32 location) const =0 |
Get the zero-based index of the texture sampler at a given location. More... | |
virtual UInt32 | GetNumberOfTextures () const =0 |
Get the total number of texture samplers present in the shader. More... | |
virtual SInt32 | GetTextureLocation (UInt32 textureIndex) const =0 |
Get the location (texture unit) of a sampler at a given index. More... | |
virtual IEnums::TextureType | GetTextureType (UInt32 textureIndex) const =0 |
Get the type of a texture sampler at a given index. More... | |
virtual IEnums::TextureSemantic | GetTextureSemantic (UInt32 textureIndex, IEnums::ColorComponent colorComponent) const =0 |
Get the texture semantic of a sampler for a given index and color component. More... | |
virtual UInt32 | GetTextureSemanticIndex (UInt32 textureIndex, IEnums::ColorComponent colorComponent) const =0 |
Get the texture semantic index of a sampler for a given index and color component. More... | |
virtual const String & | GetTextureName (UInt32 textureIndex) const =0 |
Get the name of a texture sampler at a given index. More... | |
virtual UInt32 | GetNumberOfTextureAlternativeNames (UInt32 textureIndex) const =0 |
Get the number of alternative names of a texture sampler at a given index. More... | |
virtual const String & | GetTextureAlternativeName (UInt32 textureIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative name of a texture sampler at a given index. More... | |
virtual Bool | IsValid () const =0 |
Check if the shader is valid. More... | |
virtual const String & | GetCompilerLog () const =0 |
Get the shader compiler log. More... | |
|
pure virtual |
Get the mutable Video::IObject interface.
|
pure virtual |
Get the constant Video::IObject interface.
|
pure virtual |
Attach the shader to a program.
handle | A handle to the program. |
|
pure virtual |
Detach the shader from a program.
handle | A handle to the program. |
|
pure virtual |
Set the shader type.
type | The shader type. |
|
pure virtual |
Get the shader type.
Directly set the shader's source code from a given string.
source | The shader source code. |
|
pure virtual |
Get the shader's source code, if it was explicitly set via SetSource().
Set the shader binary.
data | The binary shader data. |
|
pure virtual |
Get the shader binary, if it was set via SetData().
|
pure virtual |
Add a constant buffer descriptor.
name | The constant buffer name. |
location | The location (register number) of the constant buffer in the shader. |
item | The predefined constant buffer item. |
|
pure virtual |
Add an alternative name for a previously added constant buffer.
index | The index of the constant buffer in the shader, from 0 to GetNumberOfConstantBuffers()-1. |
name | The constant buffer's alternative name. |
Get the zero-based index of the constant buffer at a given location.
location | The location (register number) to query. |
|
pure virtual |
Get the total number of constant buffers present in the shader.
|
pure virtual |
Get the location (register number) of a constant buffer at a given index.
constantBufferIndex | The index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get the predefined item of a constant buffer at a given index.
constantBufferIndex | The index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get the name of a constant buffer at a given index.
constantBufferIndex | The index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get the number of alternative names of a constant buffer at a given index.
constantBufferIndex | The index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get an alternative name of a constant buffer at a given index.
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfConstantBufferAlternativeNames()-1. |
|
pure virtual |
Add a uniform descriptor.
name | The uniform name. |
location | The location (register number) of the uniform in the shader. |
item | The predefined uniform item. |
type | The uniform data type. |
|
pure virtual |
Add an alternative name for a previously added uniform.
index | The index of the uniform in the shader, from 0 to GetNumberOfUniforms()-1. |
name | The uniform's alternative name. |
Get the zero-based index of the uniform at a given location.
location | The location (register number) to query. |
|
pure virtual |
Get the total number of uniforms present in the shader.
Get the location (register number) of a uniform at a given index.
uniformIndex | The index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the predefined item of a uniform at a given index.
uniformIndex | The index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the data type of a uniform at a given index.
uniformIndex | The index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the name of a uniform at a given index.
uniformIndex | The index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the number of alternative names of a uniform at a given index.
uniformIndex | The index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get an alternative name of a uniform at a given index.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfUniformAlternativeNames()-1. |
|
pure virtual |
Add an attribute descriptor.
name | The attribute name. |
location | The location (register number) of the attribute in the shader. |
item | The predefined attribute item. |
type | The attribute data type. |
|
pure virtual |
Add an alternative name for a previously added attribute.
index | The index of the attribute in the shader, from 0 to GetNumberOfAttributes()-1. |
name | The attribute's alternative name. |
Get the zero-based index of the attribute at a given location.
location | The location (register number) to query. |
|
pure virtual |
Get the total number of attributes present in the shader.
|
pure virtual |
Get the location (register number) of an attribute at a given index.
attributeIndex | The index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the predefined item of an attribute at a given index.
attributeIndex | The index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the data type of an attribute at a given index.
attributeIndex | The index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the name of an attribute at a given index.
attributeIndex | The index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the number of alternative names of an attribute at a given index.
attributeIndex | The index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get an alternative name of an attribute at a given index.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfAttributeAlternativeNames()-1. |
|
pure virtual |
Add a texture sampler descriptor.
name | The sampler name. |
location | The location (register number) of the constant buffer in the shader. |
type | The texture type. |
semantics | An array of 4 texture semantics, one for each color component. |
semanticIndices | An array of 4 texture semantic indices, one for each color component. |
|
pure virtual |
Add an alternative name for a previously added texture sampler.
index | The index of the sampler in the shader, from 0 to GetNumberOfTextures()-1. |
name | The sampler's alternative name. |
Get the zero-based index of the texture sampler at a given location.
location | The location (register number) to query. |
|
pure virtual |
Get the total number of texture samplers present in the shader.
Get the location (texture unit) of a sampler at a given index.
textureIndex | The index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get the type of a texture sampler at a given index.
textureIndex | The index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get the texture semantic of a sampler for a given index and color component.
textureIndex | The index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
|
pure virtual |
Get the texture semantic index of a sampler for a given index and color component.
textureIndex | The index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
|
pure virtual |
Get the name of a texture sampler at a given index.
textureIndex | The index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get the number of alternative names of a texture sampler at a given index.
textureIndex | The index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get an alternative name of a texture sampler at a given index.
textureIndex | The texture index, from 0 to GetNumberOfTextures()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfTextureAlternativeNames()-1. |
|
pure virtual |
Check if the shader is valid.
If creation/compilation of the shader object fails, this method returns false.
|
pure virtual |
Get the shader compiler log.
If creation/compilation of the shader object fails, this method returns the output provided by the OS/video API. Otherwise, an empty string is returned.