diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-30 04:39:43 -0400 |
|---|---|---|
| committer | kraibse <33869366+kraibse@users.noreply.github.com> | 2026-10-30 17:27:04 +0100 |
| commit | 6380b6687ded27892404c576becd78b7161ba68a (patch) | |
| tree | 8bea08c159da4d6b2b6640dcb0b6b3527589f5d7 /src/video_core/texture_cache/texture_cache.h | |
| parent | f9fc1e10fd7ed0a1c4664d48d2f095ce8826d87b (diff) | |
nx2: give sparse regions memory only where the GPU writes
nx2:gpu 214 regions with the sparse flag (word 7 bit 0x200) are Mario
Kart World's terrain texture arrays and layer pools, 170 MB to 5.8 GB,
mostly empty. Backed whole they ran the graphics pool dry (26 "could not
allocate" per session, later regions without memory), and backing a
block at a time made the texture cache rebuild the 1.45 GB arrays each
time a block was mapped.
A sparse region now gets a device (SMMU) range of its own when it is
created, mapped for the GPU at once, so its GPU mapping never changes.
Before a GPU-side write lands in it (WriteBlock, Write<T>), the 4 MiB
blocks it touches get memory, cleared, behind their device pages.
Unbacked device pages read zero and drop writes instead of crashing, and
the unmapped-device-access errors are logged 16 times, not once per page.
nx2:gpu 215 releases the device range and the blocks after the GPU is
done with them. The log reports GPU-only memory in use and its peak.
Mario Kart World, 180 s: no allocation failures; ~2.8 GB of terrain
blocks get memory instead of 6.5 GB of whole regions, next to 3 GB of
ordinary GPU-only regions. Terrain renders as before.
Diffstat (limited to 'src/video_core/texture_cache/texture_cache.h')
0 files changed, 0 insertions, 0 deletions
