Skip to content

fix(vk): publish texture staging slices before GPU reads - #1672

Merged
NotRexed merged 2 commits into
NotRexed:mainfrom
Arkex-ai:fix/texture-staging-publication
Nov 10, 2026
Merged

NotRexed merged 2 commits into
NotRexed:mainfrom
Arkex-ai:fix/texture-staging-publication

Conversation

@Arkex-ai

@Arkex-ai Arkex-ai commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Mapped texture staging is not required to be coherent, but the ASTC gather and CPU-converted upload paths did not flush their writes before GPU reads. A separate CPU/device-cache fixture reproduces stale submitted bytes on the noncoherent path while the coherent control passes.

This publishes each completed staging slice using its VMA allocation and allocation-relative offset/size. Slice starts also respect nonCoherentAtomSize, so a rounded flush does not share an atom with another slice already consumed by a parallel segment. CPU publication follows conversion-worker joins; ASTC publication follows layer gathering, before decoder commands. Arena lifetime, allocation policy, upload routing, format conversions and the renderer ABI are unchanged; no additional queue wait is introduced.

Validation at 62aa0079c82b5ad73f3fb0284d6a1f1c0811cf8d, based on main 1a429f6a84e3dd53fd4304e85abd0356da4164ca. The fixture uses its own namespace for native Windows CRT compatibility; no assertions or compiler warnings are disabled.

  • 14 game-free coherent/noncoherent cases pass Windows LLVM, Linux GCC and GCC ASan/UBSan. They execute actual staging, the allocation-range helper, ASTC gather/publication prefix and CPU publication/copy-description region. Full CPU converters and decoder shaders are outside this fixture.
  • Six behavioral mutations are rejected: omitted ASTC/CPU publication, wrong offset, partial range, shared atoms and lost allocation ownership.
  • Full Windows suite: 239 passed / 2 failed / 20 skipped, versus current main 238 / 2 / 20. Both have the same local NUP symlink-privilege and missing-Windows-SDK precompile-guard failures.
  • Official API12 standalone host/backend build succeeds using a fresh official guest generation on this main after its host/lifter changes. No generated game source is edited.
  • Exact-head isolated native serial and parallel/batch checkpoint runs with FG2x both exit0, produce valid3440x1440 captures and survive maximize/restore. Original saves/settings are preserved.
  • Exact-head fork CI: source regressions, Windows builder, and Linux AppImage all succeeded. Fork checks do not replace upstream review/required checks.

Limits: this is an authored cache-model reproduction, not a physical noncoherent GPU reproduction, performance measurement or campaign test. Earlier forced CPU/RGBA8 runs at 4cd6911 showed missing textures; an official unmodified d448ccc build reproduced missing textures under the same forced configuration. That comparison is recorded as an existing visual limitation, not a healthy CPU visual pass or pixel equivalence, and is not relabeled as current-head runtime evidence. Current-head native smoke uses default texture routing.

Overlap checked by actual diff/head: #1514 owns small-arena fallback and mapless rollback, #1541 adds staging diagnostics, and #1130 partitions ASTC uploads. This change preserves those separate behaviors. No game files, generated game code, binaries, saves or private runtime artifacts are included.

Arkex-ai added 2 commits November 10, 2026 10:02
Flush CPU-converted and ASTC upload slices through allocation-relative ranges and keep concurrent slices on distinct noncoherent atoms.

Assisted-by: GPT-6 (OpenAI)
Keep source-extracted locals such as y0 inside the fixture namespace so the native Windows Clang runner does not collide with CRT Bessel functions.

Assisted-by: GPT-6 (OpenAI)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants