mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:10:52 +01:00
[PR #37] [CLOSED] runtime: fall back to staging copies when a HOST_TRANSFER image has no memory type (TEST-995) #90
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#90
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/37
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed
Base:
main← Head:old-pr/4682📝 Commits (3)
9c69b41runtime: fall back to staging copies when a HOST_TRANSFER image has no memory type4469dbcRuntime: port #3077's forced host-transfer retry into the staging fallback310fa80d3d12: 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
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):��Item: TEST-995 �^C�� claim: https://github.com/ItsNotRexed/Leonida/issues/4571#issuecomment-7091273076 (found by me in
#4420).Depends on:
#5000(the known pre-existing tier-1heap_mismatchesassertion ind3d12_vulkan_device_testis fixed there; this PR's own fallback path is complete without it).Head
310fa807is based on0db7fed5and is not rebased onto the currentmain561b65a8(merge base0db7fed5, 1815 commits behind); it remains mergeable. The body had a cp1252 round-trip mangling; rewritten as UTF-8. I will rebase when a maintainer asks rather than force-push a branch that reviewers have already validated at this head.What and why
On NVIDIA Pascal (GTX 1060 / 582.78, GTX 1050 Ti / 560.94 and 582.78), a texture in a CPU-visible heap advertises
VK_FORMAT_FEATURE_2_HOST_IMAGE_TRANSFER_BIT_EXT,vkCreateImagesucceeds, butvkGetImageMemoryRequirementsreturnsmemoryTypeBits = 0(no memory type at all).CreateCommittedResourcethen returnedE_OUTOFMEMORY. The Vulkan SDK 1.4.363 validation layer reports nothing.runtime/shims/d3d12_vulkan_device.cppnow recreates such an unbound image withoutVK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT(re-checking format support first) and continues on the staging-copy path. A failedvkCreateImageleavesimage_null so the destructor cannot free an undefined handle. The retry loop also handles an allocation/bind failure with the same fallback, andlog_oncereports which branch fired.With
@gustavorafaelschmidt's go-ahead, the permanent test-onlyforce_host_transfer_retrypath from their#3077commit is included here (commit authored by them,4469dbca), so bothd3d12_subresource_copy_testandd3d12_vulkan_device_testrun their CPU copies through three paths: normal host copy, explicit staging, and forced no-memory-type. The tier-1 heap/WARP changes in#3077are deliberately not ported �^C�� they belong to D3D-504 (#5000).Tested
Windows 11, NVIDIA GeForce GTX 1060 6GB, driver 582.78, Vulkan 1.4.312 / headers 1.4.363, MSVC 19.44 + Ninja, RelWithDebInfo:
d3d12_subresource_copy_test: OK�^C�� three paths, 109 compared steps each, 0 mismatches.d3d12_vulkan_device_test: three CPU-copy paths matched; the only failure is the known pre-existing tier-1heap_mismatchesassert (D3D-504), fixed by#5000.git diff --checkclean.Independent confirmations on this PR:
@shdann: fault injection of both branches (pass on head, fail on base);@Codejustcode12(GTX 1050 Ti / 560.94): natural empty mask on formats 37/133/98, all three paths 0 mismatches, no VUIDs, and main +#4682+#5000green on Pascal;@thehollowedone(RTX 3080 Ti / 621.35) and@Krashgamer(RTX 3080 / 610.88): all three paths matched native D3D12, no VUIDs; Krashgamer's negative control (restoring main'sE_OUTOFMEMORY) makes both executables fail.AI-assisted (OpenCode). Synthetic fixtures only; no game data.
@auswhalen999-debug(GTX 1070 8 GB / driver 581.80, Windows 11, clang-cl 23.1.6, head310fa807merged with main8f208d09a): clean main reproduces#4420on this card; this PR gives 109/109 steps with 0 mismatches on all three copy paths and fixes the two CUSTOM heap E_OUTOFMEMORY cases; main +#4682+#5000makesd3d12_vulkan_device_test100% green. Natural empty masks on formats 37/133.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.