BRE12
BRE
ResourceManager
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
11
class
UploadBufferManager
{
12
public
:
13
UploadBufferManager
() =
delete
;
14
~
UploadBufferManager
() =
delete
;
15
UploadBufferManager
(
const
UploadBufferManager
&) =
delete
;
16
const
UploadBufferManager
& operator=(
const
UploadBufferManager
&) =
delete
;
17
UploadBufferManager
(
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
:
29
using
UploadBuffers
=
tbb::concurrent_unordered_set<UploadBuffer*>
;
30
static
UploadBuffers
mUploadBuffers;
31
32
static
std::mutex mMutex;
33
};
34
35
}
36
BRE
Definition:
Camera.cpp:8
tbb::interface5::concurrent_unordered_set
Definition:
concurrent_unordered_set.h:58
BRE::UploadBufferManager
Definition:
UploadBufferManager.h:11
BRE::UploadBuffer
Definition:
UploadBuffer.h:9
Generated by
1.8.12