runtime: fall back to staging copies when a HOST_TRANSFER image has no memory type (OLD-4682) #1364
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!1364
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1364/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?
@qhukz13 on GitHub · 2026-11-24 22:35 UTC · original
qhukz13:cont/old-4682→main· +81 −17 · 5 files · 3 commits · merged 2026-11-24 23:15 UTCClaimed in the coordination issue as: OLD-4682 (claim)
Carries #37 (
old-pr/4682, TEST-995) onto currentmain. The three commits are cherry-picked unchanged with theirauthors: ray3242 (the fallback), Gustavo Rafael Schmidt (the forced retry the tests use) and Rayhan Robin (log
wording, stale doc row). The only conflict was in
docs/testing.md, where the first commit added a row about theresource-heap-tier-1 comparison that the third commit removes again; the row is left out. #37 can be closed when
this lands.
What and why
On NVIDIA Pascal, a texture in a CPU-visible heap (CUSTOM write-back or write-combine, L0) is a texture the CPU reads
and writes with
WriteToSubresource/ReadFromSubresource. The layer creates it withVK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXTwhen the format reportsVK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT;vkCreateImagesucceeds, butvkGetImageMemoryRequirementsthen returnsmemoryTypeBits = 0, so no memory typecan back it and
CreateCommittedResourceanswersE_OUTOFMEMORYwhere D3D12 creates the texture. The same imagewithout host-transfer usage takes device-local memory (
memoryTypeBits = 0x82on the card below).Resource::create_texturenow remakes such an unbound image without host-transfer usage and continues on thestaging-copy path, the one a device without
VK_EXT_host_image_copyalready uses. A failedvkCreateImageleavesimage_null.VulkanDeviceInfo::force_host_transfer_retryletsd3d12_vulkan_device_testandd3d12_subresource_copy_testtake this branch on any GPU (their third CPU-copy path), so it is covered where thedriver does not reproduce it.
Tested
GeForce GTX 1050 Ti 4 GB (Pascal, no Resizable BAR), NVIDIA 582.66, Windows 10 Pro 19045, MSVC (VS 2022 Build
Tools), RelWithDebInfo.
mainat4a50cafc7against this branch, each test run 3 times(
ctest --repeat until-fail:3):maind3d12_subresource_copyCPU copies (host image copy): the steps differ from the host's)d3d12_heap_properties,committed texture, CUSTOM write-back L0andwrite-combine L0ours 0x8007000e host 0x0d3d12_vulkan_device, the CPU-heap texture (line 174) and the CPU copies (line 7046)WriteToSubresource/ReadFromSubresource (staging copy): ... matchedThe layer logs
host-transfer image has no memory type; using staging copies, format 37(and format 133) on thiscard.
root_sigandd3d12_state_sweepfail identically on both sides (this Windows 10 runtime refuses theper-face stencil pipelines the layer accepts). Still failing on both, and not part of this PR: the
resource-heap-tier-1 comparisons,
ALLOW_ALLheaps ind3d12_heap_propertiesandheap_mismatches(line 7330) ind3d12_vulkan_device; onmainthe latter is not reached because the test stops at the CPU-heap texture first.#37 also lists independent runs on a GTX 1060 6 GB (582.78), a GTX 1070 (581.80), a GTX 1050 Ti (560.94), an
RTX 3080 Ti and an RTX 3080, on its original base.
GPUs tested: NVIDIA GeForce GTX 1050 Ti, driver 582.66, Windows 10 19045. No game files.
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.docs/design.md. (No translator change; the behaviour isdocumented in
docs/d3d12_vulkan.md.)🤖 Generated with Claude Code
@aslan2142 on GitHub · 2026-11-24 23:15 UTC · original
Merged. Thanks for carrying this forward with the original authors kept on their commits.
OLD-4682was posted at 22:34 UTC, a minute before this PR, and is unedited. Nobody else had claimed it.old-pr/4682: the added and removed lines are identical. The only difference is thedocs/testing.mdrow that one commit added and a later one removed.host_transfer_in the one function that does them. A real allocation failure still returnsE_OUTOFMEMORYafter the single retry. Nothing changes where host copies work.main28a32e190+ this PR against thatmain: no test changed state on either device.d3d12_subresource_copyandd3d12_vulkan_devicepass on both; on the iGPU all three copy paths ran (host image copy, staging, and the forced fallback) with 0 mismatches in 109 steps each.maind9f0a98e1+c3c5c8275: it merges cleanly; the 13 docs and writer tests pass;check_no_game_data.pyis clean on the 5 changed files. The merges intomainsince that suite run do not touch the files this PR changes.A small follow-up if you like: the new
docs/d3d12_vulkan.mdrow says driver 582.78 for the GTX 1050 Ti, while the run in the description was on 582.66.#37, the carried-over draft of the same patch, is closed in favour of this one.
AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).