summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-07-11 03:54:19 +0200
committerGitHub <noreply@github.com>2023-07-11 03:54:19 +0200
commitce7c418e0cc05d92c18ad69c7cb37fecfa71b037 (patch)
treeea1852111c1b3c3c340608ae518fc8711a4fcfe3 /src/common
parentMerge pull request #11050 from SuperSamus/sdl-button-labels (diff)
parentFix ScratchBuffer moves (diff)
downloadyuzu-ce7c418e0cc05d92c18ad69c7cb37fecfa71b037.tar
yuzu-ce7c418e0cc05d92c18ad69c7cb37fecfa71b037.tar.gz
yuzu-ce7c418e0cc05d92c18ad69c7cb37fecfa71b037.tar.bz2
yuzu-ce7c418e0cc05d92c18ad69c7cb37fecfa71b037.tar.lz
yuzu-ce7c418e0cc05d92c18ad69c7cb37fecfa71b037.tar.xz
yuzu-ce7c418e0cc05d92c18ad69c7cb37fecfa71b037.tar.zst
yuzu-ce7c418e0cc05d92c18ad69c7cb37fecfa71b037.zip
Diffstat (limited to '')
-rw-r--r--src/common/page_table.cpp1
-rw-r--r--src/common/page_table.h1
-rw-r--r--src/common/scratch_buffer.h17
3 files changed, 17 insertions, 2 deletions
diff --git a/src/common/page_table.cpp b/src/common/page_table.cpp
index b744b68ce..4b1690269 100644
--- a/src/common/page_table.cpp
+++ b/src/common/page_table.cpp
@@ -66,6 +66,7 @@ void PageTable::Resize(std::size_t address_space_width_in_bits, std::size_t page
<< (address_space_width_in_bits - page_size_in_bits)};
pointers.resize(num_page_table_entries);
backing_addr.resize(num_page_table_entries);
+ blocks.resize(num_page_table_entries);
current_address_space_width_in_bits = address_space_width_in_bits;
page_size = 1ULL << page_size_in_bits;
}
diff --git a/src/common/page_table.h b/src/common/page_table.h
index 1ad3a9f8b..fec8378f3 100644
--- a/src/common/page_table.h
+++ b/src/common/page_table.h
@@ -122,6 +122,7 @@ struct PageTable {
* corresponding attribute element is of type `Memory`.
*/
VirtualBuffer<PageInfo> pointers;
+ VirtualBuffer<u64> blocks;
VirtualBuffer<u64> backing_addr;
diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h
index d5961b020..2a98cda53 100644
--- a/src/common/scratch_buffer.h
+++ b/src/common/scratch_buffer.h
@@ -40,8 +40,21 @@ public:
~ScratchBuffer() = default;
ScratchBuffer(const ScratchBuffer&) = delete;
ScratchBuffer& operator=(const ScratchBuffer&) = delete;
- ScratchBuffer(ScratchBuffer&&) = default;
- ScratchBuffer& operator=(ScratchBuffer&&) = default;
+
+ ScratchBuffer(ScratchBuffer&& other) noexcept {
+ swap(other);
+ other.last_requested_size = 0;
+ other.buffer_capacity = 0;
+ other.buffer.reset();
+ }
+
+ ScratchBuffer& operator=(ScratchBuffer&& other) noexcept {
+ swap(other);
+ other.last_requested_size = 0;
+ other.buffer_capacity = 0;
+ other.buffer.reset();
+ return *this;
+ }
/// This will only grow the buffer's capacity if size is greater than the current capacity.
/// The previously held data will remain intact.