blob: 59802f9550fd7d622e013203017f4d6541b2376f (
plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#pragma once
#include "d3d9_common_buffer.h"
#include "d3d9_common_texture.h"
namespace dxvk {
/**
* \brief Resource initialization context
*
* Manages a context which is used for resource
* initialization. This includes
* zero-initialization for buffers and images.
*/
class D3D9Initializer {
constexpr static size_t MaxTransferMemory = 32 * 1024 * 1024;
constexpr static size_t MaxTransferCommands = 512;
public:
D3D9Initializer(
const Rc<DxvkDevice>& Device);
~D3D9Initializer();
void Flush();
void InitBuffer(
D3D9CommonBuffer* pBuffer);
void InitTexture(
D3D9CommonTexture* pTexture,
void* pInitialData = nullptr);
private:
dxvk::mutex m_mutex;
Rc<DxvkDevice> m_device;
Rc<DxvkContext> m_context;
size_t m_transferCommands = 0;
size_t m_transferMemory = 0;
void InitDeviceLocalBuffer(
DxvkBufferSlice Slice);
void InitHostVisibleBuffer(
DxvkBufferSlice Slice);
void InitDeviceLocalTexture(
D3D9CommonTexture* pTexture);
void InitHostVisibleTexture(
D3D9CommonTexture* pTexture,
void* pInitialData);
void FlushImplicit();
void FlushInternal();
};
}
|