mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #1364] [MERGED] runtime: fall back to staging copies when a HOST_TRANSFER image has no memory type (OLD-4682) #1394
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1394
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1364
Author: @qhukz13
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:cont/old-4682📝 Commits (3)
7eb642aruntime: fall back to staging copies when a HOST_TRANSFER image has no memory typebd53fceRuntime: port #3077's forced host-transfer retry into the staging fallbackc3c5c82d3d12: drop the stale tier-1 doc row and keep fallback logs honest📊 Changes
5 files changed (+81 additions, -17 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+6 -0)📝
runtime/shims/d3d12_com.h(+3 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+41 -7)📝
runtime/test/d3d12_subresource_copy_test.cpp(+14 -4)📝
runtime/test/d3d12_vulkan_device_test.cpp(+17 -6)📄 Description
Claimed 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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.