Represents a single shader module, i.e. a part of a IShaderProgram.
More...
#include <rendering_api.hpp>
Inherited by LiteFX::Rendering::Backends::DirectX12ShaderModule, and LiteFX::Rendering::Backends::VulkanShaderModule.
Represents a single shader module, i.e. a part of a IShaderProgram.
A shader module corresponds to a single shader source file.
◆ IShaderModule() [1/3]
LiteFX::Rendering::IShaderModule::IShaderModule |
( |
| ) |
|
|
protecteddefaultnoexcept |
◆ IShaderModule() [2/3]
LiteFX::Rendering::IShaderModule::IShaderModule |
( |
const IShaderModule & | | ) |
|
|
protecteddefault |
◆ IShaderModule() [3/3]
LiteFX::Rendering::IShaderModule::IShaderModule |
( |
IShaderModule && | | ) |
|
|
protecteddefaultnoexcept |
◆ ~IShaderModule()
virtual LiteFX::Rendering::IShaderModule::~IShaderModule |
( |
| ) |
|
|
virtualdefaultnoexcept |
◆ entryPoint()
virtual const String & LiteFX::Rendering::IShaderModule::entryPoint |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ fileName()
virtual const String & LiteFX::Rendering::IShaderModule::fileName |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ shaderLocalDescriptor()
For ray-tracing shader modules returns the binding point for the descriptor that receives shader-local data.
Ray-tracing shaders, especially hit and intersection shaders may rely on local per-invocation data to handle ray intersections. One prominent example of such data is a custom index that identifies the geometry within the instance that has been hit, which can then be used to index into bindless arrays to acquire additional data, such as material properties or texture maps. This data is placed alongside the shader binding table created from a ShaderRecordCollection and passed to the shader when it is invoked. However, when building the IPipelineLayout for a ray-tracing pipeline, the device needs to know which descriptors bind globally and which descriptor binds locally. This information currently cannot be reliably acquired by shader reflection and must thus be specified on a per-module basis.
Note that it is only possible for one descriptor to bind to local data. However, this descriptor can bind a constant/uniform buffer that contains multiple variables. Whilst it is possible to bind buffer references (using IDeviceMemory::virtualAddress), support for it is differs depending on the shader language. To keep shaders portable, it is recommended to use descriptor indexing to bind buffers and textures and only pass constant values into local descriptor bindings.
For shader modules of types other than ray-tracing, this setting is ignored.
- Returns
- Returns the binding point for the descriptor that receives shader-local data.
- See also
- ShaderRecord<<typename TLocalData>>
Implemented in LiteFX::Rendering::Backends::DirectX12ShaderModule, and LiteFX::Rendering::Backends::VulkanShaderModule.
◆ type()
virtual ShaderStage LiteFX::Rendering::IShaderModule::type |
( |
| ) |
const |
|
pure virtualnoexcept |