summaryrefslogtreecommitdiff
path: root/src/common/page_table.h
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2020-03-13 16:33:47 -0400
committerGravatar FernandoS272020-03-14 09:43:57 -0400
commit27cbb75e7c2818c073bd65a000d7ff7f28d391d4 (patch)
tree1f8ff16d5202fde0e15f8a8f7c5d50045efb9341 /src/common/page_table.h
parentMerge pull request #3491 from ReinUsesLisp/polygon-modes (diff)
downloadyuzu-27cbb75e7c2818c073bd65a000d7ff7f28d391d4.tar.gz
yuzu-27cbb75e7c2818c073bd65a000d7ff7f28d391d4.tar.xz
yuzu-27cbb75e7c2818c073bd65a000d7ff7f28d391d4.zip
PageTable: move backing addresses to a children class as the CPU page table does not need them.
This PR aims to reduce the memory usage in the CPU page table by moving GPU specific parameters into a child class. This saves 1Gb of Memory for most games.
Diffstat (limited to 'src/common/page_table.h')
-rw-r--r--src/common/page_table.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/common/page_table.h b/src/common/page_table.h
index 8b8ff0bb8..dbc272ab7 100644
--- a/src/common/page_table.h
+++ b/src/common/page_table.h
@@ -76,9 +76,20 @@ struct PageTable {
76 */ 76 */
77 std::vector<PageType> attributes; 77 std::vector<PageType> attributes;
78 78
79 std::vector<u64> backing_addr;
80
81 const std::size_t page_size_in_bits{}; 79 const std::size_t page_size_in_bits{};
82}; 80};
83 81
82/**
83 * A more advanced Page Table with the ability to save a backing address when using it
84 * depends on another MMU.
85 */
86struct BackingPageTable : PageTable {
87 explicit BackingPageTable(std::size_t page_size_in_bits);
88 ~BackingPageTable();
89
90 void Resize(std::size_t address_space_width_in_bits);
91
92 std::vector<u64> backing_addr;
93};
94
84} // namespace Common 95} // namespace Common