diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-11-20 03:07:14 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-01-01 22:43:58 +0100 |
commit | 3630bfaef332768e08ecc0c34cd4bca83a2579f8 (patch) | |
tree | 6bd52f659411c16300ab437a418df3e0283d1c31 /src/video_core/memory_manager.h | |
parent | Vulkan: Allow stagging buffer deferrals. (diff) | |
download | yuzu-3630bfaef332768e08ecc0c34cd4bca83a2579f8.tar yuzu-3630bfaef332768e08ecc0c34cd4bca83a2579f8.tar.gz yuzu-3630bfaef332768e08ecc0c34cd4bca83a2579f8.tar.bz2 yuzu-3630bfaef332768e08ecc0c34cd4bca83a2579f8.tar.lz yuzu-3630bfaef332768e08ecc0c34cd4bca83a2579f8.tar.xz yuzu-3630bfaef332768e08ecc0c34cd4bca83a2579f8.tar.zst yuzu-3630bfaef332768e08ecc0c34cd4bca83a2579f8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/memory_manager.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index 50043a8ae..828e13439 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h @@ -12,6 +12,7 @@ #include "common/multi_level_page_table.h" #include "common/range_map.h" #include "common/virtual_buffer.h" +#include "video_core/cache_types.h" #include "video_core/pte_kind.h" namespace VideoCore { @@ -60,9 +61,12 @@ public: * in the Host Memory counterpart. Note: This functions cause Host GPU Memory * Flushes and Invalidations, respectively to each operation. */ - void ReadBlock(GPUVAddr gpu_src_addr, void* dest_buffer, std::size_t size) const; - void WriteBlock(GPUVAddr gpu_dest_addr, const void* src_buffer, std::size_t size); - void CopyBlock(GPUVAddr gpu_dest_addr, GPUVAddr gpu_src_addr, std::size_t size); + void ReadBlock(GPUVAddr gpu_src_addr, void* dest_buffer, std::size_t size, + VideoCommon::CacheType which = VideoCommon::CacheType::All) const; + void WriteBlock(GPUVAddr gpu_dest_addr, const void* src_buffer, std::size_t size, + VideoCommon::CacheType which = VideoCommon::CacheType::All); + void CopyBlock(GPUVAddr gpu_dest_addr, GPUVAddr gpu_src_addr, std::size_t size, + VideoCommon::CacheType which = VideoCommon::CacheType::All); /** * ReadBlockUnsafe and WriteBlockUnsafe are special versions of ReadBlock and @@ -105,11 +109,14 @@ public: GPUVAddr MapSparse(GPUVAddr gpu_addr, std::size_t size, bool is_big_pages = true); void Unmap(GPUVAddr gpu_addr, std::size_t size); - void FlushRegion(GPUVAddr gpu_addr, size_t size) const; + void FlushRegion(GPUVAddr gpu_addr, size_t size, + VideoCommon::CacheType which = VideoCommon::CacheType::All) const; - void InvalidateRegion(GPUVAddr gpu_addr, size_t size) const; + void InvalidateRegion(GPUVAddr gpu_addr, size_t size, + VideoCommon::CacheType which = VideoCommon::CacheType::All) const; - bool IsMemoryDirty(GPUVAddr gpu_addr, size_t size) const; + bool IsMemoryDirty(GPUVAddr gpu_addr, size_t size, + VideoCommon::CacheType which = VideoCommon::CacheType::All) const; size_t MaxContinousRange(GPUVAddr gpu_addr, size_t size) const; @@ -128,10 +135,12 @@ private: FuncReserved&& func_reserved, FuncUnmapped&& func_unmapped) const; template <bool is_safe> - void ReadBlockImpl(GPUVAddr gpu_src_addr, void* dest_buffer, std::size_t size) const; + void ReadBlockImpl(GPUVAddr gpu_src_addr, void* dest_buffer, std::size_t size, + VideoCommon::CacheType which) const; template <bool is_safe> - void WriteBlockImpl(GPUVAddr gpu_dest_addr, const void* src_buffer, std::size_t size); + void WriteBlockImpl(GPUVAddr gpu_dest_addr, const void* src_buffer, std::size_t size, + VideoCommon::CacheType which); template <bool is_big_page> [[nodiscard]] std::size_t PageEntryIndex(GPUVAddr gpu_addr) const { |