The IShader graph node interface. More...

#include "murl_graph_i_shader.h"

Inheritance diagram for Murl::Graph::IShader:

Public Member Functions

virtual INodeGetNodeInterface ()=0
 Get the mutable Graph::INode interface. More...
 
virtual const INodeGetNodeInterface () const =0
 Get the constant Graph::INode interface. More...
 
virtual IShaderResourceTargetGetShaderResourceTarget ()=0
 Get a mutable Graph::IShaderResourceTarget container. More...
 
virtual const IShaderResourceTargetGetShaderResourceTarget () const =0
 Get a constant Graph::IShaderResourceTarget container. More...
 
virtual IShaderNodeTargetGetFallbackShaderNodeTarget ()=0
 Get the mutable Graph::IShader container storing an optional fallback shader. More...
 
virtual const IShaderNodeTargetGetFallbackShaderNodeTarget () const =0
 Get the constant Graph::IShader container storing an optional fallback shader. More...
 
virtual Bool SetSource (const String &source)=0
 Directly set the shader's source code from a given string. More...
 
virtual const StringGetSource () const =0
 Get the shader's source code, if it was explicitly set via SetSource(). 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 UInt32 GetNumberOfStages () const =0
 Get the shader's number of stages. More...
 
virtual Video::IShaderGetVideoShaderObject (UInt32 stage, IEnums::ShaderType type) const =0
 Get the shader's internal video renderer object for a given type. More...
 
virtual Bool IsValid (Bool checkFallbacks) const =0
 Check if the shader is valid. More...
 
virtual const StringGetCompilerLog () const =0
 Get the shader compiler log. More...
 

Detailed Description

The IShader graph node interface.

This interface represents a node that holds the source code for either a vertex shader or a fragment shader of a GPU program, or both. If the node is set to a single type (either vertex or fragment shader) and the selected video API allows for runtime shader compilation, the actual shader code may be set directly via SetSource(). Otherwise, a valid Resource::IShader object must be provided, which contains the necessary type(s) of shader data.

See Graph::IShaderProgram for attaching a shader to a program.

Member Function Documentation

◆ GetNodeInterface() [1/2]

virtual INode* Murl::Graph::IShader::GetNodeInterface ( )
pure virtual

Get the mutable Graph::INode interface.

This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.

Returns
The mutable Graph::INode interface, or null if not available

◆ GetNodeInterface() [2/2]

virtual const INode* Murl::Graph::IShader::GetNodeInterface ( ) const
pure virtual

Get the constant Graph::INode interface.

This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Returns
The constant Graph::INode interface, or null if not available

◆ GetShaderResourceTarget() [1/2]

virtual IShaderResourceTarget* Murl::Graph::IShader::GetShaderResourceTarget ( )
pure virtual

Get a mutable Graph::IShaderResourceTarget container.

This method returns a mutable pointer to a Graph::IShaderResourceTarget container, which allows to add, remove or query the shader resources referenced by a node implementing this interface.

Returns
The mutable Graph::IShaderResourceTarget container, or null if not available

◆ GetShaderResourceTarget() [2/2]

virtual const IShaderResourceTarget* Murl::Graph::IShader::GetShaderResourceTarget ( ) const
pure virtual

Get a constant Graph::IShaderResourceTarget container.

This method returns a constant pointer to a Graph::IShaderResourceTarget container, which allows to query the shader resources referenced by a node implementing this interface.

Returns
The constant Graph::IShaderResourceTarget container, or null if not available

◆ GetFallbackShaderNodeTarget() [1/2]

virtual IShaderNodeTarget* Murl::Graph::IShader::GetFallbackShaderNodeTarget ( )
pure virtual

Get the mutable Graph::IShader container storing an optional fallback shader.

This method returns a mutable pointer to the node's Graph::IShader container that stores an optional reference to another shader node that is used instead, if compilation of the shader object(s) failed.

Returns
The mutable Graph::IShader fallback container, or null if not available.

◆ GetFallbackShaderNodeTarget() [2/2]

virtual const IShaderNodeTarget* Murl::Graph::IShader::GetFallbackShaderNodeTarget ( ) const
pure virtual

Get the constant Graph::IShader container storing an optional fallback shader.

This method returns a constant pointer to the node's Graph::IShader container that stores an optional reference to another shader node that is used instead, if compilation of the shader object(s) failed.

Returns
The constant Graph::IShader fallback container, or null if not available.

◆ SetSource()

virtual Bool Murl::Graph::IShader::SetSource ( const String source)
pure virtual

Directly set the shader's source code from a given string.

Parameters
sourceThe shader source code.
Returns
true if successful.

◆ GetSource()

virtual const String& Murl::Graph::IShader::GetSource ( ) const
pure virtual

Get the shader's source code, if it was explicitly set via SetSource().

Returns
The shader source code.

◆ SetType()

virtual Bool Murl::Graph::IShader::SetType ( IEnums::ShaderType  type)
pure virtual

Set the shader type.

If set to IEnums::SHADER_TYPE_ALL, the given shader resource must contain both vertex and fragment shader data valid for the selected video API.

Parameters
typeThe shader type.
Returns
true if successful.

◆ GetType()

virtual IEnums::ShaderType Murl::Graph::IShader::GetType ( ) const
pure virtual

Get the shader type.

Returns
The shader type.

◆ GetNumberOfStages()

virtual UInt32 Murl::Graph::IShader::GetNumberOfStages ( ) const
pure virtual

Get the shader's number of stages.

Returns
The number of stages.

◆ GetVideoShaderObject()

virtual Video::IShader* Murl::Graph::IShader::GetVideoShaderObject ( UInt32  stage,
IEnums::ShaderType  type 
) const
pure virtual

Get the shader's internal video renderer object for a given type.

Parameters
stageThe stage to query.
typeThe shader type, either SHADER_TYPE_VERTEX or SHADER_TYPE_FRAGMENT.
Returns
The video renderer object.

◆ IsValid()

virtual Bool Murl::Graph::IShader::IsValid ( Bool  checkFallbacks) const
pure virtual

Check if the shader is valid.

If creation/compilation of the shader object fails, this method returns false.

Parameters
checkFallbacksIf false, only the current shader is considered. Otherwise, the method returns true if any of its fallback shaders is valid.
Returns
true if shader compilation succeeded during initialization.

◆ GetCompilerLog()

virtual const String& Murl::Graph::IShader::GetCompilerLog ( ) const
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_graph_i_shader.h


Copyright © 2011-2024 Spraylight GmbH.