Skip to content

D3D-86: answer D3D12_OPTIONS1 in CheckFeatureSupport - #745

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Ayinaki:d3d86-options1-wave-ops
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
Ayinaki:d3d86-options1-wave-ops

Conversation

@Ayinaki

@Ayinaki Ayinaki commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

item: D3D-86, the D3D12_OPTIONS1 slice (FORMAT_INFO and OPTIONS8 are separate claims; the other OPTIONS groups stay open)

D3D12_FEATURE_D3D12_OPTIONS1 used to fall through to default: return E_INVALIDARG. The device now answers it from the Vulkan physical device's own subgroups:

  • WaveOps is true only when every operation group the wave intrinsics map to is present (BASIC, VOTE, BALLOT, SHUFFLE, ARITHMETIC), because D3D12 promises them all behind that single bool.
  • WaveLaneCountMin/Max come from VkPhysicalDeviceSubgroupSizeControlProperties, falling back to subgroupSize when the device has no 1.3 subgroup-size control.
  • TotalLaneCount is one full wave: D3D12 counts every lane of the device here, and Vulkan has no such number. Reporting a wave under-reports, so a game that sizes work from it plans for less parallelism than the GPU has, never more; section 4.1 of docs/d3d12_vulkan.md records the choice.
  • ExpandedComputeResourceStates is true (Vulkan has no resource states to expand).
  • A DataSize one field short or long, and a null buffer, are E_INVALIDARG; the host answers the wrong sizes the same way.

Measured

Host PC runtime (616.86) on the RTX 5070 for this query: S_OK, WaveOps 1, lanes 32..32, total 6144, expanded states 1. The layer reports lanes 32..32 and total 32.

The test compares wave ops, the lane range and expanded states field by field with the host device, prints both totals, and pins the one-wave total. That comparison is skipped on a software Vulkan device, where CI's llvmpipe and the host's WARP device would be answering about different machines.

Tested

cmake --build runtime/build --target d3d12_vulkan_device_test, then runtime/build/d3d12_vulkan_device_test.exe, on Windows 11 with an RTX 5070 (driver 616.86, Vulkan 1.4.351): exit 0, D3D12_OPTIONS1: lanes 32..32, total 32 (host total 6144), no mismatches, and the earlier shader-model and root-signature checks still pass. No game files involved.

Depends on: none

@troythedecoyx

Copy link
Copy Markdown
Contributor

Tested b196d4b merged onto main 67204bf (no conflicts) on Windows 11 Home, NVIDIA GeForce RTX 4060 Ti, driver 621.24 (32.0.16.2124), Vulkan SDK 1.4.363, MSVC (VS 2022), RelWithDebInfo + Ninja.

  • ctest: 29/29 passed, same as main.
  • d3d12_vulkan_device_test run on its own: exit 0. The host comparison ran against native D3D12 on the same GPU and found no mismatches:
    D3D12_OPTIONS1: lanes 32..32, total 32 (host total 4352)
    So WaveOps, WaveLaneCountMin/Max (32/32) and ExpandedComputeResourceStates agree with the PC runtime on this NVIDIA card; only TotalLaneCount differs, as the PR intends (host 4352, the layer one wave).

AI-assisted (Claude Code).

@ismailchaka1

Copy link
Copy Markdown
Contributor

Tested b196d4b on an NVIDIA GeForce RTX 4070 SUPER, driver 32.0.16.1088, Windows 11, MSVC 2022 (Ninja, RelWithDebInfo), LEONIDA_VK_VALIDATION=1: pass.

PR head as-is, no game files. AI-assisted.

@rasptum

rasptum commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested b196d4b on NVIDIA GeForce RTX 3060, driver 596.36, Windows 10 Pro 19045: pass, once the Windows 10 footprint skip from #717 is present.

Two notes for the rebase:

Validation: the stock harness on this base counted a loader error from a stale implicit-layer manifest on this machine (TEST-98), so the validation result above is with that count filter applied locally (#741, now on main).

Not run: the llvm-mc based tests. Build: MSVC 19.44, Windows SDK 10.0.26100, Vulkan SDK 1.4.363, Ninja, RelWithDebInfo. No game files. AI-assisted (Claude Code), run on my own machine.

@quackottu quackottu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested b196d4b on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • ctest -C RelWithDebInfo: 100% tests passed, 0 tests failed out of 29
  • d3d12_vulkan_device_test (changed here): exit=0 validation=0 | [rt] d3d12: Vulkan device: NVIDIA GeForce RTX 5070 (maxPushConstantsSize: 256 bytes)
  • 30 test programs in the build pass with 0 validation errors
  • d3d12_clear_test fails (format 28 case 0 byte 2: Vulkan 7f, WARP 80) exactly as on main 67204bf, so not from this PR: NVIDIA rounds a 0.5 UNORM clear to 0x7f, which #521 addresses

Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.

@Ayinaki
Ayinaki force-pushed the d3d86-options1-wave-ops branch from b196d4b to 783a491 Compare November 22, 2026 03:42
The query fell through to E_INVALIDARG. It now reports the Vulkan physical
device's subgroup operations and wave-size range, with TotalLaneCount held to
one full wave because Vulkan has no device-wide lane count.
@Ayinaki
Ayinaki force-pushed the d3d86-options1-wave-ops branch from 783a491 to 5d1c033 Compare November 22, 2026 03:58
@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 5d1c033 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass (no regression against main).

  • Clean RelWithDebInfo Ninja build of runtime/ (Vulkan SDK 1.4.363.0), then ctest: 32/32 pass.
  • GPU tests with LEONIDA_VK_VALIDATION=1 and the Khronos validation layer: d3d12_com_test, d3d12_descriptor_test, d3d12_gcl8_test, d3d12_method_variants_test, d3d12_resource_desc_test, d3d12_sampler2_test, d3d12_state_map_test, d3d12_typeless_rtv_test, d3d12_uav_clear_test, d3d12_vulkan_device_test, vk_command_replay_test pass, with 0 validation messages (no VUIDs).
  • d3d12_clear_test fails, the same as on plain main 4a36bb1 on this GPU (NVIDIA rounds the 0.5 clear on 8-bit UNORM/SNORM down: Vulkan 7f, WARP 80, plus one depth-format-55 case that main shows too). This is not caused by this PR; Runtime: clears match WARP on every format class: tie rounding, and the SNORM/SINT/R8/R16 formats (D3D-45) #521 fixes the rounding.

The vk_* harness tests that need translated SPIR-V weren't run. No game files used. AI-assisted run (Claude Code).

ItsNotRexed added a commit that referenced this pull request Nov 22, 2026
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
@ItsNotRexed
ItsNotRexed merged commit 2ff99bd into ItsNotRexed:main Nov 22, 2026
10 checks passed
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.

7 participants