LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::Barrier< TBuffer, TImage > Class Template Referenceabstract

A barrier that transitions a set of resources backed by IDeviceMemory into different ResourceState. More...

#include <rendering.hpp>

Inherits LiteFX::Rendering::IBarrier.

Public Types

using buffer_type = TBuffer
 
using image_type = TImage
 

Public Member Functions

virtual ~Barrier () noexcept=default
 
virtual void transition (buffer_type &buffer, const ResourceState &targetState)=0
 
virtual void transition (buffer_type &buffer, const UInt32 &element, const ResourceState &targetState)=0
 
virtual void transition (buffer_type &buffer, const ResourceState &sourceState, const ResourceState &targetState)=0
 
virtual void transition (buffer_type &buffer, const ResourceState &sourceState, const UInt32 &element, const ResourceState &targetState)=0
 
virtual void transition (image_type &image, const ResourceState &targetState)=0
 
virtual void transition (image_type &image, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState)=0
 
virtual void transition (image_type &image, const ResourceState &sourceState, const ResourceState &targetState)=0
 
virtual void transition (image_type &image, const ResourceState &sourceState, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState)=0
 
virtual void waitFor (const buffer_type &buffer)=0
 
virtual void waitFor (const image_type &image)=0
 
- Public Member Functions inherited from LiteFX::Rendering::IBarrier
virtual ~IBarrier () noexcept=default
 
void transition (IBuffer &buffer, const ResourceState &targetState)
 Inserts a transition for all sub-resources of buffer into targetState . More...
 
void transition (IBuffer &buffer, const UInt32 &element, const ResourceState &targetState)
 Inserts a transition for the sub-resource element of buffer into targetState . More...
 
void transition (IBuffer &buffer, const ResourceState &sourceState, const ResourceState &targetState)
 Inserts a transition for all sub-resources of buffer from sourceState into targetState . More...
 
void transition (IBuffer &buffer, const ResourceState &sourceState, const UInt32 &element, const ResourceState &targetState)
 Inserts a transition for the sub-resource element of buffer from sourceState into targetState . More...
 
void transition (IImage &image, const ResourceState &targetState)
 Inserts a transition for all sub-resources of image into targetState . More...
 
void transition (IImage &image, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState)
 Inserts a transition for a sub-resource of image into targetState . More...
 
void transition (IImage &image, const ResourceState &sourceState, const ResourceState &targetState)
 Inserts a transition for all sub-resources of image from sourceState into targetState . More...
 
void transition (IImage &image, const ResourceState &sourceState, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState)
 Inserts a transition for a sub-resource of image from sourceState into targetState . More...
 
void waitFor (const IBuffer &buffer)
 Inserts a barrier that waits for all read/write accesses to buffer to be finished before continuing. More...
 
void waitFor (const IImage &image)
 Inserts a barrier that waits for all read/write accesses to image to be finished before continuing. More...
 

Detailed Description

template<typename TBuffer, typename TImage>
requires std::derived_from<TBuffer, IBuffer> && std::derived_from<TImage, IImage>
class LiteFX::Rendering::Barrier< TBuffer, TImage >

A barrier that transitions a set of resources backed by IDeviceMemory into different ResourceState.

It is recommended to insert multiple transitions into one single barrier. This can be done by calling transition multiple times.

Member Typedef Documentation

◆ buffer_type

template<typename TBuffer , typename TImage >
using LiteFX::Rendering::Barrier< TBuffer, TImage >::buffer_type = TBuffer

◆ image_type

template<typename TBuffer , typename TImage >
using LiteFX::Rendering::Barrier< TBuffer, TImage >::image_type = TImage

Constructor & Destructor Documentation

◆ ~Barrier()

template<typename TBuffer , typename TImage >
virtual LiteFX::Rendering::Barrier< TBuffer, TImage >::~Barrier ( )
virtualdefaultnoexcept

Member Function Documentation

◆ transition() [1/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( buffer_type buffer,
const ResourceState &  sourceState,
const ResourceState &  targetState 
)
pure virtual

◆ transition() [2/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( buffer_type buffer,
const ResourceState &  sourceState,
const UInt32 element,
const ResourceState &  targetState 
)
pure virtual

◆ transition() [3/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( buffer_type buffer,
const ResourceState &  targetState 
)
pure virtual

◆ transition() [4/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( buffer_type buffer,
const UInt32 element,
const ResourceState &  targetState 
)
pure virtual

◆ transition() [5/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( image_type image,
const ResourceState &  sourceState,
const ResourceState &  targetState 
)
pure virtual

◆ transition() [6/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( image_type image,
const ResourceState &  sourceState,
const UInt32 level,
const UInt32 layer,
const UInt32 plane,
const ResourceState &  targetState 
)
pure virtual

◆ transition() [7/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( image_type image,
const ResourceState &  targetState 
)
pure virtual

◆ transition() [8/8]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::transition ( image_type image,
const UInt32 level,
const UInt32 layer,
const UInt32 plane,
const ResourceState &  targetState 
)
pure virtual

◆ waitFor() [1/2]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::waitFor ( const buffer_type buffer)
pure virtual

◆ waitFor() [2/2]

template<typename TBuffer , typename TImage >
virtual void LiteFX::Rendering::Barrier< TBuffer, TImage >::waitFor ( const image_type image)
pure virtual