Skip to content

dxgi: CheckFeatureSupport answers a wrong size or an unknown feature with DXGI_ERROR_INVALID_CALL, as the host does (new RT item) - #8023

Open
AirKyzzZ wants to merge 1 commit into
ItsNotRexed:mainfrom
AirKyzzZ:fix/dxgi-check-feature-support-invalid-call
Open

AirKyzzZ wants to merge 1 commit into
ItsNotRexed:mainfrom
AirKyzzZ:fix/dxgi-check-feature-support-invalid-call

Conversation

@AirKyzzZ

Copy link
Copy Markdown
Contributor

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

What and why

The layer's IDXGIFactory5::CheckFeatureSupport answered E_INVALIDARG for a wrong size and for any feature other than DXGI_FEATURE_PRESENT_ALLOW_TEARING. Measured on the host dxgi.dll here: a size of 0, 2 or 8 for ALLOW_TEARING, and an unknown feature (1, 99, -1), are DXGI_ERROR_INVALID_CALL with the data left untouched, also when the data pointer is null. The layer now checks the feature and size first and answers DXGI_ERROR_INVALID_CALL. A null data pointer with the right size crashes the host (it writes through it), so the layer keeps E_INVALIDARG there, and dxgi_swapchain_test keeps checking that while its wrong-size check now expects DXGI_ERROR_INVALID_CALL.

Independent of #7999 (same file, lines apart, the two merge cleanly in either order).

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 df5ed873e, 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 CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING, &tearing, size) == DXGI_ERROR_INVALID_CALL (line 134).
  • xbox_present, dxgi_swapchain_count: pass. dxgi_swapchain builds and skips over SSH (no interactive window station), so its changed check was not run here.

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)

…with DXGI_ERROR_INVALID_CALL, as the host does

Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
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