BRE12
UploadBufferManager.h
1 #pragma once
2 
3 #include <d3d12.h>
4 #include <mutex>
5 #include <tbb/concurrent_unordered_set.h>
6 
7 #include <ResourceManager/UploadBuffer.h>
8 
9 namespace BRE {
10 // This class is responsible to create/get upload buffers
12 public:
13  UploadBufferManager() = delete;
14  ~UploadBufferManager() = delete;
16  const UploadBufferManager& operator=(const UploadBufferManager&) = delete;
18  UploadBufferManager& operator=(UploadBufferManager&&) = delete;
19 
20  static void EraseAll() noexcept;
21 
22  // Preconditions:
23  // - "elementSize" must be greater than zero.
24  // - "elementCount" must be greater than zero.
25  static UploadBuffer& CreateUploadBuffer(const std::size_t elementSize,
26  const std::uint32_t elementCount) noexcept;
27 
28 private:
30  static UploadBuffers mUploadBuffers;
31 
32  static std::mutex mMutex;
33 };
34 
35 }
36 
Definition: Camera.cpp:8
Definition: concurrent_unordered_set.h:58
Definition: UploadBufferManager.h:11
Definition: UploadBuffer.h:9