diff options
author | Kyle Kienapfel <Docteh@users.noreply.github.com> | 2022-08-19 01:28:55 +0200 |
---|---|---|
committer | Kyle Kienapfel <Docteh@users.noreply.github.com> | 2022-08-20 01:08:40 +0200 |
commit | 14e9de6678dab47625826006f001d5e94dfb2716 (patch) | |
tree | ddb17512c52f678de96abf6dedf33a02b6a497ec /src/video_core/texture_cache | |
parent | Merge pull request #8685 from FearlessTobi/multiplayer-part2 (diff) | |
download | yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar.gz yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar.bz2 yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar.lz yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar.xz yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar.zst yuzu-14e9de6678dab47625826006f001d5e94dfb2716.zip |
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 12 | ||||
-rw-r--r-- | src/video_core/texture_cache/texture_cache_base.h | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index cf3ca06a6..1dbe01bc0 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -589,7 +589,7 @@ void TextureCache<P>::BlitImage(const Tegra::Engines::Fermi2D::Surface& dst, template <class P> typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView(VAddr cpu_addr) { // TODO: Properly implement this - const auto it = page_table.find(cpu_addr >> PAGE_BITS); + const auto it = page_table.find(cpu_addr >> YUZU_PAGEBITS); if (it == page_table.end()) { return nullptr; } @@ -1485,14 +1485,14 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { std::unordered_map<u64, std::vector<ImageId>, IdentityHash<u64>>& selected_page_table) { const auto page_it = selected_page_table.find(page); if (page_it == selected_page_table.end()) { - ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << YUZU_PAGEBITS); return; } std::vector<ImageId>& image_ids = page_it->second; const auto vector_it = std::ranges::find(image_ids, image_id); if (vector_it == image_ids.end()) { ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", - page << PAGE_BITS); + page << YUZU_PAGEBITS); return; } image_ids.erase(vector_it); @@ -1504,14 +1504,14 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { const auto page_it = page_table.find(page); if (page_it == page_table.end()) { - ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << YUZU_PAGEBITS); return; } std::vector<ImageMapId>& image_map_ids = page_it->second; const auto vector_it = std::ranges::find(image_map_ids, map_id); if (vector_it == image_map_ids.end()) { ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", - page << PAGE_BITS); + page << YUZU_PAGEBITS); return; } image_map_ids.erase(vector_it); @@ -1532,7 +1532,7 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) { ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) { const auto page_it = page_table.find(page); if (page_it == page_table.end()) { - ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); + ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << YUZU_PAGEBITS); return; } std::vector<ImageMapId>& image_map_ids = page_it->second; diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index e2f8f84c9..7e6c6cef2 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h @@ -47,7 +47,7 @@ struct ImageViewInOut { template <class P> class TextureCache { /// Address shift for caching images into a hash table - static constexpr u64 PAGE_BITS = 20; + static constexpr u64 YUZU_PAGEBITS = 20; /// Enables debugging features to the texture cache static constexpr bool ENABLE_VALIDATION = P::ENABLE_VALIDATION; @@ -178,8 +178,8 @@ private: template <typename Func> static void ForEachCPUPage(VAddr addr, size_t size, Func&& func) { static constexpr bool RETURNS_BOOL = std::is_same_v<std::invoke_result<Func, u64>, bool>; - const u64 page_end = (addr + size - 1) >> PAGE_BITS; - for (u64 page = addr >> PAGE_BITS; page <= page_end; ++page) { + const u64 page_end = (addr + size - 1) >> YUZU_PAGEBITS; + for (u64 page = addr >> YUZU_PAGEBITS; page <= page_end; ++page) { if constexpr (RETURNS_BOOL) { if (func(page)) { break; @@ -193,8 +193,8 @@ private: template <typename Func> static void ForEachGPUPage(GPUVAddr addr, size_t size, Func&& func) { static constexpr bool RETURNS_BOOL = std::is_same_v<std::invoke_result<Func, u64>, bool>; - const u64 page_end = (addr + size - 1) >> PAGE_BITS; - for (u64 page = addr >> PAGE_BITS; page <= page_end; ++page) { + const u64 page_end = (addr + size - 1) >> YUZU_PAGEBITS; + for (u64 page = addr >> YUZU_PAGEBITS; page <= page_end; ++page) { if constexpr (RETURNS_BOOL) { if (func(page)) { break; |