gpu: show a partly mapped texture from its first whole level (upstream 4828a79) #43

Manually merged
github merged 1 commit from github-bot/gh-43 into gh-pr/43/base 2026-12-05 18:48:12 +00:00 AGit
Owner

@⁠Kal0s-design on GitHub · 2026-12-05 16:57 UTC · original
Kal0s-design:port/partly-mapped-texture → main · +134 −3 · 3 files · 1 commits · merged 2026-12-05 18:46 UTC

This brings over upstream 4828a79 by SovietBearz0r unchanged, with the authorship kept.

A placed texture's smaller mip levels sit first in its memory and arrive first. The title's view names the more detailed levels whose memory isn't there yet, and those read as black until the texture is uploaded again about a second later, so buildings show up black and then correct. With this commit, while only part of a placed texture's memory is mapped, its view is clamped to the first level whose bytes are all there, and unclamped once the texture is whole. VICTORY_PARTLY_CLAMP=0 restores the old behaviour. It reuses the same view clamp the levels-on-demand tiles already use.

This may be part of the texture flicker described in #11, though I haven't confirmed that. It applies cleanly on main, the two tests it adds pass along with the existing resource and descriptor tests, and clippy reports nothing in the files it touches.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-12-05 16:57 UTC · [original](https://github.com/VGLALALA/ReVictory-RDNA3/pull/43) `Kal0s-design:port/partly-mapped-texture` → `main` · +134 −3 · 3 files · 1 commits · merged 2026-12-05 18:46 UTC This brings over upstream 4828a79 by SovietBearz0r unchanged, with the authorship kept. A placed texture's smaller mip levels sit first in its memory and arrive first. The title's view names the more detailed levels whose memory isn't there yet, and those read as black until the texture is uploaded again about a second later, so buildings show up black and then correct. With this commit, while only part of a placed texture's memory is mapped, its view is clamped to the first level whose bytes are all there, and unclamped once the texture is whole. VICTORY_PARTLY_CLAMP=0 restores the old behaviour. It reuses the same view clamp the levels-on-demand tiles already use. This may be part of the texture flicker described in #11, though I haven't confirmed that. It applies cleanly on main, the two tests it adds pass along with the existing resource and descriptor tests, and clippy reports nothing in the files it touches. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A placed texture's smaller levels lie first in its memory and arrive
first; the title's view names more detailed ones whose memory is not
there yet, and they read as black until the texture is uploaded again a
second later (buildings black, then right). When only part of a placed
texture's memory is mapped, its view is now clamped to the first level
whose bytes are all there, and unclamped again once the texture is whole
(VICTORY_PARTLY_CLAMP=0: off, as before).

The view clamp reuses tiles::show_from through resource::partly_shown,
the same path the levels-on-demand tiles use; the level itself is chosen
by resource::first_whole_level, the same per-level byte walk the upload
already uses. Ported from foxhound's VICTORY_PARTLY_CLAMP.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 16:58:36 +00:00
github-bot changed target branch from main to gh-pr/43/base 2026-12-05 18:47:54 +00:00
github manually merged commit fe60963389 into gh-pr/43/base 2026-12-05 18:48:12 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.