Skip to content

dxgi: return the owning adapter for NT and legacy shared textures - #8663

Open
LukeOsland1 wants to merge 3 commits into
ItsNotRexed:mainfrom
LukeOsland1:codex/dxgi-shared-resource-owner
Open

LukeOsland1 wants to merge 3 commits into
ItsNotRexed:mainfrom
LukeOsland1:codex/dxgi-shared-resource-owner

Conversation

@LukeOsland1

Copy link
Copy Markdown

Depends on: #4540

Coordination claim.

A caller asking which adapter created a shared texture received 0x88760873 even for a valid handle. The factory now queries WDDM for the creator's LUID. It handles both NT handles from IDXGIResource1::CreateSharedHandle and legacy global shares from IDXGIResource::GetSharedHandle. The test creates 16×16 RGBA8 D3D11 textures on each hardware adapter and compares the result with native DXGI.

Windows test Parent dee3f1d Branch 3b62057
Valid NT texture handle Regression failed with 0x88760873 where native returned S_OK S_OK and native creator LUID for each GPU
Legacy global texture handle Same constant failure path S_OK and native creator LUID for each GPU
Windows event handle 0x88760873 where native returned E_FAIL E_FAIL, matching native
Unknown handle, null arguments, INVALID_HANDLE_VALUE Existing argument checks pass Existing argument checks pass

Ran dxgi_factory_args_test twice on Windows with Vulkan validation enabled, selecting the RTX 4070 Ti SUPER (32.0.16.1088) and AMD Radeon(TM) Graphics (32.0.21042.62) in turn. Both runs passed, including both handle types from both physical adapters in each run. This also checks the case where the handle belongs to a different GPU from the shim factory.

AI-assisted with Codex. Synthetic textures only.

kapitche and others added 3 commits November 23, 2026 07:41
…ChainForComposition and the teardown event answer as the host does
…handle; CreateSwapChainForComposition refuses non-flip SwapEffect and ASPECT_RATIO_STRETCH
@smowlyy

smowlyy commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 3b62057e7 (clean merge onto main 867d922f0) on Windows 11 (10.0.26300.9974), MSVC 19.44, Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0, dual-GPU host with NVIDIA GeForce RTX 5060 Ti (driver 610.88) and AMD Radeon(TM) Graphics (RDNA2 gfx1036, driver 24.10.24), synthetic inputs only, no game files: pass.

  • cmake --build runtime/build --target dxgi_factory_args_test dxgi_swapchain_test dxgi_device_test: exit 0.
  • ctest --test-dir runtime/build -R dxgi --output-on-failure -V: 4/4 passed (2.39 s):
    • dxgi_device: dxgi_device_test: 3 backend(s) passed
    • dxgi_factory_args: shared resource owner matches native DXGI on NVIDIA GeForce RTX 5060 Ti and shared resource owner matches native DXGI on AMD Radeon(TM) Graphics
    • dxgi_swapchain: PASS (45 descriptions compared with host, 0 mismatches)
    • dxgi_swapchain_count: PASS (3 cases)
  • python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/dxgi_com.cpp runtime/test/dxgi_factory_args_test.cpp: exit 0.

AI-assisted.

@lohant27-netizen

Copy link
Copy Markdown

Tested 3b62057e7 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 867d922f0 together with #8685, #8663, #8682, #8623, #8659 and #8657 (no conflicts): pass.

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