Plasma Engine  2.0
Loading...
Searching...
No Matches
InitContext.h
1
2#pragma once
3
4#include <Foundation/Types/UniquePtr.h>
5
10
13{
14public:
17
20 vk::CommandBuffer GetFinishedCommandBuffer();
21
26 void InitTexture(const plGALTextureVulkan* pTexture, vk::ImageCreateInfo& createInfo, plArrayPtr<plGALSystemMemoryDescription> pInitialData);
27
29 void TextureDestroyed(const plGALTextureVulkan* pTexture);
30
31private:
32 void EnsureCommandBufferExists();
33
34 plGALDeviceVulkan* m_pDevice = nullptr;
35
36 plMutex m_Lock;
37 plDynamicArray<plUInt8> m_InitData;
38 vk::CommandBuffer m_currentCommandBuffer;
39 plUniquePtr<plPipelineBarrierVulkan> m_pPipelineBarrier;
40 plUniquePtr<plCommandBufferPoolVulkan> m_pCommandBufferPool;
41 plUniquePtr<plStagingBufferPoolVulkan> m_pStagingBufferPool;
42};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Simple pool for command buffers.
Definition CommandBufferPoolVulkan.h:20
Definition DynamicArray.h:81
The Vulkan device implementation of the graphics abstraction layer.
Definition DeviceVulkan.h:58
Definition TextureVulkan.h:11
Thread-safe context for initializing resources. Records a command buffer that transitions all newly c...
Definition InitContext.h:13
void TextureDestroyed(const plGALTextureVulkan *pTexture)
Needs to be called by the plGALDeviceVulkan just before a texture is destroyed to clean up stale barr...
Definition InitContext.cpp:58
vk::CommandBuffer GetFinishedCommandBuffer()
Returns a finished command buffer of all background loading up to this point. The command buffer is a...
Definition InitContext.cpp:31
void InitTexture(const plGALTextureVulkan *pTexture, vk::ImageCreateInfo &createInfo, plArrayPtr< plGALSystemMemoryDescription > pInitialData)
Initializes a texture and moves it into its default state.
Definition InitContext.cpp:64
Provides a simple mechanism for mutual exclusion to prevent multiple threads from accessing a shared ...
Definition Mutex.h:13
Definition PipelineBarrierVulkan.h:19
Definition StagingBufferPoolVulkan.h:18
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10