diff options
author | FengChen <vonchenplus@gmail.com> | 2022-10-16 17:49:32 +0200 |
---|---|---|
committer | FengChen <vonchenplus@gmail.com> | 2022-10-17 09:33:29 +0200 |
commit | 99507d0188a1f7f7d8e11741f935918c7643ce76 (patch) | |
tree | 7927e20e9c792ac7fbe460d1ba5d8408326b8092 /src/video_core/memory_manager.h | |
parent | Merge pull request #9067 from Morph1984/tess-cw (diff) | |
download | yuzu-99507d0188a1f7f7d8e11741f935918c7643ce76.tar yuzu-99507d0188a1f7f7d8e11741f935918c7643ce76.tar.gz yuzu-99507d0188a1f7f7d8e11741f935918c7643ce76.tar.bz2 yuzu-99507d0188a1f7f7d8e11741f935918c7643ce76.tar.lz yuzu-99507d0188a1f7f7d8e11741f935918c7643ce76.tar.xz yuzu-99507d0188a1f7f7d8e11741f935918c7643ce76.tar.zst yuzu-99507d0188a1f7f7d8e11741f935918c7643ce76.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/memory_manager.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index f992e29f3..ab4bc9ec6 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h @@ -11,6 +11,7 @@ #include "common/common_types.h" #include "common/multi_level_page_table.h" #include "common/virtual_buffer.h" +#include "video_core/pte_kind.h" namespace VideoCore { class RasterizerInterface; @@ -98,7 +99,8 @@ public: std::vector<std::pair<GPUVAddr, std::size_t>> GetSubmappedRange(GPUVAddr gpu_addr, std::size_t size) const; - GPUVAddr Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size, bool is_big_pages = true); + GPUVAddr Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size, + PTEKind kind = PTEKind::INVALID, bool is_big_pages = true); GPUVAddr MapSparse(GPUVAddr gpu_addr, std::size_t size, bool is_big_pages = true); void Unmap(GPUVAddr gpu_addr, std::size_t size); @@ -114,6 +116,8 @@ public: return gpu_addr < address_space_size; } + PTEKind GetPageKind(GPUVAddr gpu_addr) const; + private: template <bool is_big_pages, typename FuncMapped, typename FuncReserved, typename FuncUnmapped> inline void MemoryOperation(GPUVAddr gpu_src_addr, std::size_t size, FuncMapped&& func_mapped, @@ -166,10 +170,12 @@ private: std::vector<u64> big_entries; template <EntryType entry_type> - GPUVAddr PageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cpu_addr, size_t size); + GPUVAddr PageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cpu_addr, size_t size, + PTEKind kind); template <EntryType entry_type> - GPUVAddr BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cpu_addr, size_t size); + GPUVAddr BigPageTableOp(GPUVAddr gpu_addr, [[maybe_unused]] VAddr cpu_addr, size_t size, + PTEKind kind); template <bool is_big_page> inline EntryType GetEntry(size_t position) const; @@ -177,6 +183,15 @@ private: template <bool is_big_page> inline void SetEntry(size_t position, EntryType entry); + std::vector<std::array<PTEKind, 32>> kinds; + std::vector<std::array<PTEKind, 32>> big_kinds; + + template <bool is_big_page> + inline PTEKind GetKind(size_t position) const; + + template <bool is_big_page> + inline void SetKind(size_t position, PTEKind kind); + Common::MultiLevelPageTable<u32> page_table; Common::VirtualBuffer<u32> big_page_table_cpu; |