diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-05-01 18:46:03 +0100 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2023-05-11 06:42:38 +0100 |
commit | bf08bc3c0fe7dc6c3ebc32861d954c0ea7598a5e (patch) | |
tree | 47b1b46b04623bd860ac07e09a190d65f1ac3d06 /src/common/scratch_buffer.h | |
parent | 7944f271dcbd8217ea0a9e556b75edbe7a23eaff (diff) |
Allow Fermi blit accelerate to add src/dst to the cache if they don't exist already. Use ScratchBuffers in the software blit path.
Diffstat (limited to 'src/common/scratch_buffer.h')
-rw-r--r-- | src/common/scratch_buffer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h index 26d4e76dcd..a69a5a7af9 100644 --- a/src/common/scratch_buffer.h +++ b/src/common/scratch_buffer.h @@ -23,7 +23,10 @@ public: buffer{Common::make_unique_for_overwrite<T[]>(initial_capacity)} {} ~ScratchBuffer() = default; + ScratchBuffer(const ScratchBuffer&) = delete; + ScratchBuffer& operator=(const ScratchBuffer&) = delete; ScratchBuffer(ScratchBuffer&&) = default; + ScratchBuffer& operator=(ScratchBuffer&&) = default; /// This will only grow the buffer's capacity if size is greater than the current capacity. /// The previously held data will remain intact. @@ -87,6 +90,12 @@ public: return buffer_capacity; } + void swap(ScratchBuffer& other) noexcept { + std::swap(last_requested_size, other.last_requested_size); + std::swap(buffer_capacity, other.buffer_capacity); + std::swap(buffer, other.buffer); + } + private: size_t last_requested_size{}; size_t buffer_capacity{}; |