LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::IBarrier Class Referenceabstract

The interface for a memory barrier. More...

#include <rendering_api.hpp>

Inherited by LiteFX::Rendering::Barrier< IDirectX12Buffer, IDirectX12Image >, LiteFX::Rendering::Barrier< IVulkanBuffer, IVulkanImage >, and LiteFX::Rendering::Barrier< TBuffer, TImage >.

Public Member Functions

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

The interface for a memory barrier.

Constructor & Destructor Documentation

◆ ~IBarrier()

virtual LiteFX::Rendering::IBarrier::~IBarrier ( )
virtualdefaultnoexcept

Member Function Documentation

◆ transition() [1/8]

void LiteFX::Rendering::IBarrier::transition ( IBuffer buffer,
const ResourceState &  sourceState,
const ResourceState &  targetState 
)
inline

Inserts a transition for all sub-resources of buffer from sourceState into targetState .

Parameters
bufferThe resource to transition.
sourceStateThe source state to transition the resource from.
targetStateThe target state to transition the resource to.

◆ transition() [2/8]

void LiteFX::Rendering::IBarrier::transition ( IBuffer buffer,
const ResourceState &  sourceState,
const UInt32 element,
const ResourceState &  targetState 
)
inline

Inserts a transition for the sub-resource element of buffer from sourceState into targetState .

Parameters
bufferThe resource to transition.
sourceStateThe source state to transition the sub-resource from.
elementThe element of the resource to transition.
targetStateThe target state to transition the sub-resource to.

◆ transition() [3/8]

void LiteFX::Rendering::IBarrier::transition ( IBuffer buffer,
const ResourceState &  targetState 
)
inline

Inserts a transition for all sub-resources of buffer into targetState .

Parameters
bufferThe resource to transition.
targetStateThe target state to transition the resource to.

◆ transition() [4/8]

void LiteFX::Rendering::IBarrier::transition ( IBuffer buffer,
const UInt32 element,
const ResourceState &  targetState 
)
inline

Inserts a transition for the sub-resource element of buffer into targetState .

Parameters
bufferThe resource to transition.
elementThe element of the resource to transition.
targetStateThe target state to transition the sub-resource to.

◆ transition() [5/8]

void LiteFX::Rendering::IBarrier::transition ( IImage image,
const ResourceState &  sourceState,
const ResourceState &  targetState 
)
inline

Inserts a transition for all sub-resources of image from sourceState into targetState .

Parameters
imageThe resource to transition.
sourceStateThe source state to transition the resource from.
targetStateThe target state to transition the resource to.

◆ transition() [6/8]

void LiteFX::Rendering::IBarrier::transition ( IImage image,
const ResourceState &  sourceState,
const UInt32 level,
const UInt32 layer,
const UInt32 plane,
const ResourceState &  targetState 
)
inline

Inserts a transition for a sub-resource of image from sourceState into targetState .

Parameters
imageThe resource to transition.
sourceStateThe source state to transition the sub-resource from.
levelThe mip-map level of the sub-resource.
layerThe array layer of the sub-resource.
planeThe plane of the sub-resource.
targetStateThe target state to transition the sub-resource to.

◆ transition() [7/8]

void LiteFX::Rendering::IBarrier::transition ( IImage image,
const ResourceState &  targetState 
)
inline

Inserts a transition for all sub-resources of image into targetState .

Parameters
imageThe resource to transition.
targetStateThe target state to transition the resource to.

◆ transition() [8/8]

void LiteFX::Rendering::IBarrier::transition ( IImage image,
const UInt32 level,
const UInt32 layer,
const UInt32 plane,
const ResourceState &  targetState 
)
inline

Inserts a transition for a sub-resource of image into targetState .

Parameters
imageThe resource to transition.
levelThe mip-map level of the sub-resource.
layerThe array layer of the sub-resource.
planeThe plane of the sub-resource.
targetStateThe target state to transition the sub-resource to.

◆ waitFor() [1/2]

void LiteFX::Rendering::IBarrier::waitFor ( const IBuffer buffer)
inline

Inserts a barrier that waits for all read/write accesses to buffer to be finished before continuing.

This translates to a UAV barrier in DirectX 12 and an execution + memory barrier with no layout transition in Vulkan.

Template Parameters
bufferThe buffer to wait for.

◆ waitFor() [2/2]

void LiteFX::Rendering::IBarrier::waitFor ( const IImage image)
inline

Inserts a barrier that waits for all read/write accesses to image to be finished before continuing.

This translates to a UAV barrier in DirectX 12 and an execution + memory barrier with no layout transition in Vulkan.

Template Parameters
imageThe image to wait for.