diff options
| author | Takoroka <137927095+Takoroka@users.noreply.github.com> | 2026-10-30 04:39:44 -0400 |
|---|---|---|
| committer | kraibse <33869366+kraibse@users.noreply.github.com> | 2026-10-30 17:27:04 +0100 |
| commit | 97ce27ab35153884d2fd05c278433928e429cd91 (patch) | |
| tree | dd5a6cbd9274931e44860182e91a78cfe1c2e6f7 /src/common | |
| parent | 6380b6687ded27892404c576becd78b7161ba68a (diff) | |
texture_cache: re-decode only the written layers of large ASTC arrays
Any write into an image marked all of it CPU-modified, so each terrain
tile Mario Kart World streams into its 8192x8192x68 ASTC arrays re-read
and re-decoded the whole 1.45 GB array: a 2 GiB staging buffer and a
full GPU wait each time, 15-16 GB of uploads per 600 frames.
Large layered images on the accelerated ASTC path (64 MiB and up) now
record the layers written since their last upload and stay tracked; a
refresh reads and decodes only those layers, one dispatch per layer and
level into a single-layer storage view. The texture cache's 600-frame
report counts uploads from guest memory, their size and how many went by
layer. Upload scratch buffers grown past 64 MiB for one huge image (341
MiB for the terrain layer pools) are freed at the next frame instead of
kept for the session.
Mario Kart World, 180 s: after loading, uploads drop from 15-16 GB to
0.2-0.5 GB per 600 frames, the largest from 1453 MiB to 2-15 MiB.
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/scratch_buffer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h index 929a65609a..cad1506922 100644 --- a/src/common/scratch_buffer.h +++ b/src/common/scratch_buffer.h @@ -122,6 +122,13 @@ public: return buffer_capacity; } + /// Frees the buffer; the next resize allocates it again. + void release() noexcept { + buffer.reset(); + buffer_capacity = 0; + last_requested_size = 0; + } + void swap(ScratchBuffer& other) noexcept { std::swap(last_requested_size, other.last_requested_size); std::swap(buffer_capacity, other.buffer_capacity); |
