summaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/texture_cache.h12
-rw-r--r--src/video_core/texture_cache/texture_cache_base.h10
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,
589template <class P> 589template <class P>
590typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView(VAddr cpu_addr) { 590typename P::ImageView* TextureCache<P>::TryFindFramebufferImageView(VAddr cpu_addr) {
591 // TODO: Properly implement this 591 // TODO: Properly implement this
592 const auto it = page_table.find(cpu_addr >> PAGE_BITS); 592 const auto it = page_table.find(cpu_addr >> YUZU_PAGEBITS);
593 if (it == page_table.end()) { 593 if (it == page_table.end()) {
594 return nullptr; 594 return nullptr;
595 } 595 }
@@ -1485,14 +1485,14 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) {
1485 std::unordered_map<u64, std::vector<ImageId>, IdentityHash<u64>>& selected_page_table) { 1485 std::unordered_map<u64, std::vector<ImageId>, IdentityHash<u64>>& selected_page_table) {
1486 const auto page_it = selected_page_table.find(page); 1486 const auto page_it = selected_page_table.find(page);
1487 if (page_it == selected_page_table.end()) { 1487 if (page_it == selected_page_table.end()) {
1488 ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); 1488 ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << YUZU_PAGEBITS);
1489 return; 1489 return;
1490 } 1490 }
1491 std::vector<ImageId>& image_ids = page_it->second; 1491 std::vector<ImageId>& image_ids = page_it->second;
1492 const auto vector_it = std::ranges::find(image_ids, image_id); 1492 const auto vector_it = std::ranges::find(image_ids, image_id);
1493 if (vector_it == image_ids.end()) { 1493 if (vector_it == image_ids.end()) {
1494 ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", 1494 ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}",
1495 page << PAGE_BITS); 1495 page << YUZU_PAGEBITS);
1496 return; 1496 return;
1497 } 1497 }
1498 image_ids.erase(vector_it); 1498 image_ids.erase(vector_it);
@@ -1504,14 +1504,14 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) {
1504 ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) { 1504 ForEachCPUPage(image.cpu_addr, image.guest_size_bytes, [this, map_id](u64 page) {
1505 const auto page_it = page_table.find(page); 1505 const auto page_it = page_table.find(page);
1506 if (page_it == page_table.end()) { 1506 if (page_it == page_table.end()) {
1507 ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); 1507 ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << YUZU_PAGEBITS);
1508 return; 1508 return;
1509 } 1509 }
1510 std::vector<ImageMapId>& image_map_ids = page_it->second; 1510 std::vector<ImageMapId>& image_map_ids = page_it->second;
1511 const auto vector_it = std::ranges::find(image_map_ids, map_id); 1511 const auto vector_it = std::ranges::find(image_map_ids, map_id);
1512 if (vector_it == image_map_ids.end()) { 1512 if (vector_it == image_map_ids.end()) {
1513 ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}", 1513 ASSERT_MSG(false, "Unregistering unregistered image in page=0x{:x}",
1514 page << PAGE_BITS); 1514 page << YUZU_PAGEBITS);
1515 return; 1515 return;
1516 } 1516 }
1517 image_map_ids.erase(vector_it); 1517 image_map_ids.erase(vector_it);
@@ -1532,7 +1532,7 @@ void TextureCache<P>::UnregisterImage(ImageId image_id) {
1532 ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) { 1532 ForEachCPUPage(cpu_addr, size, [this, image_id](u64 page) {
1533 const auto page_it = page_table.find(page); 1533 const auto page_it = page_table.find(page);
1534 if (page_it == page_table.end()) { 1534 if (page_it == page_table.end()) {
1535 ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << PAGE_BITS); 1535 ASSERT_MSG(false, "Unregistering unregistered page=0x{:x}", page << YUZU_PAGEBITS);
1536 return; 1536 return;
1537 } 1537 }
1538 std::vector<ImageMapId>& image_map_ids = page_it->second; 1538 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 {
47template <class P> 47template <class P>
48class TextureCache { 48class TextureCache {
49 /// Address shift for caching images into a hash table 49 /// Address shift for caching images into a hash table
50 static constexpr u64 PAGE_BITS = 20; 50 static constexpr u64 YUZU_PAGEBITS = 20;
51 51
52 /// Enables debugging features to the texture cache 52 /// Enables debugging features to the texture cache
53 static constexpr bool ENABLE_VALIDATION = P::ENABLE_VALIDATION; 53 static constexpr bool ENABLE_VALIDATION = P::ENABLE_VALIDATION;
@@ -178,8 +178,8 @@ private:
178 template <typename Func> 178 template <typename Func>
179 static void ForEachCPUPage(VAddr addr, size_t size, Func&& func) { 179 static void ForEachCPUPage(VAddr addr, size_t size, Func&& func) {
180 static constexpr bool RETURNS_BOOL = std::is_same_v<std::invoke_result<Func, u64>, bool>; 180 static constexpr bool RETURNS_BOOL = std::is_same_v<std::invoke_result<Func, u64>, bool>;
181 const u64 page_end = (addr + size - 1) >> PAGE_BITS; 181 const u64 page_end = (addr + size - 1) >> YUZU_PAGEBITS;
182 for (u64 page = addr >> PAGE_BITS; page <= page_end; ++page) { 182 for (u64 page = addr >> YUZU_PAGEBITS; page <= page_end; ++page) {
183 if constexpr (RETURNS_BOOL) { 183 if constexpr (RETURNS_BOOL) {
184 if (func(page)) { 184 if (func(page)) {
185 break; 185 break;
@@ -193,8 +193,8 @@ private:
193 template <typename Func> 193 template <typename Func>
194 static void ForEachGPUPage(GPUVAddr addr, size_t size, Func&& func) { 194 static void ForEachGPUPage(GPUVAddr addr, size_t size, Func&& func) {
195 static constexpr bool RETURNS_BOOL = std::is_same_v<std::invoke_result<Func, u64>, bool>; 195 static constexpr bool RETURNS_BOOL = std::is_same_v<std::invoke_result<Func, u64>, bool>;
196 const u64 page_end = (addr + size - 1) >> PAGE_BITS; 196 const u64 page_end = (addr + size - 1) >> YUZU_PAGEBITS;
197 for (u64 page = addr >> PAGE_BITS; page <= page_end; ++page) { 197 for (u64 page = addr >> YUZU_PAGEBITS; page <= page_end; ++page) {
198 if constexpr (RETURNS_BOOL) { 198 if constexpr (RETURNS_BOOL) {
199 if (func(page)) { 199 if (func(page)) {
200 break; 200 break;