Skip to content

d3d12: enable VK_EXT_host_image_copy on a Vulkan 1.2 device only with VK_KHR_copy_commands2 and VK_KHR_format_feature_flags2 (D3D-831) - #8152

Open
marso006 wants to merge 1 commit into
ItsNotRexed:mainfrom
marso006:fix/d3d831-host-image-copy-deps
Open

marso006 wants to merge 1 commit into
ItsNotRexed:mainfrom
marso006:fix/d3d831-host-image-copy-deps

Conversation

@marso006

Copy link
Copy Markdown

D3D-831. Claim: #7913 (comment) (@ABilenduke's finding, marked up for grabs).

What and why

VK_EXT_host_image_copy depends on VK_KHR_copy_commands2 and VK_KHR_format_feature_flags2, which are core only from Vulkan 1.3. create_vulkan_device_standalone enabled it whenever the device listed it, also on a Vulkan 1.2 device (the MoltenVK path vulkan13_features.h supports), and never enabled the two dependencies. That breaks VUID-vkCreateDevice-ppEnabledExtensionNames-01387, and a strict driver refuses the device (E_FAIL). runtime/test/vk_test_device.h had the same code.

Change

  • Vulkan13Features (which already knows 1.2 from 1.3 and enables the 1.2 extensions for dynamic rendering and synchronization2) gets two members:
    • host_image_copy_available(extensions): true on 1.3 when the device lists VK_EXT_host_image_copy; on 1.2 only when it also lists both dependencies.
    • add_host_image_copy_extensions(list): on 1.2, VK_KHR_copy_commands2 and VK_KHR_format_feature_flags2 and then VK_EXT_host_image_copy; on 1.3, only VK_EXT_host_image_copy.
  • create_vulkan_device_standalone (runtime/shims/d3d12_vulkan_device.cpp) and vk_test_device.h use both. A 1.2 device without the dependencies takes the existing staging-copy path (the "no VK_EXT_host_image_copy" line), as a device without the extension already does.
  • vulkan13_features_test (CPU-only) checks both members on 1.3 and 1.2: with all three extensions, only the host copy, and each dependency missing.

On a 1.3 device nothing changes. No docs change, no game files.

Tested

Windows 11, NVIDIA GeForce RTX 5060 Ti, driver 617.42 (a Vulkan 1.4 device), Vulkan SDK 1.4.363.0, VS 2026, scripts/build_runtime.ps1 on main dde82f27e + this branch:

I have no Vulkan 1.2 device here, so the 1.2 path is covered by the unit test, not by hardware. A MoltenVK / CrossOver check would be welcome.

AI-assisted (Claude Code, Claude Opus 5.5).

🤖 Generated with Claude Code

…pendencies (D3D-831)

VK_EXT_host_image_copy depends on VK_KHR_copy_commands2 and
VK_KHR_format_feature_flags2, which are core only from Vulkan 1.3. On a 1.2
device (the MoltenVK path vulkan13_features.h supports) the layer enabled it
alone, which breaks VUID-vkCreateDevice-ppEnabledExtensionNames-01387, and a
strict driver refuses the device.

Vulkan13Features::host_image_copy_available() now requires both extensions on
a 1.2 device, and add_host_image_copy_extensions() enables them ahead of
VK_EXT_host_image_copy (only the extension itself on 1.3). Both the layer's
create_vulkan_device_standalone and the tests' vk_test_device.h use them.
vulkan13_features_test checks the 1.2 and 1.3 cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AirKyzzZ

Copy link
Copy Markdown
Contributor

Tested 914edbf79 on RTX 2060 (NVIDIA 566.14), Windows 10 22H2, clang-cl 23.1.6 with the MSVC 14.44 STL, RelWithDebInfo: pass.

Built vulkan13_features_test and ran ctest -R ^vulkan13_features$: passes. With main's runtime/src/vulkan13_features.h the test does not compile (no member named 'host_image_copy_available'), so it checks the two new members rather than the old enable in create_vulkan_device_standalone; that part I only read. This GPU is a 1.3+ device, so the 1.2 path is still covered only by the unit test.

No game files. AI-assisted (Claude Code).

@lohant27-netizen

Copy link
Copy Markdown

Tested 914edbf79 on Windows 11 (10.0.26300), NVIDIA GeForce RTX 5070 (driver 32.0.16.2101, subgroup 32), MSVC with SDK 10.0.26100, Release, merged onto main 77fa308f9 together with #8180, #8159, #8152, #8138 and #8155 (no conflicts): pass.

@h0useadv

Copy link
Copy Markdown

Tested 914edbf79 (based on main dde82f27e) on AMD Radeon RX 9070 XT (RDNA4), AMD Windows driver 32.0.32029.2010 (a Vulkan 1.4 device), Windows 11 Pro build 26300: pass, no new failures. Built with clang-cl 23.1.6 + lld-link against an xwin splat (MSVC 14.44, SDK 10.0.26100), RelWithDebInfo; synthetic, no game files.

  • vulkan13_features: passes.
  • d3d12_subresource_copy: passes, and the host image copy path is still taken on this 1.3+ device: CPU copies (host image copy): 109 steps compared with the host (8 more not compared), 0 mismatches, same for the staging path and Microsoft's recorded answers.
  • Full ctest -j8, failures rerun with -j1: 262/268; the 6 that fail are the same 6 as on main on this GPU.

Like the RTX 5060 Ti run, this only covers the 1.3 path on hardware; the 1.2 branch is covered by the unit test only.

AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants