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

@@ -234,6 +234,11 @@ int vk_pool_map_virtual(pool_t *v, int n, const void *requests); // nvn_mappi
void vk_texture_register(int id, const tex_t *t, const view_t *v); // texture descriptor slot (copied)
void vk_sampler_register(int id, const samp_par *s); // sampler descriptor slot (copied)
void vk_texture_release(const tex_t *t); // TextureFinalize: the image stays for slots that still name its storage
// As vk_texture_release, for the slots registered up to mark (vk_texture_reg_mark when the game finalized the texture):
// later registrations stay current.
void vk_texture_release_at(const tex_t *t, uint32_t mark);
uint32_t vk_texture_reg_mark(void); // the serial of the latest slot registration
int vk_texture_same_key(const tex_t *a, const tex_t *b); // the same storage, descriptor and layout: one image
void vk_read_texels(const tex_t *t, const view_t *v, const NVNcopyRegion *r, uint8_t *dst, uint64_t row, uint64_t img);
void vk_write_texels(const tex_t *t, const view_t *v, const NVNcopyRegion *r, const uint8_t *src, uint64_t row, uint64_t img);
void vk_guest_written(uint64_t addr, uint64_t size); // a host write write-watch may miss: textures there re-upload