Compare textures up to 8 MiB by content before uploading them a second time, by default.

A texture whose pages show a write is uploaded again unless a hash of its bytes says they are the same. The hash
covered textures up to 64 KiB; for larger ones it was a switch left off until measured in play (tex_same_big). A
run through Hyrule Field measured it (RTX 5090, about three minutes of running): without it 44,000 to 52,000 second
uploads of 33 to 47 GiB of storage in four runs of six, one 1536x1536 texture 29 times within 300 frames with the
same bytes each time, and 66 thousand million texels decoded on the GPU in a run; with it 214 to 592 second uploads,
24 GiB found unchanged, and 20 to 24 thousand million texels decoded, which is the first uploads. The GPU's upload
work fell from 0.41 to 0.14 ms a frame, and the second uploads' 2.9 s of the submitting thread are gone for about
as much hashing.

tex_same_big = 0 hashes only the small ones, as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-14 08:33:06 -05:00
parent 87bb179c78
commit 5eef43742d
4 changed files with 26 additions and 10 deletions

View File

@@ -30,6 +30,11 @@ cards).
on a run through Hyrule Field at 5120x2160 with DLSS Performance on an RTX 5090: 13.2 GB in use on average where
it was 16.7, 13.8 at most where it was 17.9, at the same frame rate. An 8 GB card keeps 384 MB of such textures
where it kept up to 1.9 GB.
- **Textures the game writes again with the same content are no longer decoded a second time.** Running through
Hyrule Field the game rewrites texture memory with the bytes it already holds; textures over 64 KB were then
uploaded and decoded again each time, one of them 29 times in five seconds. On the same run that was 49,660 second
uploads in three minutes, now 214, and the graphics card's upload work fell from 0.41 to 0.14 ms a frame
(`tex_same_big = 0` brings the old behaviour back for a comparison).
## Removed