mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[dxvk] Remove DxvkDataBuffer
Unused.
This commit is contained in:
parent
1cefe90ce7
commit
b0d0959329
@ -2,8 +2,6 @@
|
||||
#include "d3d11_context.h"
|
||||
#include "d3d11_device.h"
|
||||
|
||||
#include "../dxvk/dxvk_data.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
D3D11Buffer::D3D11Buffer(
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include "dxvk_bind_mask.h"
|
||||
#include "dxvk_cmdlist.h"
|
||||
#include "dxvk_context_state.h"
|
||||
#include "dxvk_data.h"
|
||||
#include "dxvk_objects.h"
|
||||
#include "dxvk_queue.h"
|
||||
#include "dxvk_resource.h"
|
||||
|
@ -1,26 +0,0 @@
|
||||
#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();
|
||||
}
|
||||
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "dxvk_include.h"
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
class DxvkDataSlice;
|
||||
|
||||
/**
|
||||
* \brief Data buffer
|
||||
*
|
||||
* Provides a fixed-size buffer with a linear memory
|
||||
* allocator for arbitrary data. Can be used to copy
|
||||
* data to or from resources. Note that allocations
|
||||
* will be aligned to a cache line boundary.
|
||||
*/
|
||||
class DxvkDataBuffer : public RcObject {
|
||||
friend class DxvkDataSlice;
|
||||
public:
|
||||
|
||||
DxvkDataBuffer();
|
||||
DxvkDataBuffer(size_t size);
|
||||
~DxvkDataBuffer();
|
||||
|
||||
/**
|
||||
* \brief Allocates a slice
|
||||
*
|
||||
* If the desired slice length is larger than the
|
||||
* number of bytes left in the buffer, this will
|
||||
* fail and the returned slice points to \c nullptr.
|
||||
* \param [in] n Number of bytes to allocate
|
||||
* \returns The slice, or an empty slice on failure
|
||||
*/
|
||||
DxvkDataSlice alloc(size_t n);
|
||||
|
||||
private:
|
||||
|
||||
char* m_data = nullptr;
|
||||
size_t m_size = 0;
|
||||
size_t m_offset = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Data buffer slice
|
||||
*
|
||||
* A slice of a \ref DxvkDataBuffer which stores
|
||||
* a strong reference to the backing buffer object.
|
||||
*/
|
||||
class DxvkDataSlice {
|
||||
|
||||
public:
|
||||
|
||||
DxvkDataSlice() { }
|
||||
DxvkDataSlice(
|
||||
const Rc<DxvkDataBuffer>& buffer,
|
||||
size_t offset,
|
||||
size_t length)
|
||||
: m_buffer(buffer),
|
||||
m_offset(offset),
|
||||
m_length(length) { }
|
||||
|
||||
void* ptr() const {
|
||||
return m_buffer != nullptr
|
||||
? m_buffer->m_data + m_offset
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
size_t offset() const { return m_offset; }
|
||||
size_t length() const { return m_length; }
|
||||
|
||||
private:
|
||||
|
||||
Rc<DxvkDataBuffer> m_buffer;
|
||||
size_t m_offset = 0;
|
||||
size_t m_length = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
@ -70,7 +70,6 @@ dxvk_src = [
|
||||
'dxvk_compute.cpp',
|
||||
'dxvk_context.cpp',
|
||||
'dxvk_cs.cpp',
|
||||
'dxvk_data.cpp',
|
||||
'dxvk_descriptor.cpp',
|
||||
'dxvk_device.cpp',
|
||||
'dxvk_device_filter.cpp',
|
||||
|
Loading…
x
Reference in New Issue
Block a user