summaryrefslogtreecommitdiffstats
path: root/src/video_core/memory_manager.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-06-13 03:34:06 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-07-04 22:32:35 +0200
commitfd98fcf7f00d096322ccfaa1e35a314b4d698efd (patch)
tree90fe2a180845d1c28ad3996264188f6ae4aa9f11 /src/video_core/memory_manager.h
parentTexture Cache: Initial Implementation of Sparse Textures. (diff)
downloadyuzu-fd98fcf7f00d096322ccfaa1e35a314b4d698efd.tar
yuzu-fd98fcf7f00d096322ccfaa1e35a314b4d698efd.tar.gz
yuzu-fd98fcf7f00d096322ccfaa1e35a314b4d698efd.tar.bz2
yuzu-fd98fcf7f00d096322ccfaa1e35a314b4d698efd.tar.lz
yuzu-fd98fcf7f00d096322ccfaa1e35a314b4d698efd.tar.xz
yuzu-fd98fcf7f00d096322ccfaa1e35a314b4d698efd.tar.zst
yuzu-fd98fcf7f00d096322ccfaa1e35a314b4d698efd.zip
Diffstat (limited to 'src/video_core/memory_manager.h')
-rw-r--r--src/video_core/memory_manager.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h
index b3538d503..305c4b1f1 100644
--- a/src/video_core/memory_manager.h
+++ b/src/video_core/memory_manager.h
@@ -76,6 +76,8 @@ public:
[[nodiscard]] std::optional<VAddr> GpuToCpuAddress(GPUVAddr addr) const;
+ [[nodiscard]] std::optional<VAddr> GpuToCpuAddress(GPUVAddr addr, std::size_t size) const;
+
template <typename T>
[[nodiscard]] T Read(GPUVAddr addr) const;
@@ -116,6 +118,24 @@ public:
*/
[[nodiscard]] bool IsGranularRange(GPUVAddr gpu_addr, std::size_t size) const;
+ /**
+ * IsContinousRange checks if a gpu region is mapped by a single range of cpu addresses.
+ */
+ [[nodiscard]] bool IsContinousRange(GPUVAddr gpu_addr, std::size_t size) const;
+
+ /**
+ * IsFullyMappedRange checks if a gpu region is mapped entirely.
+ */
+ [[nodiscard]] bool IsFullyMappedRange(GPUVAddr gpu_addr, std::size_t size) const;
+
+ /**
+ * GetSubmappedRange returns a vector with all the subranges of cpu addresses mapped beneath.
+ * if the region is continous, a single pair will be returned. If it's unmapped, an empty vector
+ * will be returned;
+ */
+ std::vector<std::pair<GPUVAddr, std::size_t>> GetSubmappedRange(GPUVAddr gpu_addr,
+ std::size_t size) const;
+
[[nodiscard]] GPUVAddr Map(VAddr cpu_addr, GPUVAddr gpu_addr, std::size_t size);
[[nodiscard]] GPUVAddr MapAllocate(VAddr cpu_addr, std::size_t size, std::size_t align);
[[nodiscard]] GPUVAddr MapAllocate32(VAddr cpu_addr, std::size_t size);