[PR #1726] [MERGED] cache: Invalidate pages for file reads. #2263

Closed
opened 2026-02-27 21:15:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1726
Author: @squidbus
Created: 12/10/2024
Status: Merged
Merged: 12/11/2024
Merged by: @raphaelthegreat

Base: mainHead: file-read


📝 Commits (5)

  • 6eee20e cache: Invalidate pages for file reads.
  • 76cd906 texture_cache: Simplify invalidate intersection check.
  • 0782008 vk_rasterizer: Make aware of mapped memory ranges.
  • 1178c14 buffer_cache: Remove redundant page calculations.
  • 6f79221 file_system: Simplify memory invalidation and add a few missed cases.

📊 Changes

10 files changed (+74 additions, -60 deletions)

View changed files

📝 src/core/libraries/kernel/file_system.cpp (+19 -10)
📝 src/core/libraries/kernel/file_system.h (+3 -0)
📝 src/core/libraries/kernel/kernel.cpp (+2 -24)
📝 src/core/memory.cpp (+6 -0)
📝 src/core/memory.h (+2 -0)
📝 src/video_core/page_manager.cpp (+8 -13)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+19 -3)
📝 src/video_core/renderer_vulkan/vk_rasterizer.h (+3 -1)
📝 src/video_core/texture_cache/texture_cache.cpp (+11 -8)
📝 src/video_core/texture_cache/texture_cache.h (+1 -1)

📄 Description

  • Updates the cache invalidation logic to accept an arbitrary region of memory and handle figuring out the pages to invalidate locally.
  • Adds logic to file reads to invalidate the target memory before reading, as otherwise the read calls will fail instead of triggering the usual invalidation logic. This causes infinite loops on games like NieR:Automata.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1726 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 12/10/2024 **Status:** ✅ Merged **Merged:** 12/11/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `file-read` --- ### 📝 Commits (5) - [`6eee20e`](https://github.com/shadps4-emu/shadPS4/commit/6eee20eac589a6843282e9ba14911695d3bd75a1) cache: Invalidate pages for file reads. - [`76cd906`](https://github.com/shadps4-emu/shadPS4/commit/76cd906b7f67fdca7e9b7fc2fbbf3f35aeb309ca) texture_cache: Simplify invalidate intersection check. - [`0782008`](https://github.com/shadps4-emu/shadPS4/commit/07820081ecadbe9a82e697ceb5b7ecd68faa5596) vk_rasterizer: Make aware of mapped memory ranges. - [`1178c14`](https://github.com/shadps4-emu/shadPS4/commit/1178c14e0cc3b7edf48b05af5044b1e62f7048e5) buffer_cache: Remove redundant page calculations. - [`6f79221`](https://github.com/shadps4-emu/shadPS4/commit/6f79221ba027409d77446a39303209b758afeb15) file_system: Simplify memory invalidation and add a few missed cases. ### 📊 Changes **10 files changed** (+74 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/file_system.cpp` (+19 -10) 📝 `src/core/libraries/kernel/file_system.h` (+3 -0) 📝 `src/core/libraries/kernel/kernel.cpp` (+2 -24) 📝 `src/core/memory.cpp` (+6 -0) 📝 `src/core/memory.h` (+2 -0) 📝 `src/video_core/page_manager.cpp` (+8 -13) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+19 -3) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.h` (+3 -1) 📝 `src/video_core/texture_cache/texture_cache.cpp` (+11 -8) 📝 `src/video_core/texture_cache/texture_cache.h` (+1 -1) </details> ### 📄 Description * Updates the cache invalidation logic to accept an arbitrary region of memory and handle figuring out the pages to invalidate locally. * Adds logic to file reads to invalidate the target memory before reading, as otherwise the read calls will fail instead of triggering the usual invalidation logic. This causes infinite loops on games like NieR:Automata. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2263
No description provided.