LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::IRayTracingPipeline Class Referenceabstract

The interface for a ray tracing pipeline. More...

#include <rendering_api.hpp>

Inherits LiteFX::Rendering::IPipeline.

Inherited by LiteFX::Rendering::RayTracingPipeline< DirectX12PipelineLayout, DirectX12ShaderProgram >, LiteFX::Rendering::RayTracingPipeline< VulkanPipelineLayout, VulkanShaderProgram >, and LiteFX::Rendering::RayTracingPipeline< TPipelineLayout, TShaderProgram >.

Public Member Functions

 ~IRayTracingPipeline () noexcept override=default
 
virtual const ShaderRecordCollectionshaderRecords () const noexcept=0
 Returns the shader record collection of the ray tracing pipeline.
 
virtual UInt32 maxRecursionDepth () const noexcept=0
 Returns the maximum number of ray bounces.
 
virtual UInt32 maxPayloadSize () const noexcept=0
 Returns the maximum size of a single ray payload.
 
virtual UInt32 maxAttributeSize () const noexcept=0
 Returns the maximum size of a single ray attribute.
 
SharedPtr< IBufferallocateShaderBindingTable (ShaderBindingTableOffsets &offsets, ShaderBindingGroup groups=ShaderBindingGroup::All) const
 Allocates a buffer that contains the shader binding table containing the shader groups specified by the groups parameter.
 
- Public Member Functions inherited from LiteFX::Rendering::IPipeline
 ~IPipeline () noexcept override=default
 
SharedPtr< const IShaderProgramprogram () const noexcept
 Returns the shader program used by the pipeline.
 
SharedPtr< const IPipelineLayoutlayout () const noexcept
 Returns the layout of the render pipeline.
 
- Public Member Functions inherited from LiteFX::Rendering::IStateResource
virtual ~IStateResource () noexcept=default
 Releases the state resource instance.
 
virtual const Stringname () const noexcept=0
 Returns the name of the resource.
 

Protected Member Functions

 IRayTracingPipeline () noexcept=default
 
 IRayTracingPipeline (IRayTracingPipeline &&) noexcept=default
 
 IRayTracingPipeline (const IRayTracingPipeline &)=delete
 
IRayTracingPipelineoperator= (IRayTracingPipeline &&) noexcept=default
 
IRayTracingPipelineoperator= (const IRayTracingPipeline &)=delete
 
- Protected Member Functions inherited from LiteFX::Rendering::IPipeline
 IPipeline () noexcept=default
 
 IPipeline (const IPipeline &)=delete
 
 IPipeline (IPipeline &&) noexcept=default
 
IPipelineoperator= (const IPipeline &)=delete
 
IPipelineoperator= (IPipeline &&) noexcept=default
 
- Protected Member Functions inherited from LiteFX::Rendering::IStateResource
 IStateResource () noexcept=default
 
 IStateResource (const IStateResource &)=delete
 
 IStateResource (IStateResource &&) noexcept=default
 
IStateResourceoperator= (const IStateResource &)=delete
 
IStateResourceoperator= (IStateResource &&) noexcept=default
 

Detailed Description

The interface for a ray tracing pipeline.

Constructor & Destructor Documentation

◆ IRayTracingPipeline() [1/3]

LiteFX::Rendering::IRayTracingPipeline::IRayTracingPipeline ( )
protecteddefaultnoexcept

◆ IRayTracingPipeline() [2/3]

LiteFX::Rendering::IRayTracingPipeline::IRayTracingPipeline ( IRayTracingPipeline && )
protecteddefaultnoexcept

◆ IRayTracingPipeline() [3/3]

LiteFX::Rendering::IRayTracingPipeline::IRayTracingPipeline ( const IRayTracingPipeline & )
protecteddelete

◆ ~IRayTracingPipeline()

LiteFX::Rendering::IRayTracingPipeline::~IRayTracingPipeline ( )
overridedefaultnoexcept

Member Function Documentation

◆ allocateShaderBindingTable()

SharedPtr< IBuffer > LiteFX::Rendering::IRayTracingPipeline::allocateShaderBindingTable ( ShaderBindingTableOffsets & offsets,
ShaderBindingGroup groups = ShaderBindingGroup::All ) const
inline

Allocates a buffer that contains the shader binding table containing the shader groups specified by the groups parameter.

The shader binding table consists out of individual shader records, where each record refers to a shader record plus its local data, as specified in the shader record collection that was passed to the ray-tracing pipeline during creation. The size of a record within the shader binding table is determined by the largest local data size of all records of the groups to be included. It makes sense to pack multiple records into the same buffer for efficiency, however it may generally be a good idea to separate groups that require large amount of local shader data into their own buffers to keep the other buffers smaller.

The shader binding table is created on the default resource heap (ResourceHeap::Dynamic). However, for best performance, consider transferring it to a buffer on the GPU resource heap (ResourceHeap::Resource) afterwards.

Parameters
offsetsA reference to a structure that receives the offsets and sizes to the groups within the shader binding table.
groupsThe groups to include into the shader binding table.
Returns
The buffer that stores the shader binding table.

◆ maxAttributeSize()

virtual UInt32 LiteFX::Rendering::IRayTracingPipeline::maxAttributeSize ( ) const
pure virtualnoexcept

Returns the maximum size of a single ray attribute.

A ray attribute is the data that is passed to a hit shader for a specific event. Different to ray payloads, it only contains the data that describe the event (such as the hit coordinates, etc.).

This property can currently not be queried from reflection.

Returns

Implemented in LiteFX::Rendering::Backends::DirectX12RayTracingPipeline, and LiteFX::Rendering::Backends::VulkanRayTracingPipeline.

◆ maxPayloadSize()

virtual UInt32 LiteFX::Rendering::IRayTracingPipeline::maxPayloadSize ( ) const
pure virtualnoexcept

Returns the maximum size of a single ray payload.

A ray payload is the data that is passed down the TraceRay function call chain. It can be zero, if Ray Payload Qualifiers are used. Otherwise it must be set to the largest ray payload size used in the ray-tracing pipeline.

This property can currently not be queried from reflection.

Returns
The maximum size of a single ray payload.

Implemented in LiteFX::Rendering::Backends::DirectX12RayTracingPipeline, and LiteFX::Rendering::Backends::VulkanRayTracingPipeline.

◆ maxRecursionDepth()

virtual UInt32 LiteFX::Rendering::IRayTracingPipeline::maxRecursionDepth ( ) const
pure virtualnoexcept

Returns the maximum number of ray bounces.

Returns
The shader record collection of the ray tracing pipeline.

Implemented in LiteFX::Rendering::Backends::DirectX12RayTracingPipeline, and LiteFX::Rendering::Backends::VulkanRayTracingPipeline.

◆ operator=() [1/2]

IRayTracingPipeline & LiteFX::Rendering::IRayTracingPipeline::operator= ( const IRayTracingPipeline & )
protecteddelete

◆ operator=() [2/2]

IRayTracingPipeline & LiteFX::Rendering::IRayTracingPipeline::operator= ( IRayTracingPipeline && )
protecteddefaultnoexcept

◆ shaderRecords()

virtual const ShaderRecordCollection & LiteFX::Rendering::IRayTracingPipeline::shaderRecords ( ) const
pure virtualnoexcept

Returns the shader record collection of the ray tracing pipeline.

Returns
The shader record collection of the ray tracing pipeline.

Implemented in LiteFX::Rendering::Backends::DirectX12RayTracingPipeline, and LiteFX::Rendering::Backends::VulkanRayTracingPipeline.