![]() |
Murl Engine API
Version 2018.3
|
The IShader resource object interface. More...
#include <murl_resource_i_shader.h>
The IShader resource object interface.
A shader resource contains GPU shader program code in a number of possible formats, both source and binary forms are defined. The resource object can also contain meta information for the shader (such as information about attributes, texture semantics etc.), for shaders that cannot be queried for this information at run-time (e.g. DirectX 10+ HLSL binary blobs).
Classes | |
struct | Iff |
IFF file specific structs. More... | |
Public Member Functions | |
virtual IObject * | GetObjectInterface ()=0 |
Get the mutable Resource::IObject interface. More... | |
virtual const IObject * | GetObjectInterface () const =0 |
Get the constant Resource::IObject interface. More... | |
virtual UInt32 | GetNumberOfSubShaders () const =0 |
Get the number of individual shader chunks. More... | |
virtual IShader * | GetSubShader (UInt32 shaderIndex)=0 |
Get the sub-shader at a given index. More... | |
virtual const IShader * | GetSubShader (UInt32 shaderIndex) const =0 |
Get the sub-shader at a given index. More... | |
virtual SInt32 | GetSubShaderIndex (IEnums::ShaderType type, IEnums::ShaderLanguage language) const =0 |
Get the index of a sub-shader via a given type and language. More... | |
virtual IEnums::ShaderType | GetType () const =0 |
Get the shader type. More... | |
virtual IEnums::ShaderLanguage | GetOutputLanguage () const =0 |
Get the actual output shader language. More... | |
virtual IEnums::ShaderLanguage | GetInputLanguage () const =0 |
Get the input shader language this shader was translated from. More... | |
virtual const ConstData & | GetRawData () const =0 |
Get the raw shader code data. More... | |
virtual const String & | GetUnoptimizedSource () const =0 |
Get the unoptimized shader source code, if present. More... | |
virtual const String & | GetUnoptimizedLog () const =0 |
Get the compiler log output of the unoptimized shader source code, if present. More... | |
virtual const String & | GetUnoptimizedDefinitions () const =0 |
Get the variable definitions of the unoptimized shader source code, if present. More... | |
virtual const StringArray & | GetUnoptimizedPrefix () const =0 |
Get the prefix(es) of the unoptimized shader source code, if present. More... | |
virtual const StringArray & | GetUnoptimizedCode () const =0 |
Get the code section(s) of the unoptimized shader source code, if present. More... | |
virtual const String & | GetOptimizedSource () const =0 |
Get the optimized shader source code, if present. More... | |
virtual const String & | GetOptimizedLog () const =0 |
Get the compiler log output of the optimized shader source code, if present. More... | |
virtual const String & | GetOptimizedDefinitions () const =0 |
Get the variable definitions of the optimized shader source code, if present. More... | |
virtual const StringArray & | GetOptimizedPrefix () const =0 |
Get the prefix(es) of the optimized shader source code, if present. More... | |
virtual const StringArray & | GetOptimizedCode () const =0 |
Get the code section(s) of the optimized shader source code, if present. More... | |
virtual UInt32 | GetNumberOfConstants () const =0 |
Get the number of constants used by the shader. More... | |
virtual SInt32 | GetConstantIndex (const String &name) const =0 |
Get the index of a constant with a given name. More... | |
virtual IEnums::ConstantType | GetConstantType (UInt32 constantIndex) const =0 |
Get the data type of a given constant. More... | |
virtual IEnums::ShaderVariablePrecision | GetConstantPrecision (UInt32 constantIndex) const =0 |
Get the precision of a given constant. More... | |
virtual String | GetConstantDefaultValue (UInt32 constantIndex) const =0 |
Get the default value of a given constant as a string. More... | |
virtual String | GetConstantName (UInt32 constantIndex) const =0 |
Get the name of a given constant. More... | |
virtual UInt32 | GetNumberOfConstantBuffers () const =0 |
Get the number of constant buffers used by the shader. More... | |
virtual SInt32 | GetConstantBufferIndex (const String &name) const =0 |
Get the index of a constant buffer with a given name. More... | |
virtual SInt32 | GetConstantBufferLocation (UInt32 constantBufferIndex) const =0 |
Get the location or register number of a given constant buffer. More... | |
virtual IEnums::ConstantBufferItem | GetConstantBufferItem (UInt32 constantBufferIndex) const =0 |
Get the predefined item of a given constant buffer. More... | |
virtual String | GetConstantBufferName (UInt32 constantBufferIndex) const =0 |
Get the primary variable name of a given constant buffer. More... | |
virtual UInt32 | GetNumberOfConstantBufferAlternativeNames (UInt32 constantBufferIndex) const =0 |
Get the number of alternative variable names of a given constant buffer. More... | |
virtual String | GetConstantBufferAlternativeName (UInt32 constantBufferIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative variable name of a given constant buffer. More... | |
virtual UInt32 | GetNumberOfConstantBufferUniforms (UInt32 constantBufferIndex) const =0 |
Get the number of uniform variables present in a given constant buffer. More... | |
virtual SInt32 | GetConstantBufferUniformIndex (UInt32 constantBufferIndex, UInt32 uniformIndex) const =0 |
Get the global index of a uniform in a given constant buffer at a given index. More... | |
virtual UInt32 | GetNumberOfUniforms () const =0 |
Get the number of uniform variables used by the shader. More... | |
virtual SInt32 | GetUniformIndex (const String &name) const =0 |
Get the index of a uniform with a given name. More... | |
virtual SInt32 | GetUniformLocation (UInt32 uniformIndex) const =0 |
Get the location, register number or constant buffer offset of a given uniform. More... | |
virtual SInt32 | GetUniformConstantBufferIndex (UInt32 uniformIndex) const =0 |
Get the index of the constant buffer the uniform belongs to. More... | |
virtual IEnums::UniformItem | GetUniformItem (UInt32 uniformIndex) const =0 |
Get the predefined item of a given uniform. More... | |
virtual IEnums::UniformType | GetUniformType (UInt32 uniformIndex) const =0 |
Get the data type of a given uniform. More... | |
virtual IEnums::ShaderVariablePrecision | GetUniformPrecision (UInt32 uniformIndex) const =0 |
Get the variable precision of a given uniform. More... | |
virtual UInt32 | GetUniformArraySize (UInt32 uniformIndex) const =0 |
Get the array size of a given uniform. More... | |
virtual String | GetUniformDefaultValue (UInt32 uniformIndex) const =0 |
Get the default value of a given uniform as a string. More... | |
virtual String | GetUniformName (UInt32 uniformIndex) const =0 |
Get the primary variable name of a given uniform. More... | |
virtual UInt32 | GetNumberOfUniformAlternativeNames (UInt32 uniformIndex) const =0 |
Get the number of alternative variable names of a given uniform. More... | |
virtual String | GetUniformAlternativeName (UInt32 uniformIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative variable name of a given uniform. More... | |
virtual UInt32 | GetNumberOfAttributes () const =0 |
Get the number of attribute variables used by the shader. More... | |
virtual SInt32 | GetAttributeIndex (const String &name) const =0 |
Get the index of an attribute with a given name. More... | |
virtual SInt32 | GetAttributeLocation (UInt32 attributeIndex) const =0 |
Get the location or register number of a given attribute. More... | |
virtual IEnums::AttributeItem | GetAttributeItem (UInt32 attributeIndex) const =0 |
Get the predefined item of a given attribute. More... | |
virtual IEnums::AttributeType | GetAttributeType (UInt32 attributeIndex) const =0 |
Get the data type of a given attribute. More... | |
virtual IEnums::ShaderVariablePrecision | GetAttributePrecision (UInt32 attributeIndex) const =0 |
Get the variable precision of a given attribute. More... | |
virtual String | GetAttributeName (UInt32 attributeIndex) const =0 |
Get the primary variable name of a given attribute. More... | |
virtual UInt32 | GetNumberOfAttributeAlternativeNames (UInt32 attributeIndex) const =0 |
Get the number of alternative variable names of a given attribute. More... | |
virtual String | GetAttributeAlternativeName (UInt32 attributeIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative variable name of a given attribute. More... | |
virtual UInt32 | GetNumberOfVaryings () const =0 |
Get the number of varying variables used by the shader. More... | |
virtual SInt32 | GetVaryingIndex (const String &name) const =0 |
Get the index of a varying with a given name. More... | |
virtual SInt32 | GetVaryingLocation (UInt32 varyingIndex) const =0 |
Get the location or register number of a given varying variable. More... | |
virtual IEnums::VaryingType | GetVaryingType (UInt32 varyingIndex) const =0 |
Get the data type of a given varying variable. More... | |
virtual IEnums::ShaderVariablePrecision | GetVaryingPrecision (UInt32 varyingIndex) const =0 |
Get the variable precision of a given varying variable. More... | |
virtual String | GetVaryingName (UInt32 varyingIndex) const =0 |
Get the name of a given varying variable. More... | |
virtual UInt32 | GetNumberOfTextures () const =0 |
Get the number of texture (sampler) variables used by the shader. More... | |
virtual SInt32 | GetTextureIndex (const String &name) const =0 |
Get the index of a texture with a given name. More... | |
virtual SInt32 | GetTextureLocation (UInt32 textureIndex) const =0 |
Get the location or register number of a given texture sampler. More... | |
virtual IEnums::TextureType | GetTextureType (UInt32 textureIndex) const =0 |
Get the data type of a given texture sampler. More... | |
virtual IEnums::TextureFlagMask | GetTextureFlags (UInt32 textureIndex) const =0 |
Get additional flags of a given texture sampler. More... | |
virtual IEnums::ShaderVariablePrecision | GetTexturePrecision (UInt32 textureIndex) const =0 |
Get the variable precision of a given texture sampler. More... | |
virtual IEnums::TextureSemantic | GetTextureSemantic (UInt32 textureIndex, IEnums::ColorComponent colorComponent) const =0 |
Get the semantic of a given texture sampler for a given color channel. More... | |
virtual UInt32 | GetTextureSemanticIndex (UInt32 textureIndex, IEnums::ColorComponent colorComponent) const =0 |
Get the semantic index of a given texture sampler for a given color channel. More... | |
virtual Float | GetTextureDefaultValue (UInt32 textureIndex, IEnums::ColorComponent colorComponent) const =0 |
Get the default value of a given texture sampler for a given color channel. More... | |
virtual String | GetTextureName (UInt32 textureIndex) const =0 |
Get the primary variable name of a given texture sampler. More... | |
virtual UInt32 | GetNumberOfTextureAlternativeNames (UInt32 textureIndex) const =0 |
Get the number of alternative variable names of a given texture sampler. More... | |
virtual String | GetTextureAlternativeName (UInt32 textureIndex, UInt32 alternativeNameIndex) const =0 |
Get an alternative variable name of a given texture sampler. More... | |
|
pure virtual |
Get the mutable Resource::IObject interface.
|
pure virtual |
Get the constant Resource::IObject interface.
|
pure virtual |
Get the number of individual shader chunks.
Get the sub-shader at a given index.
shaderIndex | The index of the shader, from 0 to GetNumberOfShaders()-1. |
|
pure virtual |
Get the sub-shader at a given index.
shaderIndex | The index of the shader, from 0 to GetNumberOfShaders()-1. |
|
pure virtual |
Get the index of a sub-shader via a given type and language.
If the resource does not contain a shader matching the given type and language, -1 is returned.
type | The shader type to query. |
language | The shader language to query. |
|
pure virtual |
Get the shader type.
|
pure virtual |
Get the actual output shader language.
|
pure virtual |
Get the input shader language this shader was translated from.
|
pure virtual |
Get the raw shader code data.
This method returns the actual shader data that are passed to the video API. In case of OpenGL(ES), this represents a (possibly optimized) piece of GLSL source code. For DirectX, the data are present in binary form.
|
pure virtual |
Get the unoptimized shader source code, if present.
This method returns a string containing the whole source code of the shader including prefix, definitions and actual code, before it is optimized and compiled. An empty string is a valid return value, which indicates that the original source code is not available.
|
pure virtual |
Get the compiler log output of the unoptimized shader source code, if present.
|
pure virtual |
Get the variable definitions of the unoptimized shader source code, if present.
This method returns only the variable definition section of the unoptimized code. Use GetUnoptimizedSource() to get the full source.
|
pure virtual |
Get the prefix(es) of the unoptimized shader source code, if present.
This method returns only the prefix of the unoptimized code. Use GetUnoptimizedSource() to get the full source.
|
pure virtual |
Get the code section(s) of the unoptimized shader source code, if present.
This method returns only the actual code section of the unoptimized code. Use GetUnoptimizedSource() to get the full source.
|
pure virtual |
Get the optimized shader source code, if present.
This method returns a string containing the optimized source code of the including prefix, definitions and actual code. An empty string is a valid return value, which indicates that the original source is not available.
|
pure virtual |
Get the compiler log output of the optimized shader source code, if present.
|
pure virtual |
Get the variable definitions of the optimized shader source code, if present.
This method returns only the variable definition section of the optimized code. Use GetOptimizedSource() to get the full source.
|
pure virtual |
Get the prefix(es) of the optimized shader source code, if present.
This method returns only the prefix of the optimized code. Use GetOptimizedSource() to get the full source.
|
pure virtual |
Get the code section(s) of the optimized shader source code, if present.
This method returns only the actual code section of the optimized code. Use GetOptimizedSource() to get the full source.
|
pure virtual |
Get the number of constants used by the shader.
Get the index of a constant with a given name.
name | The name to query. |
|
pure virtual |
Get the data type of a given constant.
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
|
pure virtual |
Get the precision of a given constant.
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
|
pure virtual |
Get the default value of a given constant as a string.
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
Get the name of a given constant.
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
|
pure virtual |
Get the number of constant buffers used by the shader.
|
pure virtual |
Get the index of a constant buffer with a given name.
name | The name to query. |
|
pure virtual |
Get the location or register number of a given constant buffer.
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get the predefined item of a given constant buffer.
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get the primary variable name of a given constant buffer.
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get the number of alternative variable names of a given constant buffer.
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get an alternative variable name of a given constant buffer.
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfConstantBufferAlternativeNames()-1. |
|
pure virtual |
Get the number of uniform variables present in a given constant buffer.
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
|
pure virtual |
Get the global index of a uniform in a given constant buffer at a given index.
constantBufferIndex | The constant buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
uniformIndex | The local uniform index, from 0 to GetNumberOfConstantBufferUniforms(constantBufferIndex)-1. |
|
pure virtual |
Get the number of uniform variables used by the shader.
Get the index of a uniform with a given name.
name | The name to query. |
|
pure virtual |
Get the location, register number or constant buffer offset of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the index of the constant buffer the uniform belongs to.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the predefined item of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the data type of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the variable precision of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the array size of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the default value of a given uniform as a string.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the primary variable name of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get the number of alternative variable names of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
|
pure virtual |
Get an alternative variable name of a given uniform.
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfUniformAlternativeNames()-1. |
|
pure virtual |
Get the number of attribute variables used by the shader.
Get the index of an attribute with a given name.
name | The name to query. |
|
pure virtual |
Get the location or register number of a given attribute.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the predefined item of a given attribute.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the data type of a given attribute.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the variable precision of a given attribute.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the primary variable name of a given attribute.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get the number of alternative variable names of a given attribute.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
|
pure virtual |
Get an alternative variable name of a given attribute.
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfAttributeAlternativeNames()-1. |
|
pure virtual |
Get the number of varying variables used by the shader.
Get the index of a varying with a given name.
name | The name to query. |
|
pure virtual |
Get the location or register number of a given varying variable.
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
|
pure virtual |
Get the data type of a given varying variable.
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
|
pure virtual |
Get the variable precision of a given varying variable.
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
Get the name of a given varying variable.
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
|
pure virtual |
Get the number of texture (sampler) variables used by the shader.
Get the index of a texture with a given name.
name | The name to query. |
|
pure virtual |
Get the location or register number of a given texture sampler.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get the data type of a given texture sampler.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get additional flags of a given texture sampler.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get the variable precision of a given texture sampler.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get the semantic of a given texture sampler for a given color channel.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
|
pure virtual |
Get the semantic index of a given texture sampler for a given color channel.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
|
pure virtual |
Get the default value of a given texture sampler for a given color channel.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
Get the primary variable name of a given texture sampler.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get the number of alternative variable names of a given texture sampler.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
|
pure virtual |
Get an alternative variable name of a given texture sampler.
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfTextureAlternativeNames()-1. |