Skip to content

D3D12.X: run title texture uploads on the submitting queue - #309

Draft
bmjask wants to merge 2 commits into
stack/036-kickoff-fail-closedfrom
stack/039-title-upload-page-mappings
Draft

bmjask wants to merge 2 commits into
stack/036-kickoff-fail-closedfrom
stack/039-title-upload-page-mappings

Conversation

@bmjask

@bmjask bmjask commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Stacked on #41.

This is an internal draft stack in bmjask/xcl; it is not an upstream merge request.

What and why

This unit isolates d3d12.x: run title texture uploads on the submitting queue as one reviewable step in the redesign.

What is in it

  • d5af039f is the cleaned-stack form of integrated commit cf2aa5e.
  • 8c6dd098 is the cleaned-stack form of integrated commit 0b8d53ef.

The patch content is preserved; only ancestry changed to omit a canceled add/revert sequence.

Tested

Tests were not rerun while packaging this already-integrated change into the draft stack.

Regression run

Not run during stack packaging.

Not tested

  • Windows MSVC build and test suite
  • D3D12 GPU execution
  • scripts/smoke.ps1 main/head comparison

AI use

Codex, GPT-5.6-sol, removed canceled ancestry, created the stack branch, and drafted this description. It did not author new code during stack packaging.

bmjask and others added 2 commits November 26, 2026 21:06
… CPU wait

title_textures::refresh runs on the title's thread before each of its
submits and uploaded the CPU's writes to its textures on XCL's own queue,
then waited on the CPU until the GPU had run them (texture::upload_batch).
While a retail title streams its world with video memory past the card,
those waits are long: thread dumps show its submit thread blocked in
fence::wait under refresh, presents drop to a few per 20 s, and the title's
watchdog ends it on the loading screen.

When the submitting queue is a DIRECT queue on the texture's device, the
upload list now runs on that queue, ahead of the title's lists, so the GPU
orders the copies before the work that samples them, with no cross-queue
wait. A fence on that queue retires each batch's allocator, list and staging
buffers at later submits; over 512 MB in flight the oldest batches are waited
for, and a batch whose wait fails or times out stays in flight. Compute and
copy queues, and a queue of another device, keep the upload queue and its
wait. texture::submit_batch is upload_batch without the wait.

Assisted-by: Codex (GPT-5.6-sol)
With uploads on the title's queue (the commit before), the copies of a
batch went out on that queue without the wait for texture page mappings
that XCL's own upload queue makes (vram::before_execute). A texture made
on another thread after refresh_once's wait, or its levels mapped just
before the upload by map_levels_with_texels, could then be copied into
tiles whose UpdateTileMappings had not run on the page queue yet.

On an RTX 3080 (driver 621.40) with a retail title that was a copy-engine
write page fault (DmaPageFaultWrite, EngineResetRequired, 4.6 ms before
VidSchErrorHardwarePageFault in a DxgKrnl trace) and a hung device
(0x887a0006 with nvlddmkm 153) in 3 of 4 runs of the world load; with
the wait, 0 of 7.

submit_on_title_queue now waits first, so every title-queue upload does.
The test fails without it (the queue never waits for the mapping).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Codex (GPT-5.6-sol)
@bmjask
bmjask force-pushed the stack/036-kickoff-fail-closed branch from 4c950c5 to aa52b61 Compare November 27, 2026 05:14
@bmjask
bmjask force-pushed the stack/039-title-upload-page-mappings branch from 187cb17 to 891750a Compare November 27, 2026 05:14
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.

1 participant