Keep a texture's slots current when the game finalizes another texture with the same parameters at its storage, which left streamed terrain heightmaps stale and drew those chunks at height zero, far below the ground (issue #453).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Martin
2026-11-11 01:18:11 -03:00
parent a7b8810d37
commit 1096efef12
6 changed files with 50 additions and 7 deletions

View File

@@ -149,7 +149,8 @@ NVN_API(nvnTextureBuilderGetStorageAlignment) {
// ---------- Textures
// The game re-initializes transient textures (G-buffer and the like) every frame at the same pool memory without
// registering the descriptor again, as an NVN descriptor refers to memory and stays valid on hardware. The table maps
// storage address -> a copy of the live texture so the back end can redirect a registration whose serial was finalized.
// storage address -> a copy of the live texture, which tells the back end a finalize whose storage another texture with
// the same parameters still holds (vk_backend.c vk_be_texture_release).
static nvn_hmap live = {.klen = 8};
static PlatMutex live_lock = PLAT_MUTEX_INIT;