LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::Backends::DirectX12Barrier Class Reference

Implements a DirectX 12 resource barrier. More...

#include <dx12.hpp>

Inherits LiteFX::Rendering::Barrier< IDirectX12Buffer, IDirectX12Image >.

Classes

class  DirectX12BarrierImpl
 

Public Member Functions

 DirectX12Barrier () noexcept
 
 DirectX12Barrier (const DirectX12Barrier &)=delete
 
 DirectX12Barrier (DirectX12Barrier &&)=delete
 
virtual ~DirectX12Barrier () noexcept
 
virtual void transition (IDirectX12Buffer &buffer, const ResourceState &targetState) override
 
virtual void transition (IDirectX12Buffer &buffer, const UInt32 &element, const ResourceState &targetState) override
 
virtual void transition (IDirectX12Buffer &buffer, const ResourceState &sourceState, const ResourceState &targetState) override
 
virtual void transition (IDirectX12Buffer &buffer, const ResourceState &sourceState, const UInt32 &element, const ResourceState &targetState) override
 
virtual void transition (IDirectX12Image &image, const ResourceState &targetState) override
 
virtual void transition (IDirectX12Image &image, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState) override
 
virtual void transition (IDirectX12Image &image, const ResourceState &sourceState, const ResourceState &targetState) override
 
virtual void transition (IDirectX12Image &image, const ResourceState &sourceState, const UInt32 &level, const UInt32 &layer, const UInt32 &plane, const ResourceState &targetState) override
 
virtual void waitFor (const IDirectX12Buffer &buffer) override
 
virtual void waitFor (const IDirectX12Image &image) override
 
virtual void execute (const DirectX12CommandBuffer &commandBuffer, const D3D12_RESOURCE_BARRIER_FLAGS &flags=D3D12_RESOURCE_BARRIER_FLAG_NONE) const noexcept
 Adds the barrier to a command buffer and updates the resource target states. More...
 
virtual void executeInverse (const DirectX12CommandBuffer &commandBuffer, const D3D12_RESOURCE_BARRIER_FLAGS &flags=D3D12_RESOURCE_BARRIER_FLAG_NONE) const noexcept
 Adds the inverse barriers to a command buffers and updates the resource target states. More...
 
- Public Member Functions inherited from LiteFX::Rendering::Barrier< IDirectX12Buffer, IDirectX12Image >
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...
 

Additional Inherited Members

- Public Types inherited from LiteFX::Rendering::Barrier< IDirectX12Buffer, IDirectX12Image >
using buffer_type = IDirectX12Buffer
 
using image_type = IDirectX12Image
 

Detailed Description

Implements a DirectX 12 resource barrier.

See also
DirectX12CommandBuffer, IDirectX12Buffer, IDirectX12Image, Barrier

Constructor & Destructor Documentation

◆ DirectX12Barrier() [1/3]

DirectX12Barrier::DirectX12Barrier ( )
explicitnoexcept

◆ DirectX12Barrier() [2/3]

LiteFX::Rendering::Backends::DirectX12Barrier::DirectX12Barrier ( const DirectX12Barrier )
delete

◆ DirectX12Barrier() [3/3]

LiteFX::Rendering::Backends::DirectX12Barrier::DirectX12Barrier ( DirectX12Barrier &&  )
delete

◆ ~DirectX12Barrier()

DirectX12Barrier::~DirectX12Barrier ( )
virtualdefaultnoexcept

Member Function Documentation

◆ execute()

void DirectX12Barrier::execute ( const DirectX12CommandBuffer commandBuffer,
const D3D12_RESOURCE_BARRIER_FLAGS &  flags = D3D12_RESOURCE_BARRIER_FLAG_NONE 
) const
virtualnoexcept

Adds the barrier to a command buffer and updates the resource target states.

Parameters
commandBufferThe command buffer to add the barriers to.
flagsThe flags for the resource barriers. Can be used to begin and end split barriers.

◆ executeInverse()

void DirectX12Barrier::executeInverse ( const DirectX12CommandBuffer commandBuffer,
const D3D12_RESOURCE_BARRIER_FLAGS &  flags = D3D12_RESOURCE_BARRIER_FLAG_NONE 
) const
virtualnoexcept

Adds the inverse barriers to a command buffers and updates the resource target states.

This method can be used to quickly transition all resources back to the source state without requiring to record a new barrier. It performs the opposite transitions to the ones created with execute.

Parameters
commandBufferThe command buffer to add the barriers to.
flagsThe flags for the resource barriers. Can be used to begin and end split barriers.

◆ transition() [1/8]

void DirectX12Barrier::transition ( IDirectX12Buffer buffer,
const ResourceState &  sourceState,
const ResourceState &  targetState 
)
overridevirtual

◆ transition() [2/8]

void DirectX12Barrier::transition ( IDirectX12Buffer buffer,
const ResourceState &  sourceState,
const UInt32 element,
const ResourceState &  targetState 
)
overridevirtual

◆ transition() [3/8]

void DirectX12Barrier::transition ( IDirectX12Buffer buffer,
const ResourceState &  targetState 
)
overridevirtual

◆ transition() [4/8]

void DirectX12Barrier::transition ( IDirectX12Buffer buffer,
const UInt32 element,
const ResourceState &  targetState 
)
overridevirtual

◆ transition() [5/8]

void DirectX12Barrier::transition ( IDirectX12Image image,
const ResourceState &  sourceState,
const ResourceState &  targetState 
)
overridevirtual

◆ transition() [6/8]

void DirectX12Barrier::transition ( IDirectX12Image image,
const ResourceState &  sourceState,
const UInt32 level,
const UInt32 layer,
const UInt32 plane,
const ResourceState &  targetState 
)
overridevirtual

◆ transition() [7/8]

void DirectX12Barrier::transition ( IDirectX12Image image,
const ResourceState &  targetState 
)
overridevirtual

◆ transition() [8/8]

void DirectX12Barrier::transition ( IDirectX12Image image,
const UInt32 level,
const UInt32 layer,
const UInt32 plane,
const ResourceState &  targetState 
)
overridevirtual

◆ waitFor() [1/2]

void DirectX12Barrier::waitFor ( const IDirectX12Buffer buffer)
overridevirtual

◆ waitFor() [2/2]

void DirectX12Barrier::waitFor ( const IDirectX12Image image)
overridevirtual