LiteFX::Rendering::IShaderProgram
The interface for a shader program.
Synopsis
Declared in <litefx/rendering_api.hpp>
class [[dllimport, dllexport]] IShaderProgram
: public SharedObject
Description
A shader program differs in it's functionality as well as the contained shader modules, depending on the pipeline type it gets assigned to. A shader program can be of any of the following types:
- Rasterization: A rasterization pipeline is a traditional pipeline, that can contain at maximum one module of the following stages: Vertex, Tessellation Control, Tessellation Evaluation, Geometry, Fragment. A vertex and fragment shader are required for rasterization programs.
- Mesh shading: If mesh shader support is enabled (through the device feature
GraphicsDeviceFeatures::MeshShaders), a mesh shading program can contain at maximum one module of the following stages: Task, Mesh, Fragment. A mesh and fragment shader are required for a mesh shading program.
- Compute: A compute shader program must only contain a single module for the Compute stage.
- Ray-tracing: If ray tracing support is enabled (through the device feature
GraphicsDeviceFeatures::RayTracing), a ray tracing program can contain modules of the following stages: Ray Generation, Any Hit, Closest Hit, Intersection, Miss, Callable. There must be exactly one Ray Generation module. All other modules can occur multiple times. To build a ray tracing pipeline, all shaders should be added to a single shader program, which is then passed to the pipeline during creation.
Shaders from different program types must not be mixed. For example, it is not valid to add a compute module to a rasterization program. The only exception to this is the ShaderStage::Fragment module, which can be added to a mesh pipeline, as well as a rasterization pipeline.
Base Classes
| Name | Description |
SharedObject | Base class for an object that can be shared. |
Type Aliases
Member Functions
Protected Types
| Name | Description |
Allocator | An allocator used to allocate the shared object. |
Protected Member Functions
Protected Static Member Functions
| Name | Description |
create | Generic factory method used to create instances of the shared object. |
Derived Classes
See Also
https://github.com/crud89/LiteFX/wiki/Shader-Development