d3d12: title images use the staged upload on a device without host image copies (RT-TITLE-STAGED-NO-HOST-COPY) #1827
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1827
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1827/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@DadaCap on GitHub · 2026-11-25 12:41 UTC · original
DadaCap:title-staged-no-host-copy→main· +24 −5 · 3 files · 1 commits · merged 2026-11-25 14:37 UTCRT-TITLE-STAGED-NO-HOST-COPY, claimed and found in #1608.
What
A title image (a streamed or placed texture of the title's) is filled from the title's memory by one of two paths: a host image copy, or the staged upload (
TitleImageUpload).create_texturechose the staged path only for an image that could have used host copies (host_transfer_). WithoutVK_EXT_host_image_copyan image got neither:fill_title_texturereturned early becausehost_copy_now()is false, and the texture stayed zero for the whole run.Now, on a device without host copies, colour title images take the staged upload, linear placements (the movie planes) included. Devices with host copies behave as before. There is no memory type to compare with in this case, so any type the image allows is accepted.
Why
107844 changed, 0.0 MiB filled.host_image_copyoff a usable diagnostic (#1810), as QemmHD's runs suggest host image copies are involved in the world-start WRITE_INVALID. With this change and host copies off, the movie shows and a retail boot reached the first world frame (136 draws, 11,525 indirect draws, 2,118 dispatches) with no type 2 fault; the device is then lost at another place (details in #1608, n=1).This pull request does not turn host copies off for anyone.
Tests
d3d12_existing_heap_test: the mapped plane and mapped BC array cases also run on a device made without host copies. Negative check: without the change tod3d12_vulkan_device.cppthe test fails.main0d80bc5df:d3d12_existing_heap(and its two write-watch variants),d3d12_vulkan_device,d3d12_xmem_placed,d3d12_subresource_copy,d3d12_m2_texturedpass.ctestset, other GPUs, Linux.AI-assisted (Claude Code).
🤖 Generated with Claude Code
@ecox982745 on GitHub · 2026-11-25 12:47 UTC · original
Confirmed the staged upload on an RTX 4090 (Windows 11, NVIDIA 616.64) using GPU texture-to-buffer copies. I built the parent
0d80bc5dfand PRea6d535ffwith MSVC. The card exposes host image copy, so I could setVulkanDeviceInfo.host_image_copy = falseand run the enabled control on the same hardware.Each count is the number of subresources whose GPU readback matched the expected bytes. On the PR, setting
LEONIDA_TITLE_IMAGE_STAGING=0with host copies disabled reproduced the 0/21 initial result. Restoring default staging passed all three submissions again in a fresh process.The synthetic fixture extends
check_mapped_bc_arrayto a 140×76 BC7 texture with three array slices and seven mips. It fills each subresource with a distinct byte pattern, then rewrites only mip 3 of slice 2 and notifies the runtime of the mapped write. Each submission usesCopyTextureRegionto copy all 21 subresources into a readback buffer, waits on a fence, and checks all 43,632 payload bytes, excluding row padding. This also checks that the other 20 subresources survive the sparse update.The three existing heap CTests (default, write watch off, write watch on) passed on the PR. This run covers texture upload and readback. It did not exercise a retail boot or the world-start device loss. AI-assisted verification with OpenAI Codex.
@DadaCap on GitHub · 2026-11-25 12:59 UTC · original
Thank you for the GPU readback check: that covers the array, mip and sparse-rewrite cases that my two test cases do not. AI-assisted (Claude Code).
@madvillain91 on GitHub · 2026-11-25 13:51 UTC · original · reviewed
Independent NVIDIA Ampere data point on Windows 11 26H2 (26300.9711) at
ea6d535ffagainst main384abe5b0(PR base98c2f7777), using VS 2022 Build Tools (MSVC 19.44.35230.0, RelWithDebInfo, Ninja), Vulkan SDK 1.4.363.0, and NVIDIA GeForce RTX 3070 Ti (driver 617.14, Vulkan 1.4.351;hostImageCopy = true,identicalMemoryTypeRequirements = false).All targeted GPU tests passed with
LEONIDA_VK_VALIDATION=1and 0 VUIDs:d3d12_existing_heap_test(including the newhost_image_copy = falsestagedcheck_mapped_planeandcheck_mapped_bc_arraypaths): passed, 0 VUIDsd3d12_existing_heap_test(LEONIDA_EXISTING_HEAP_WRITE_WATCH=0and=1): 2/2 passedd3d12_subresource_copy_test: passed, 0 VUIDsd3d12_m2_textured_test: passed, 0 VUIDsNot checked: retail boot or full
ctestsuite. LGTM.AI-assisted verification.
@DadaCap on GitHub · 2026-11-25 13:55 UTC · original
Thank you @madvillain91, the validation layer run is what I had not done: 0 VUIDs on Ampere for the staged paths is good to have. One note on the write-watch variants: the variable the tests read is
LEONIDA_WRITE_WATCH(runtime/CMakeLists.txt); I find noLEONIDA_EXISTING_HEAP_WRITE_WATCHin the tree, so if that was the name used, both variants ran the default.ctest -R existing_heapsets it. AI-assisted (Claude Code).@Timon360SB on GitHub · 2026-11-25 14:30 UTC · original
Independent verification — Turing and Blackwell
0d80bc5df7c873f40965f34f185cb96913786765ea6d535ff5831c81bec75505bfc190142296579dEnvironment
NVIDIA 621.14, Vulkan SDK 1.4.363.0, MSVC 19.44.35230, Ninja RelWithDebInfo.
Three repetitions per GPU, revision and validation mode. Validated runs requested core, GPU-assisted and synchronization validation.
Results
d3d12_existing_heapd3d12_existing_heap_no_write_watchd3d12_existing_heap_write_watchd3d12_vulkan_deviced3d12_xmem_placedd3d12_subresource_copyd3d12_m2_textured168 executions: 168 passed, 0 failed, 0 skipped.
Findings
The results support the staged-upload fix and show no regressions in the selected tests on either GPU. No separate negative-control experiment or full-suite regression was performed.
Synthetic tests only. No game files used.
AI-assisted: yes.
@aslan2142 on GitHub · 2026-11-25 14:38 UTC · original
Merged. Thank you, @DadaCap, and thanks to the RTX 3070 Ti and RTX 4090 testers for the read-backs.
TitleImageUploadwith the same conversion and the same barriers, and staging memory stays bounded.main: nothing goes from pass to fail; the title-image and texture tests pass on both.main71a769d7d+ea6d535ff: it merges cleanly; the semantic suite passes (489 files, 6,288 tests, 0 files failed); the 14 docs and writer tests pass;check_no_game_data.pyis clean on the 3 changed files.AI-assisted (Claude Code, Claude Opus 5.5).
@DadaCap on GitHub · 2026-11-25 14:51 UTC · original
Thank you @aslan2142, and everyone who tested. The follow-up you name is right: a device with host copies that refuses them for one format still fills that format's title images with neither path. I won't claim it now; whoever wants it can take it. AI-assisted (Claude Code).