![]() |
ezEngine Release 25.08
|
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 () |
ezMutex & | AccessLock () |
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. | |
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. | |
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. | |
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. | |
void | ExecutePendingCopies (ezArrayPtr< ezPendingBufferCopyVulkan > buffers, ezArrayPtr< ezPendingTextureCopyVulkan > textures) |
Executes work generates by ezGALDeviceVulkan::UpdateBufferForNextFramePlatform and UpdateTextureForNextFramePlatform. | |
Thread-safe context for initializing resources. Records a command buffer that transitions all newly created resources into their initial state.
void ezInitContextVulkan::ExecutePendingCopies | ( | ezArrayPtr< ezPendingBufferCopyVulkan > | buffers, |
ezArrayPtr< ezPendingTextureCopyVulkan > | textures | ||
) |
Executes work generates by ezGALDeviceVulkan::UpdateBufferForNextFramePlatform and UpdateTextureForNextFramePlatform.
buffers | The pending buffer copies. |
textures | The pending texture copies. |
void ezInitContextVulkan::InitBuffer | ( | const ezGALBufferVulkan * | pBuffer, |
ezConstByteArrayPtr | pInitialData | ||
) |
Initializes a buffer with the given data.
pBuffer | The buffer to initialize. |
pInitialData | The initial data that the buffer should be filled with. |
void ezInitContextVulkan::InitTexture | ( | const ezGALTextureVulkan * | pTexture, |
vk::ImageCreateInfo & | createInfo, | ||
ezArrayPtr< ezGALSystemMemoryDescription > | pInitialData | ||
) |
Initializes a texture and moves it into its default state.
pTexture | The texture to initialize. |
createInfo | The image creation info for the texture. Needed for initial state information. |
pInitialData | The initial data of the texture. If not set, the initial content will be undefined. |
void ezInitContextVulkan::UpdateBuffer | ( | const ezGALBufferVulkan * | pBuffer, |
ezUInt32 | uiOffset, | ||
ezConstByteArrayPtr | pSourceData | ||
) |
Updates a buffer range.
pBuffer | The buffer to update. |
uiOffset | The offset inside the buffer where the new data should be placed. |
pSourceData | The new data to update the buffer with. |
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.
gpuBuffer | The device local buffer to update. |
stagingBuffer | The staging buffer that contains the data to be copied to gpuBuffer. If null, buffer is CPU writable and already contains the data. |
uiOffset | Offset in the buffer. |
uiSize | The size of the data to be copied from stagingBuffer to gpuBuffer. |