The IShader video object interface. More...
#include "murl_video_i_shader.h"
Inherited by Murl::Video::Shader, and Murl::Video::Vulkan::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... | |
Detailed Description
The IShader video object interface.
This interface represents a GPU shader to be attached to an IProgram.
Used internally by Graph::Shader.
Member Function Documentation
◆ GetObjectInterface() [1/2]
|
pure virtual |
Get the mutable Video::IObject interface.
- Returns
- The IObject interface.
◆ GetObjectInterface() [2/2]
|
pure virtual |
Get the constant Video::IObject interface.
- Returns
- The IObject interface.
◆ AttachToProgram()
|
pure virtual |
Attach the shader to a program.
- Parameters
-
handle A handle to the program.
- Returns
- true if successful.
◆ DetachFromProgram()
|
pure virtual |
Detach the shader from a program.
- Parameters
-
handle A handle to the program.
- Returns
- true if successful.
◆ SetType()
|
pure virtual |
Set the shader type.
- Parameters
-
type The shader type.
- Returns
- true if successful.
◆ GetType()
|
pure virtual |
Get the shader type.
- Returns
- The shader type.
◆ SetSource()
Directly set the shader's source code from a given string.
- Parameters
-
source The shader source code.
- Returns
- true if successful.
◆ GetSource()
|
pure virtual |
Get the shader's source code, if it was explicitly set via SetSource().
- Returns
- The shader source code.
◆ SetData()
Set the shader binary.
- Parameters
-
data The binary shader data.
- Returns
- true if successful.
◆ GetData()
|
pure virtual |
Get the shader binary, if it was set via SetData().
- Returns
- The binary shader data.
◆ AddConstantBuffer()
|
pure virtual |
Add a constant buffer descriptor.
- Parameters
-
name The constant buffer name. location The location (register number) of the constant buffer in the shader. item The predefined constant buffer item.
- Returns
- The index of the added constant buffer, or -1 if failed.
◆ AddConstantBufferAlternativeName()
|
pure virtual |
Add an alternative name for a previously added constant buffer.
- Parameters
-
index The index of the constant buffer in the shader, from 0 to GetNumberOfConstantBuffers()-1. name The constant buffer's alternative name.
- Returns
- The index of the alternative name string, or -1 if failed.
◆ GetConstantBufferIndex()
Get the zero-based index of the constant buffer at a given location.
- Parameters
-
location The location (register number) to query.
- Returns
- The index of the constant buffer in the shader, or -1 if not found.
◆ GetNumberOfConstantBuffers()
|
pure virtual |
Get the total number of constant buffers present in the shader.
- Returns
- The number of constant buffers.
◆ GetConstantBufferLocation()
|
pure virtual |
Get the location (register number) of a constant buffer at a given index.
- Parameters
-
constantBufferIndex The index, from 0 to GetNumberOfConstantBuffers()-1.
- Returns
- The location, or -1 if the index is out of range.
◆ GetConstantBufferItem()
|
pure virtual |
Get the predefined item of a constant buffer at a given index.
- Parameters
-
constantBufferIndex The index, from 0 to GetNumberOfConstantBuffers()-1.
- Returns
- The predefined item.
◆ GetConstantBufferName()
|
pure virtual |
Get the name of a constant buffer at a given index.
- Parameters
-
constantBufferIndex The index, from 0 to GetNumberOfConstantBuffers()-1.
- Returns
- The name, or an empty string if the index is out of range.
◆ GetNumberOfConstantBufferAlternativeNames()
|
pure virtual |
Get the number of alternative names of a constant buffer at a given index.
- Parameters
-
constantBufferIndex The index, from 0 to GetNumberOfConstantBuffers()-1.
- Returns
- The number of alternative names, or 0 if the index is out of range.
◆ GetConstantBufferAlternativeName()
|
pure virtual |
Get an alternative name of a constant buffer at a given index.
- Parameters
-
constantBufferIndex The buffer index, from 0 to GetNumberOfConstantBuffers()-1. alternativeNameIndex The name index, from 0 to GetNumberOfConstantBufferAlternativeNames()-1.
- Returns
- The alternative name, or an empty string if an index is out of range.
◆ AddUniform()
|
pure virtual |
Add a uniform descriptor.
- Parameters
-
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.
- Returns
- The index of the added uniform, or -1 if failed.
◆ AddUniformAlternativeName()
|
pure virtual |
Add an alternative name for a previously added uniform.
- Parameters
-
index The index of the uniform in the shader, from 0 to GetNumberOfUniforms()-1. name The uniform's alternative name.
- Returns
- The index of the alternative name string, or -1 if failed.
◆ GetUniformIndex()
Get the zero-based index of the uniform at a given location.
- Parameters
-
location The location (register number) to query.
- Returns
- The index of the uniform in the shader, or -1 if not found.
◆ GetNumberOfUniforms()
|
pure virtual |
Get the total number of uniforms present in the shader.
- Returns
- The number of uniforms.
◆ GetUniformLocation()
Get the location (register number) of a uniform at a given index.
- Parameters
-
uniformIndex The index, from 0 to GetNumberOfUniforms()-1.
- Returns
- The location, or -1 if the index is out of range.
◆ GetUniformItem()
|
pure virtual |
Get the predefined item of a uniform at a given index.
- Parameters
-
uniformIndex The index, from 0 to GetNumberOfUniforms()-1.
- Returns
- The predefined item.
◆ GetUniformType()
|
pure virtual |
Get the data type of a uniform at a given index.
- Parameters
-
uniformIndex The index, from 0 to GetNumberOfUniforms()-1.
- Returns
- The data type, or IEnums::UNIFORM_TYPE_UNDEFINED if the index is out of range.
◆ GetUniformName()
|
pure virtual |
Get the name of a uniform at a given index.
- Parameters
-
uniformIndex The index, from 0 to GetNumberOfUniforms()-1.
- Returns
- The name, or an empty string if the index is out of range.
◆ GetNumberOfUniformAlternativeNames()
|
pure virtual |
Get the number of alternative names of a uniform at a given index.
- Parameters
-
uniformIndex The index, from 0 to GetNumberOfUniforms()-1.
- Returns
- The number of alternative names, or 0 if the index is out of range.
◆ GetUniformAlternativeName()
|
pure virtual |
Get an alternative name of a uniform at a given index.
- Parameters
-
uniformIndex The uniform index, from 0 to GetNumberOfUniforms()-1. alternativeNameIndex The name index, from 0 to GetNumberOfUniformAlternativeNames()-1.
- Returns
- The alternative name, or an empty string if an index is out of range.
◆ AddAttribute()
|
pure virtual |
Add an attribute descriptor.
- Parameters
-
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.
- Returns
- The index of the added attribute, or -1 if failed.
◆ AddAttributeAlternativeName()
|
pure virtual |
Add an alternative name for a previously added attribute.
- Parameters
-
index The index of the attribute in the shader, from 0 to GetNumberOfAttributes()-1. name The attribute's alternative name.
- Returns
- The index of the alternative name string, or -1 if failed.
◆ GetAttributeIndex()
Get the zero-based index of the attribute at a given location.
- Parameters
-
location The location (register number) to query.
- Returns
- The index of the attribute in the shader, or -1 if not found.
◆ GetNumberOfAttributes()
|
pure virtual |
Get the total number of attributes present in the shader.
- Returns
- The number of attributes.
◆ GetAttributeLocation()
|
pure virtual |
Get the location (register number) of an attribute at a given index.
- Parameters
-
attributeIndex The index, from 0 to GetNumberOfAttributes()-1.
- Returns
- The location, or -1 if the index is out of range.
◆ GetAttributeItem()
|
pure virtual |
Get the predefined item of an attribute at a given index.
- Parameters
-
attributeIndex The index, from 0 to GetNumberOfAttributes()-1.
- Returns
- The predefined item.
◆ GetAttributeType()
|
pure virtual |
Get the data type of an attribute at a given index.
- Parameters
-
attributeIndex The index, from 0 to GetNumberOfAttributes()-1.
- Returns
- The data type, or IEnums::ATTRIBUTE_TYPE_UNDEFINED if the index is out of range.
◆ GetAttributeName()
|
pure virtual |
Get the name of an attribute at a given index.
- Parameters
-
attributeIndex The index, from 0 to GetNumberOfAttributes()-1.
- Returns
- The name, or an empty string if the index is out of range.
◆ GetNumberOfAttributeAlternativeNames()
|
pure virtual |
Get the number of alternative names of an attribute at a given index.
- Parameters
-
attributeIndex The index, from 0 to GetNumberOfAttributes()-1.
- Returns
- The number of alternative names, or 0 if the index is out of range.
◆ GetAttributeAlternativeName()
|
pure virtual |
Get an alternative name of an attribute at a given index.
- Parameters
-
attributeIndex The attribute index, from 0 to GetNumberOfAttributes()-1. alternativeNameIndex The name index, from 0 to GetNumberOfAttributeAlternativeNames()-1.
- Returns
- The alternative name, or an empty string if an index is out of range.
◆ AddTexture()
|
pure virtual |
Add a texture sampler descriptor.
- Parameters
-
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.
- Returns
- The index of the added sampler, or -1 if failed.
◆ AddTextureAlternativeName()
|
pure virtual |
Add an alternative name for a previously added texture sampler.
- Parameters
-
index The index of the sampler in the shader, from 0 to GetNumberOfTextures()-1. name The sampler's alternative name.
- Returns
- The index of the alternative name string, or -1 if failed.
◆ GetTextureIndex()
Get the zero-based index of the texture sampler at a given location.
- Parameters
-
location The location (register number) to query.
- Returns
- The index of the sampler in the shader, or -1 if not found.
◆ GetNumberOfTextures()
|
pure virtual |
Get the total number of texture samplers present in the shader.
- Returns
- The number of samplers.
◆ GetTextureLocation()
Get the location (texture unit) of a sampler at a given index.
- Parameters
-
textureIndex The index, from 0 to GetNumberOfTextures()-1.
- Returns
- The location, or -1 if the index is out of range.
◆ GetTextureType()
|
pure virtual |
Get the type of a texture sampler at a given index.
- Parameters
-
textureIndex The index, from 0 to GetNumberOfTextures()-1.
- Returns
- The sampler type.
◆ GetTextureSemantic()
|
pure virtual |
Get the texture semantic of a sampler for a given index and color component.
- Parameters
-
textureIndex The index, from 0 to GetNumberOfTextures()-1. colorComponent The color component to query.
- Returns
- The semantic, or IEnums::TEXTURE_SEMANTIC_UNDEFINED if the index is out of range.
◆ GetTextureSemanticIndex()
|
pure virtual |
Get the texture semantic index of a sampler for a given index and color component.
- Parameters
-
textureIndex The index, from 0 to GetNumberOfTextures()-1. colorComponent The color component to query.
- Returns
- The semantic index, or 0 if the index is out of range.
◆ GetTextureName()
|
pure virtual |
Get the name of a texture sampler at a given index.
- Parameters
-
textureIndex The index, from 0 to GetNumberOfTextures()-1.
- Returns
- The name, or an empty string if the index is out of range.
◆ GetNumberOfTextureAlternativeNames()
|
pure virtual |
Get the number of alternative names of a texture sampler at a given index.
- Parameters
-
textureIndex The index, from 0 to GetNumberOfTextures()-1.
- Returns
- The number of alternative names, or 0 if the index is out of range.
◆ GetTextureAlternativeName()
|
pure virtual |
Get an alternative name of a texture sampler at a given index.
- Parameters
-
textureIndex The texture index, from 0 to GetNumberOfTextures()-1. alternativeNameIndex The name index, from 0 to GetNumberOfTextureAlternativeNames()-1.
- Returns
- The alternative name, or an empty string if an index is out of range.
◆ IsValid()
|
pure virtual |
Check if the shader is valid.
If creation/compilation of the shader object fails, this method returns false.
- Returns
- true if shader compilation succeeded during initialization.
◆ GetCompilerLog()
|
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.
- Returns
- The compiler log message.
The documentation for this interface was generated from the following file:
- murl_video_i_shader.h