-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVulkanStagingBuffers.h
37 lines (28 loc) · 1002 Bytes
/
VulkanStagingBuffers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/******************************************************************************
This file is part of the Newcastle Vulkan Tutorial Series
Author:Rich Davison
Contact:[email protected]
License: MIT (see LICENSE file at the top of the source tree)
*//////////////////////////////////////////////////////////////////////////////
#pragma once
#include "VulkanBuffers.h"
namespace NCL::Rendering::Vulkan {
class VulkanStagingBuffers
{
public:
VulkanStagingBuffers() {};
VulkanStagingBuffers(vk::Device device, VmaAllocator allocator, uint32_t framesInFlight = 3);
~VulkanStagingBuffers();
const VulkanBuffer* GetStagingBuffer(size_t allocationSize);
void Update();
protected:
vk::Device device;
VmaAllocator allocator;
struct StagingBuffer {
VulkanBuffer buffer;
uint32_t framesCount;
};
std::vector<StagingBuffer> activeBuffers;
uint32_t framesInFlight;
};
}