Skip to content

dxgi: the factory's adapter enumeration answers a null output with DXGI_ERROR_INVALID_CALL, as the host does (new RT item) - #7999

Open
AirKyzzZ wants to merge 1 commit into
ItsNotRexed:mainfrom
AirKyzzZ:fix/dxgi-enum-null-out
Open

AirKyzzZ wants to merge 1 commit into
ItsNotRexed:mainfrom
AirKyzzZ:fix/dxgi-enum-null-out

Conversation

@AirKyzzZ

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: new RT item (claim)

What and why

The layer's factory answered a null output pointer with E_POINTER in EnumAdapters, EnumAdapters1 and EnumAdapterByLuid, and EnumWarpAdapter answered DXGI_ERROR_NOT_FOUND whatever it got. Measured on the host dxgi.dll here (factories from CreateDXGIFactory1 and CreateDXGIFactory2): all four answer DXGI_ERROR_INVALID_CALL for a null output, whatever the index, LUID or IID. The layer now does the same, as EnumAdapterByGpuPreference already did. EnumWarpAdapter with an output is still DXGI_ERROR_NOT_FOUND.

Tested

Windows 10 22H2 (19045), RTX 2060 / NVIDIA 566.14, Ryzen 5 2600X, clang-cl 23.1.6 + lld-link, Windows SDK 10.0.26100, Ninja, on e549a6f08, over SSH:

  • dxgi_device_test: 3 backend(s) passed. The new checks run on the factory of the host WARP adapter, of the host RTX 2060 adapter and of the layer's adapter on the Vulkan device, so the host answers are checked again on every run. With dxgi_com.cpp from main both host legs pass and the Vulkan leg fails at factory->EnumAdapters(0, nullptr) == DXGI_ERROR_INVALID_CALL (line 134).
  • xbox_present, dxgi_swapchain_count: pass. dxgi_swapchain skips over SSH (no interactive window station).

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

@ItsNotRexed: an exe/recomp PR, as you asked.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (no translator change)

…GI_ERROR_INVALID_CALL, as the host does

Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
@ECHOZwei

Copy link
Copy Markdown

Tested e549a6f086d78210ffee92efb5b373af397fddaa on Windows 11 (MSVC 14.51 / Visual Studio Community 2026, RelWithDebInfo, Vulkan SDK 1.4.363.0, LEONIDA_VK_VALIDATION=1) on two GPUs (synthetic/host-parity tests only; no game files): pass

  • Built dxgi_device_test, dxgi_swapchain_test, dxgi_swapchain_count_test, and xbox_present_test cleanly with 0 warnings.
  • NVIDIA GeForce RTX 4080 SUPER (driver 621.01, validation on):
    • ctest --test-dir runtime/build -C RelWithDebInfo -R ^(dxgi_device|dxgi_swapchain|dxgi_swapchain_count|xbox_present)$ --output-on-failure: 4/4 passed (4.55s; dxgi_device 0.54s, dxgi_swapchain 1.31s), 0 validation errors.
  • AMD Radeon(TM) Graphics iGPU (driver 25.10, LEONIDA_VK_DEVICE=AMD, validation on):
    • Same 4 tests: 4/4 passed (5.94s; dxgi_device 0.43s, dxgi_swapchain 2.15s), 0 validation errors.
  • git diff --check and python -I scripts/check_no_game_data.py runtime/shims/dxgi_com.cpp runtime/test/dxgi_device_test.cpp: clean (exit 0).
  • Code review: clean and consistent; EnumAdapters, EnumAdapters1, EnumAdapterByLuid, and EnumWarpAdapter match host Windows 11 DXGI's DXGI_ERROR_INVALID_CALL on null output pointers.

AI-assisted.

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.

2 participants