aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache/image_base.h
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-30 04:39:44 -0400
committerkraibse <33869366+kraibse@users.noreply.github.com>2026-10-30 17:27:04 +0100
commit97ce27ab35153884d2fd05c278433928e429cd91 (patch)
treedd5a6cbd9274931e44860182e91a78cfe1c2e6f7 /src/video_core/texture_cache/image_base.h
parent6380b6687ded27892404c576becd78b7161ba68a (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/video_core/texture_cache/image_base.h')
-rw-r--r--src/video_core/texture_cache/image_base.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/video_core/texture_cache/image_base.h b/src/video_core/texture_cache/image_base.h
index 47bab9617a..20d3883130 100644
--- a/src/video_core/texture_cache/image_base.h
+++ b/src/video_core/texture_cache/image_base.h
@@ -99,6 +99,9 @@ struct ImageBase {
u32 converted_size_bytes = 0;
u32 scale_rating = 0;
u32 host_level_offset = 0; ///< Guest mip level held by host mip 0 (see TrimmedLevels).
+ /// Large layered images uploaded by layer: one bit per layer written since the last upload
+ /// while CpuModified. Empty while CpuModified means the whole image.
+ std::vector<u64> dirty_layers;
u64 scale_tick = 0;
bool has_scaled = false;