fix(vk): flush custom UI texture staging before GPU use #1559

Merged
Arkex-ai merged 1 commit from fix/ui-texture-upload-visibility into main 2026-11-10 08:49:28 +00:00
Arkex-ai commented 2026-11-10 08:11:28 +00:00 (Migrated from github.com)

The custom ImGui texture uploader writes mapped sequential-write staging memory without flushing it. That allocation does not require HOST_COHERENT, so a font or logo upload can leave the GPU reading stale bytes on a noncoherent memory type, including partial atlas updates.

Flush the packed staging allocation after the final pixel write and before GPU use, through the existing VMA helper. VMA handles noncoherent alignment and coherent-memory behavior. Allocation, image layouts, descriptor publication, retries and deferred retirement stay as they are. This is Hookshot's custom texture path; the bundled ImGui vertex/index uploader maintains its own caches.

Validation at 967b6d3 on main ff69134:

  • Production pixels/upload/retirement code, pinned ImGui types and Vulkan headers:13 scenarios in both coherent/noncoherent cache models. Full RGBA/Alpha8, two dirty rectangles, fallback rectangle and untouched pixels are checked against independent expected bytes; four creation failures/retries and deferred destruction also pass.
  • Main passes coherent controls but fails six noncoherent creation/update cases. Four negative mutations fail by assertions. A positive control flushing after copy recording but before submission passes, since recording is not GPU execution.
  • Windows LLVM, Linux GCC and GCC AddressSanitizer/UndefinedBehaviorSanitizer pass. Broad Windows suite:228 passed/3 failed/20 skipped versus exact main227/3/20, with the same link-privilege and local compiler/Windows SDK header limitations; no new failures or weakened checks.
  • Official current-base guest generation and matching API12 host/backend build pass. Native FG2 private-checkpoint smoke: readable Graphics/Gameplay menus, maximize/restore, Auto/Small/Auto menu scale and menu reopen; two decoded RGB3440x1440 normal screenshots and exit0. Original saves are unchanged.

Native NVIDIA testing is a compatibility smoke, not reproduction on physically noncoherent hardware. HDR conversion, physical cache coherency and a campaign are not covered by this fixture. No demonstrated visual change is claimed on the coherent test GPU. See docs/ui-texture-upload.md; no game files, generated game code, captures or binaries are included.

Current-head validation

Current head 54af439, based on main be541fa. Earlier local/runtime results describe their recorded source hashes.

The standalone contribution patch is unchanged after the audited main refresh; exact-head build/source checks are refreshed below. Earlier runtime evidence remains tied to its recorded hash.

Fork runs are separate from upstream Actions approval; no maintainer approval gate is bypassed.

The custom ImGui texture uploader writes mapped sequential-write staging memory without flushing it. That allocation does not require HOST_COHERENT, so a font or logo upload can leave the GPU reading stale bytes on a noncoherent memory type, including partial atlas updates. Flush the packed staging allocation after the final pixel write and before GPU use, through the existing VMA helper. VMA handles noncoherent alignment and coherent-memory behavior. Allocation, image layouts, descriptor publication, retries and deferred retirement stay as they are. This is Hookshot's custom texture path; the bundled ImGui vertex/index uploader maintains its own caches. Validation at `967b6d3` on main `ff69134`: - Production pixels/upload/retirement code, pinned ImGui types and Vulkan headers:13 scenarios in both coherent/noncoherent cache models. Full RGBA/Alpha8, two dirty rectangles, fallback rectangle and untouched pixels are checked against independent expected bytes; four creation failures/retries and deferred destruction also pass. - Main passes coherent controls but fails six noncoherent creation/update cases. Four negative mutations fail by assertions. A positive control flushing after copy recording but before submission passes, since recording is not GPU execution. - Windows LLVM, Linux GCC and GCC AddressSanitizer/UndefinedBehaviorSanitizer pass. Broad Windows suite:228 passed/3 failed/20 skipped versus exact main227/3/20, with the same link-privilege and local compiler/Windows SDK header limitations; no new failures or weakened checks. - Official current-base guest generation and matching API12 host/backend build pass. Native FG2 private-checkpoint smoke: readable Graphics/Gameplay menus, maximize/restore, Auto/Small/Auto menu scale and menu reopen; two decoded RGB3440x1440 normal screenshots and exit0. Original saves are unchanged. Native NVIDIA testing is a compatibility smoke, not reproduction on physically noncoherent hardware. HDR conversion, physical cache coherency and a campaign are not covered by this fixture. No demonstrated visual change is claimed on the coherent test GPU. See `docs/ui-texture-upload.md`; no game files, generated game code, captures or binaries are included. <!-- goal15-current-validation --> ### Current-head validation Current head `54af439`, based on main `be541fa`. Earlier local/runtime results describe their recorded source hashes. The standalone contribution patch is unchanged after the audited main refresh; exact-head build/source checks are refreshed below. Earlier runtime evidence remains tied to its recorded hash. - [Linux AppImage](https://github.com/Arkex-ai/Hookshot/actions/runs/42783313895): in_progress. - [Windows builder](https://github.com/Arkex-ai/Hookshot/actions/runs/42783308050): in_progress. - [Game-free source regressions](https://github.com/Arkex-ai/Hookshot/actions/runs/42783304113): queued. Fork runs are separate from upstream Actions approval; no maintainer approval gate is bypassed.
Commenting is not possible because the repository is archived.
No description provided.