video_core: Page manager/region manager optimization (#3070)

* Bit array test

* Some corrections

* Fix AVX path on SetRange

* Finish bitArray

* Batched protect progress

* Inclusion fix

* Last logic fixes for BitArray

* Page manager: batch protect, masked ranges

* Page manager bitarray

* clang-format

* Fix out of bounds read

* clang

* clang

* Lock during callbacks

* Rename untracked to writeable

* Construct and mask in one step

* Sync on region mutex for thw whole protection

This is a temporary workarround until a fix is found for the page manager having issues when multiple threads update the same page at the same time.

* Bring back the gpu masking until properly handled

* Sync page manager protections

* clang-format

* Rename and fixups

* I fucked up clang-formatting one more time...

* kek
This commit is contained in:
Lander Gallastegi 2025-06-20 12:00:23 +02:00 committed by GitHub
parent e214ca6884
commit be12305f65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 781 additions and 361 deletions

View file

@ -6,6 +6,7 @@
#include <memory>
#include "common/alignment.h"
#include "common/types.h"
#include "video_core/buffer_cache//region_definitions.h"
namespace Vulkan {
class Rasterizer;
@ -28,9 +29,14 @@ public:
void OnGpuUnmap(VAddr address, size_t size);
/// Updates watches in the pages touching the specified region.
template <s32 delta>
template <bool track>
void UpdatePageWatchers(VAddr addr, u64 size) const;
/// Updates watches in the pages touching the specified region
/// using a mask.
template <bool track>
void UpdatePageWatchersForRegion(VAddr base_addr, RegionBits& mask) const;
/// Returns page aligned address.
static constexpr VAddr GetPageAddr(VAddr addr) {
return Common::AlignDown(addr, PAGE_SIZE);