Implemented Asynchronous upload (transfer queue) functions in KRDevice.

This commit is contained in:
2022-07-12 00:31:30 -07:00
parent dfde4f876d
commit 7ea1349fb9
2 changed files with 90 additions and 1 deletions

View File

@@ -34,6 +34,8 @@
#pragma once
class KRDataBlock;
class KRDevice : public KRContextObject
{
public:
@@ -57,6 +59,12 @@ public:
KrResult selectDepthFormat(VkFormat& selectedDepthFormat);
KrResult selectPresentMode(VkSurfaceKHR& surface, VkPresentModeKHR& selectedPresentMode);
void streamStart();
size_t streamRemaining() const;
void streamUpload(KRDataBlock& data, VkBuffer destination);
void streamUpload(void *data, size_t size, VkBuffer destination);
void streamEnd();
VkPhysicalDevice m_device;
VkDevice m_logicalDevice;
VkPhysicalDeviceProperties m_deviceProperties;
@@ -81,6 +89,8 @@ public:
VkBuffer m_streamingStagingBuffer;
VmaAllocation m_streamingStagingBufferAllocation;
size_t m_streamingStagingBufferSize;
size_t m_streamingStagingBufferUsage;
void* m_streamingStagingBufferData;
// Staging buffer for uploading with the graphics queue
// This will be used for uploading assets procedurally generated while recording the graphics command buffer.
@@ -88,5 +98,7 @@ public:
VkBuffer m_graphicsStagingBuffer;
VmaAllocation m_graphicsStagingBufferAllocation;
size_t m_graphicsStagingBufferSize;
size_t m_graphicsStagingBufferUsage;
void* m_graphicsStagingBufferData;
private:
};