Home -> IShaderProgram

Declaration

class IShaderProgram;

Description

The IShaderProgram interface represents a set of shader programs for graphics rendering. Code for individual shader stages are loaded into this object and compiled. Once this process is complete, the shader program is able to be attached to an IProgramNode in the render tree. After compilation, it is also possible to retrieve IDs for the various external elements that can be provided to the shader programs, such as vertex attributes and constant buffers.

Enumerations

Name Description
Public Enum ShaderStage
Identifies an individual shader state. This is used to specify the target shader stage when calling the LoadShaderStage method.
Public Enum CodeFormat
Identifies the type of a shader code blob. This is used when calling the LoadShaderStage method.

Structures

Name Description
Public Struct ShaderSourceInfoBase
Base structure for shader source and bytecode descriptions passed to LoadShaderStage.
Public Struct ShaderTargetInfoBase
Base structure for optional shader target configuration passed to ConfigureShaderTarget.

Members

Initialization methods

Name Description
Public member Delete
Schedules the object for deletion. After calling this method, the object will be destroyed after the current frame completes drawing.

Code format methods

Name Description
Public member IsCodeFormatSupported
Reports whether the specified code format is supported by the target renderer
Public member PreferredCodeFormat
Returns the preferred code format for the target renderer

Compilation methods

Name Description
Public member ConfigureShaderTarget
Sets optional configuration settings for the renderer to use when loading and compiling shader code.
Public member LoadShaderStage
Loads in code for the specified shader stage. The code is not compiled or validated until CompileProgram is called.
Public member CompileProgram
Attempts to compile the code supplied by the LoadShaderStage method. Prior to calling this method, the shader program cannot be bound to an IProgramNode, and no information about the shader program can be queried.

Shader input methods

Name Description
Public member VertexAttributeExists
Returns true if the specified vertex attribute exists
Public member StateValueExists
Returns true if the specified global state value exists
Public member TextureExists
Returns true if the specified texture resource exists
Public member SamplerExists
Returns true if the specified separate texture sampler
Public member StateBufferExists
Returns true if the specified state buffer exists
Public member ResourceArrayExists
Returns true if the specified resource array exists
Public member GetVertexAttributeId
Retrieves the ID of the specified vertex attribute, or VertexAttributeId::Null if the attribute could not be found.
Public member GetStateValueId
Retrieves the ID of the specified shader state variable, or StateValueId::Null if the variable could not be found.
Public member GetTextureId
Retrieves the ID of the specified texture input, or TextureId::Null if the texture input could not be found.
Public member GetSamplerId
Retrieves the ID of the specified separate texture sampler, or SamplerId::Null if the sampler could not be found.
Public member GetStateBufferId
Retrieves the ID of the specified state buffer, or StateBufferId::Null if the buffer could not be found.
Public member GetResourceArrayId
Retrieves the ID of the specified resource array (ITexelArray or IDataArray), or ResourceArrayId::Null if the resource could not be found.

State buffer methods

Name Description
Public member LoadStateBufferLayoutFromShader
Attempts to load the layout of the specified state buffer into an IStateBufferLayout

See also