ezEngine  Release 25.03
ezPipelineBarrierVulkan Class Reference

Public Member Functions

 ezPipelineBarrierVulkan (ezAllocator *pAllocator)
 
bool AddBufferBarrierInternal (vk::Buffer buffer, vk::DeviceSize offset, vk::DeviceSize length, vk::PipelineStageFlags srcStages, vk::AccessFlags srcAccess, vk::PipelineStageFlags dstStages, vk::AccessFlags dstAccess)
 
Barrier handling
void SetCommandBuffer (vk::CommandBuffer *pCommandBuffer)
 Set the active command buffer that barriers are flushed into.
 
void Flush ()
 Flush accumulated changes as a barrier into the active command buffer.
 
void Submit ()
 Should be called when the active command buffer is submitted. This clear various states as a submit works like a full barrier.
 
void FullBarrier ()
 Full barrier for debugging purposes.
 
bool IsDirty () const
 
Buffer handling
void BufferDestroyed (const ezGALBufferVulkan *pBuffer)
 Need to be called to remove the buffer from tracking.
 
void AccessBuffer (const ezGALBufferVulkan *pBuffer, vk::DeviceSize offset, vk::DeviceSize length, vk::PipelineStageFlags srcStages, vk::AccessFlags srcAccess, vk::PipelineStageFlags dstStages, vk::AccessFlags dstAccess)
 
bool IsDirty (vk::Buffer buffer, vk::DeviceSize offset, vk::DeviceSize length, vk::AccessFlags dstAccess)
 
Image handling
void SetInitialImageState (const ezGALTextureVulkan *pTexture, vk::ImageLayout dstLayout, vk::PipelineStageFlags dstStages=vk::PipelineStageFlagBits::eTopOfPipe, vk::AccessFlags dstAccess={})
 Force, sets the layout of the texture's image. Most images are not created in their preferred layout on creation. More...
 
void TextureDestroyed (const ezGALTextureVulkan *pTexture)
 Need to be called to remove the texture's image from tracking.
 
void EnsureImageLayout (const ezGALTextureVulkan *pTexture, vk::ImageLayout dstLayout, vk::PipelineStageFlags dstStages, vk::AccessFlags dstAccess, bool bDiscardSource=false)
 Transition the given texture's image into the given layout to be used in the given stage. More...
 
void EnsureImageLayout (const ezGALRenderTargetViewVulkan *pTextureView, vk::ImageLayout dstLayout, vk::PipelineStageFlags dstStages, vk::AccessFlags dstAccess, bool bDiscardSource=false)
 
void EnsureImageLayout (const ezGALTextureResourceViewVulkan *pTextureView, vk::ImageLayout dstLayout, vk::PipelineStageFlags dstStages, vk::AccessFlags dstAccess, bool bDiscardSource=false)
 
void EnsureImageLayout (const ezGALTextureUnorderedAccessViewVulkan *pTextureView, vk::ImageLayout dstLayout, vk::PipelineStageFlags dstStages, vk::AccessFlags dstAccess, bool bDiscardSource=false)
 
void EnsureImageLayout (const ezGALTextureVulkan *pTexture, vk::ImageSubresourceRange subResources, vk::ImageLayout dstLayout, vk::PipelineStageFlags dstStages, vk::AccessFlags dstAccess, bool bDiscardSource=false)
 
bool IsDirty (vk::Image image, const vk::ImageSubresourceRange &subResources) const
 

Member Function Documentation

◆ EnsureImageLayout()

void ezPipelineBarrierVulkan::EnsureImageLayout ( const ezGALTextureVulkan pTexture,
vk::ImageLayout  dstLayout,
vk::PipelineStageFlags  dstStages,
vk::AccessFlags  dstAccess,
bool  bDiscardSource = false 
)

Transition the given texture's image into the given layout to be used in the given stage.

Parameters
pTextureThe texture whose image's layout is to be changed.
dstLayoutThe layout that the image is to be changed into.
dstStagesIn what stages the image needs to be in the new layout.
dstAccessWhat access we will be doing on the image in dstStages.
bDiscardSourceDiscard the previous layout, replaces current layout with unknown.

◆ SetInitialImageState()

void ezPipelineBarrierVulkan::SetInitialImageState ( const ezGALTextureVulkan pTexture,
vk::ImageLayout  dstLayout,
vk::PipelineStageFlags  dstStages = vk::PipelineStageFlagBits::eTopOfPipe,
vk::AccessFlags  dstAccess = {} 
)

Force, sets the layout of the texture's image. Most images are not created in their preferred layout on creation.

Parameters
pTextureThe texture whose image the initial state should be set on.
dstLayoutThe layout that the image currently is in.
dstStagesIn what stage the image was changed into the current layout.
dstAccessThe access operation that changed the image into the current layout during dstStages.

The documentation for this class was generated from the following files: