blob: bece0efdc38488a3d418447b555855343321b057 (
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
|
#include <cstring>
#include "dxvk_data.h"
namespace dxvk {
DxvkDataBuffer:: DxvkDataBuffer() { }
DxvkDataBuffer::DxvkDataBuffer(size_t size)
: m_data(new char[size]), m_size(size) { }
DxvkDataBuffer::~DxvkDataBuffer() {
delete[] m_data;
}
DxvkDataSlice DxvkDataBuffer::alloc(size_t n) {
const size_t offset = m_offset;
if (offset + n <= m_size) {
m_offset += align(n, CACHE_LINE_SIZE);
return DxvkDataSlice(this, offset, n);
} return DxvkDataSlice();
}
}
|