Skip to content

fix(macos_host): answer D3D12CreateDevice (d3d12.dll #101) with DXGI_ERROR_UNSUPPORTED - #3

Open
Fr0gzilla wants to merge 1 commit into
adrbn:mac-native-hostfrom
Fr0gzilla:macos-host/d3d12-create-device
Open

Fr0gzilla wants to merge 1 commit into
adrbn:mac-native-hostfrom
Fr0gzilla:macos-host/d3d12-create-device

Conversation

@Fr0gzilla

@Fr0gzilla Fr0gzilla commented Nov 23, 2026 •

Copy link
Copy Markdown

What and why

The host answers CreateDXGIFactory1 with DXGI_ERROR_UNSUPPORTED, but it did not export D3D12CreateDevice (d3d12.lib imports it as ordinal 101). So a test that creates a Microsoft D3D12 device to compare with stopped at unimplemented import called: d3d12.dll!#101. It never reached its own "no host device to compare with" path.

d3d12_fence_timing_test is one such test: GetCustomHeapProperties creates a default-adapter device. This change adds the stub next to CreateDXGIFactory1. It returns DXGI_ERROR_UNSUPPORTED and sets *ppDevice to null when given.

The matching test-side change is Fr0gzilla/Leonida@5400acf, going upstream to ItsNotRexed/Leonida. It covers depth_resolve, query_rules, fence_timing and clear, which asked for DXGI or WARP before checking host_is_wine().

Tested

Apple M5, macOS 26.6, MoltenVK 1.4.2 (universal release), D3D12 tests cross-built with clang-cl + xwin and -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded, every d3d12_*_test.exe run through macos_host:

before after (this + the test change)
pass 36 40
skip 15 16
fail 6 1

fence_timing, depth_resolve and query_rules now pass. clear skips because it has no WARP to compare with. xdxr_rt passes when given its output folder, as CTest does. uav_clear still fails: NaN payloads cleared through the R32_UINT view of an R32_SFLOAT image come back as 0x7fc00000, which looks like MoltenVK canonicalising them in the clear. That is not addressed here.

Build note: with CLT 26.6 and the MacOSX27.0 SDK installed, build.sh needs SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX26.5.sdk (see ItsNotRexed/Leonida#2947).

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.

… with DXGI_ERROR_UNSUPPORTED

There is no Microsoft D3D12 on the host, as there is no DXGI (CreateDXGIFactory1 already answers
DXGI_ERROR_UNSUPPORTED). d3d12.lib imports D3D12CreateDevice as ordinal 101, which the host did not export,
so a test that tries to create a host device for comparison stopped at an unimplemented import instead of
taking its own "no host device" path. d3d12_fence_timing_test is one: GetCustomHeapProperties creates a
default-adapter device to compare with.

Tested on an Apple M5 (macOS 26.6, MoltenVK 1.4.2): d3d12_fence_timing_test passes with the matching test
change, and the other D3D12 tests keep their results.
@Fr0gzilla
Fr0gzilla force-pushed the macos-host/d3d12-create-device branch from 394ced1 to fccf11b Compare November 23, 2026 17:47
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.

1 participant