[PR #3070] [MERGED] video_core: Page manager/region manager optimization #3195

Closed
opened 2026-02-27 22:02:47 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3070
Author: @LNDF
Created: 6/9/2025
Status: Merged
Merged: 6/20/2025
Merged by: @georgemoralis

Base: mainHead: memory-tracker


📝 Commits (10+)

📊 Changes

10 files changed (+786 additions, -366 deletions)

View changed files

📝 CMakeLists.txt (+4 -2)
src/common/bit_array.h (+411 -0)
📝 src/video_core/buffer_cache/buffer_cache.h (+1 -1)
📝 src/video_core/buffer_cache/memory_tracker.h (+1 -1)
src/video_core/buffer_cache/region_definitions.h (+28 -0)
src/video_core/buffer_cache/region_manager.h (+208 -0)
src/video_core/buffer_cache/word_manager.h (+0 -296)
📝 src/video_core/page_manager.cpp (+123 -62)
📝 src/video_core/page_manager.h (+7 -1)
📝 src/video_core/texture_cache/texture_cache.cpp (+3 -3)

📄 Description

Rewrite parts of the page manager and region manager to be faster

Use a bit array that uses AVX to accelerate.
Also tries to batch mprotects in the same region (another pr is needed to take advantage of this)

I have done zero testing right now with this and i rewrote parts of the memory tracker so there is a very high chance I broke something.

This is part of a series of PR with the hope of improving performance of games that use DMA, since it is currently quite slow (mainly because the ammount of memory protections and synced buffers).


🔄 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/3070 **Author:** [@LNDF](https://github.com/LNDF) **Created:** 6/9/2025 **Status:** ✅ Merged **Merged:** 6/20/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `memory-tracker` --- ### 📝 Commits (10+) - [`ab20598`](https://github.com/shadps4-emu/shadPS4/commit/ab20598c99fb5a4f160408c0b869602e1816faea) Bit array test - [`331e366`](https://github.com/shadps4-emu/shadPS4/commit/331e3661a16e08514bc07bfdde994cae6f2cd714) Some corrections - [`3c4dce5`](https://github.com/shadps4-emu/shadPS4/commit/3c4dce5418a87fd2b82207e2994834b422578a98) Fix AVX path on SetRange - [`0a11c48`](https://github.com/shadps4-emu/shadPS4/commit/0a11c4869340dcae00787efc56382780ea7a4b9a) Finish bitArray - [`cfad5c9`](https://github.com/shadps4-emu/shadPS4/commit/cfad5c9596b1620925791cc19c94c9b195161a2a) Batched protect progress - [`bf10666`](https://github.com/shadps4-emu/shadPS4/commit/bf106665785f0d4656444e1ca3aca53b4ead29f0) Inclusion fix - [`14a33d3`](https://github.com/shadps4-emu/shadPS4/commit/14a33d35a2fd1e4aa996205b545ffa0e562276d3) Last logic fixes for BitArray - [`2fc62b5`](https://github.com/shadps4-emu/shadPS4/commit/2fc62b5b5fa42f39c1a01c040eb48b026b891434) Page manager: batch protect, masked ranges - [`6b60a85`](https://github.com/shadps4-emu/shadPS4/commit/6b60a8515f71b0502bbd3a551c86d0a737b22c3c) Page manager bitarray - [`ed1e3c5`](https://github.com/shadps4-emu/shadPS4/commit/ed1e3c56efd8399e9c4a818ea0cd0cefd292bfd4) clang-format ### 📊 Changes **10 files changed** (+786 additions, -366 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+4 -2) ➕ `src/common/bit_array.h` (+411 -0) 📝 `src/video_core/buffer_cache/buffer_cache.h` (+1 -1) 📝 `src/video_core/buffer_cache/memory_tracker.h` (+1 -1) ➕ `src/video_core/buffer_cache/region_definitions.h` (+28 -0) ➕ `src/video_core/buffer_cache/region_manager.h` (+208 -0) ➖ `src/video_core/buffer_cache/word_manager.h` (+0 -296) 📝 `src/video_core/page_manager.cpp` (+123 -62) 📝 `src/video_core/page_manager.h` (+7 -1) 📝 `src/video_core/texture_cache/texture_cache.cpp` (+3 -3) </details> ### 📄 Description Rewrite parts of the page manager and region manager to be faster Use a bit array that uses AVX to accelerate. Also tries to batch mprotects in the same region (another pr is needed to take advantage of this) I have done zero testing right now with this and i rewrote parts of the memory tracker so there is a very high chance I broke something. This is part of a series of PR with the hope of improving performance of games that use DMA, since it is currently quite slow (mainly because the ammount of memory protections and synced buffers). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:02:47 +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#3195
No description provided.