Stop the red flashing by showing the picture the game's post pass really writes.

The scene upscaler's stand-in took the RGB9E5 texture at the picture's address, but that is a separate image nothing renders into, so it showed stale or uninitialised memory, which flashed red. The stand-in now finds the image at that address that was written as raw RGB9E5 words this frame, looked up live because a remembered image may be gone by then, and shows that one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
epicmeme546
2026-11-09 11:58:47 -05:00
parent 78ee0ddb1e
commit 26eb249026
3 changed files with 29 additions and 8 deletions

View File

@@ -2387,6 +2387,13 @@ static int owned_dirty(uint64_t addr, uint64_t size, Tex **hit) {
return n;
}
const VkTexImage *vk_texture_at_locked(const VkTexImage *img, VkFormat format) {
for (Tex *p = nvn_hm_get(&by_addr, &((Tex *)img)->key.addr); p; p = p->next_at)
if (!p->released && p->pub.format == format && p->pub.width == img->width && p->pub.height == img->height)
return &p->pub;
return NULL;
}
// A storage image may be written by the shaders of the submission being recorded (texture lock held, vk_exec_draw.c
// tex_info). Its storage is not marked GPU-owned: only the write fence for ReadTexels.
void vk_texture_storage_bound_locked(const VkTexImage *img) {