mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:30:53 +01:00
[PR #1851] d3d12: LEONIDA_HOST_IMAGE_COPY switch; auto leaves host image copies off on NVIDIA #1863
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#1863
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/1851
Author: @QemmHD
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:claude/host-image-copy-switch📝 Commits (1)
59c1586d3d12: LEONIDA_HOST_IMAGE_COPY switch, auto off on NVIDIA📊 Changes
6 files changed (+116 additions, -3 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+8 -0)📝
runtime/CMakeLists.txt(+4 -0)📝
runtime/README.md(+1 -0)📝
runtime/shims/d3d12_vulkan_device.cpp(+8 -3)➕
runtime/src/host_image_copy_policy.h(+33 -0)➕
runtime/test/host_image_copy_policy_test.cpp(+62 -0)📄 Description
Depends on #1827 (DadaCap): without host image copies, title images only get filled once #1827 lands; otherwise they stay zero (verified by ecox982745 on an RTX 4090). Merge #1827 first.
The layer uses
VK_EXT_host_image_copyforWriteToSubresource/ReadFromSubresourcewhenever the device has the extension and itshostImageCopyfeature. On an RTX 4070 SUPER (Windows 11), a real boot lost the device with WRITE_INVALID in 7 of 7 runs that used host image copies and in 0 of 2 that didn't (481 s and 901 s, both still running at their time limits, up to 31,841ExecuteCommandListsand 7,960 presents). The mechanism is still open. Details, and what's been ruled out, are in #1608:What this adds:
LEONIDA_HOST_IMAGE_COPY.0: never.1: whenever available (the old behaviour).auto(the default; also for unset or unrecognised text): the same as1, except on NVIDIA (vendorID0x10DE), where it's off.When it's off, the extension is neither enabled nor chained, no image gets host-transfer usage, and every CPU texture copy takes the existing staging submit. That's exactly the path a device without the extension already takes. Device creation logs one line in place of the old "no VK_EXT_host_image_copy" line:
[rt] d3d12: host image copy: on|off (<reason>).Files
runtime/src/host_image_copy_policy.h(new): the choice as a pure function.runtime/test/host_image_copy_policy_test.cpp(new, registered ashost_image_copy_policy): the decision table (unset, empty,auto,0,1, other text) on NVIDIA, AMD and Intel, available and not.runtime/shims/d3d12_vulkan_device.cpp: uses the choice.runtime/README.mdanddocs/d3d12_vulkan.md: the variable, and whyautois off on NVIDIA.Tested (Windows 11, RTX 4070 SUPER, MSVC RelWithDebInfo):
ctest -j 4: 415/416. The only failure isd3d12_depth_resolve, the known NVIDIA MFAA sample-position case (#1505).autoand other text logoff (auto: NVIDIA);=0and=1log their own reason.test_runtime_pathsfailure).check_no_game_data.pyis clean.Cost and caveats
=1and with the default), and reports from AMD/Intel on whetherautoshould stay NVIDIA-only, are very welcome. If the mechanism turns out to be a layer usage error, the right fix replaces this default.Claimed in #1608 as RT-HOST-IMAGE-COPY-SWITCH.
AI-assisted (Claude Code, Claude Opus 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.