diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-03-24 21:30:54 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-03-25 04:24:05 +0100 |
commit | 7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63 (patch) | |
tree | 67e146bd3f41413eb6c875234877cc4f3cf0e161 /src/video_core/texture_cache/texture_cache_base.h | |
parent | Merge pull request #7720 from FernandoS27/yfc-gc (diff) | |
download | yuzu-7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63.tar yuzu-7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63.tar.gz yuzu-7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63.tar.bz2 yuzu-7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63.tar.lz yuzu-7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63.tar.xz yuzu-7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63.tar.zst yuzu-7a9d9e575b4d85ca30fc119dfb73c1b22a6dbe63.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index b1324edf3..ad5978a33 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -8,6 +8,7 @@ #include <span> #include <type_traits> #include <unordered_map> +#include <unordered_set> #include <vector> #include <queue> @@ -50,6 +51,9 @@ class TextureCache { /// Address shift for caching images into a hash table static constexpr u64 PAGE_BITS = 20; + static constexpr u64 CPU_PAGE_BITS = 12; + static constexpr u64 CPU_PAGE_SIZE = 1ULL << CPU_PAGE_BITS; + /// Enables debugging features to the texture cache static constexpr bool ENABLE_VALIDATION = P::ENABLE_VALIDATION; /// Implement blits as copies between framebuffers @@ -136,6 +140,9 @@ public: /// Mark images in a range as modified from the CPU void WriteMemory(VAddr cpu_addr, size_t size); + /// Mark images in a range as modified from the CPU + void CachedWriteMemory(VAddr cpu_addr, size_t size); + /// Download contents of host images to guest memory in a region void DownloadMemory(VAddr cpu_addr, size_t size); @@ -145,6 +152,8 @@ public: /// Remove images in a region void UnmapGPUMemory(GPUVAddr gpu_addr, size_t size); + void FlushCachedWrites(); + /// Blit an image with the given parameters void BlitImage(const Tegra::Engines::Fermi2D::Surface& dst, const Tegra::Engines::Fermi2D::Surface& src, @@ -366,6 +375,8 @@ private: std::unordered_map<ImageId, std::vector<ImageViewId>> sparse_views; + std::unordered_set<ImageId> cached_cpu_invalidate; + VAddr virtual_invalid_space{}; bool has_deleted_images = false; |