1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[dxvk] Inline freeBufferSlice implementation

May save a cycle or two in invalidateBuffer.
This commit is contained in:
Philip Rebohle 2019-10-11 13:06:55 +02:00
parent 594f04d4ed
commit bd5630439e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 14 additions and 10 deletions

View File

@ -181,13 +181,6 @@ namespace dxvk {
DxvkBufferTracker::~DxvkBufferTracker() { }
void DxvkBufferTracker::freeBufferSlice(
const Rc<DxvkBuffer>& buffer,
const DxvkBufferSliceHandle& slice) {
m_entries.push_back({ buffer, slice });
}
void DxvkBufferTracker::reset() {
for (const auto& e : m_entries)
e.buffer->freeSlice(e.slice);

View File

@ -645,10 +645,21 @@ namespace dxvk {
DxvkBufferTracker();
~DxvkBufferTracker();
void freeBufferSlice(
const Rc<DxvkBuffer>& buffer,
const DxvkBufferSliceHandle& slice);
/**
* \brief Add buffer slice for tracking
*
* The slice will be returned to the
* buffer on the next call to \c reset.
* \param [in] buffer The parent buffer
* \param [in] slice The buffer slice
*/
void freeBufferSlice(const Rc<DxvkBuffer>& buffer, const DxvkBufferSliceHandle& slice) {
m_entries.push_back({ buffer, slice });
}
/**
* \brief Returns tracked buffer slices
*/
void reset();
private: