ezEngine  Release 25.03
ezInitContextVulkan Class Reference

Thread-safe context for initializing resources. Records a command buffer that transitions all newly created resources into their initial state. More...

#include <InitContext.h>

Public Member Functions

 ezInitContextVulkan (ezGALDeviceVulkan *pDevice)
 
void AfterBeginFrame ()
 
ezMutexAccessLock ()
 
vk::CommandBuffer GetFinishedCommandBuffer ()
 Returns a finished command buffer of all background loading up to this point. The command buffer is already ended and marked to be reclaimed so the only thing done on it should be to submit it.
 
void InitTexture (const ezGALTextureVulkan *pTexture, vk::ImageCreateInfo &createInfo, ezArrayPtr< ezGALSystemMemoryDescription > pInitialData)
 Initializes a texture and moves it into its default state. More...
 
void TextureDestroyed (const ezGALTextureVulkan *pTexture)
 Needs to be called by the ezGALDeviceVulkan just before a texture is destroyed to clean up stale barriers.
 
void InitBuffer (const ezGALBufferVulkan *pBuffer, ezConstByteArrayPtr pInitialData)
 Initializes a buffer with the given data. More...
 
void UpdateTexture (const ezGALTextureVulkan *pTexture, const ezGALTextureSubresource &subresource, const ezBoundingBoxu32 &box, const ezGALSystemMemoryDescription &sourceData)
 Updates a texture region.
 
void UpdateBuffer (const ezGALBufferVulkan *pBuffer, ezUInt32 uiOffset, ezConstByteArrayPtr pSourceData)
 Updates a buffer range. More...
 
void UpdateDynamicUniformBuffer (vk::Buffer gpuBuffer, vk::Buffer stagingBuffer, ezUInt32 uiOffset, ezUInt32 uiSize)
 Used by ezUniformBufferPoolVulkan to write the entire uniform scratch pool to the GPU. More...
 

Detailed Description

Thread-safe context for initializing resources. Records a command buffer that transitions all newly created resources into their initial state.

Member Function Documentation

◆ InitBuffer()

void ezInitContextVulkan::InitBuffer ( const ezGALBufferVulkan pBuffer,
ezConstByteArrayPtr  pInitialData 
)

Initializes a buffer with the given data.

Parameters
pBufferThe buffer to initialize.
pInitialDataThe initial data that the buffer should be filled with.

◆ InitTexture()

void ezInitContextVulkan::InitTexture ( const ezGALTextureVulkan pTexture,
vk::ImageCreateInfo &  createInfo,
ezArrayPtr< ezGALSystemMemoryDescription pInitialData 
)

Initializes a texture and moves it into its default state.

Parameters
pTextureThe texture to initialize.
createInfoThe image creation info for the texture. Needed for initial state information.
pInitialDataThe initial data of the texture. If not set, the initial content will be undefined.

◆ UpdateBuffer()

void ezInitContextVulkan::UpdateBuffer ( const ezGALBufferVulkan pBuffer,
ezUInt32  uiOffset,
ezConstByteArrayPtr  pSourceData 
)

Updates a buffer range.

Parameters
pBufferThe buffer to update.
uiOffsetThe offset inside the buffer where the new data should be placed.
pSourceDataThe new data to update the buffer with.

◆ UpdateDynamicUniformBuffer()

void ezInitContextVulkan::UpdateDynamicUniformBuffer ( vk::Buffer  gpuBuffer,
vk::Buffer  stagingBuffer,
ezUInt32  uiOffset,
ezUInt32  uiSize 
)

Used by ezUniformBufferPoolVulkan to write the entire uniform scratch pool to the GPU.

Parameters
gpuBufferThe device local buffer to update.
stagingBufferThe staging buffer that contains the data to be copied to gpuBuffer. If null, buffer is CPU writable and already contains the data.
uiOffsetOffset in the buffer.
uiSizeThe size of the data to be copied from stagingBuffer to gpuBuffer.

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