Skip to content

Detect unsampled writes to large mapped Vulkan textures - #2050

Open
lgr123 wants to merge 1 commit into
ProjectLeonida:mainfrom
lgr123:rt/large-mapped-texture-chunks
Open

lgr123 wants to merge 1 commit into
ProjectLeonida:mainfrom
lgr123:rt/large-mapped-texture-chunks

Conversation

@lgr123

@lgr123 lgr123 commented Nov 25, 2026

Copy link
Copy Markdown

Claimed as RT-TITLE-LARGE-MAPPED-SAMPLE-MISS. Coordination claim

What and why

The periodic full comparison only covers mapped textures up to 4 MiB. For a larger persistent CPU mapping, an ordinary store outside the fixed sample windows can leave the image unchanged indefinitely while the mapping stays readable and no explicit dirty event fires.

Track chunk hashes from the bytes used for the last accepted upload. Each refresh can audit one 256 KiB chunk, with round-robin turns across eligible mappings. A mismatch queues the existing priority upload. The audit reuses the guarded streaming copy into cached scratch for write-combined memory. Staged completion checks the live resource, source revision and submission state before publishing hashes. A late successful write to the same live resource leaves it dirty for a retry when its source or upload serial is stale.

Validation

  • Native Windows Release on the RTX 5070 with driver 621.24. The identical GPU fixture failed the new readback assertion on stock for both the ordered host copy and forced staged paths. With the change, both read back the new byte in the 8 MiB RGBA8 texture. The initial and sampled-write controls passed.
  • Native source-extraction tests passed coverage across three competing mappings, below-limit and notified-write controls, delayed staged completion after layout replacement, out-of-order acceptance and failed upload retry.
  • One 256 KiB audit took 82 µs median on cached memory and 137 µs median on write-combined memory over 21 interleaved batches. The respective p90s were 103 and 177 µs. A steady 8 MiB mapping was visited within 33 successful refresh passes in the single-mapping case.

The reproductions use generated texture data. The results establish the Vulkan texture update and readback behavior for this case. The contribution is independent of the existing full-scan optimization in #1705.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant