Commit Graph

6 Commits

Author SHA1 Message Date
dbadb08b15 dxgi: the adapter answers IDXGIAdapter4; GetRestrictToOutput, ResizeBuffers flags and null out-pointers answer as the host does
Measured against the host runtime's DXGI on an RTX 5070 Ti and on WARP (Windows 11), both agreeing:

- The adapter answers IDXGIAdapter4. GetDesc3 gives what GetDesc1 gives, plus the
  preemption granularities; a null description is E_INVALIDARG.
- GetRestrictToOutput on a swap chain created without an output is S_OK with a null
  output, not DXGI_ERROR_NOT_FOUND.
- ResizeBuffers refuses NONPREROTATED, FULLSCREEN_VIDEO and every bit from 0x4000 up
  with DXGI_ERROR_INVALID_CALL, and FOREGROUND_LAYER, YUV_VIDEO and 0x2000 on a chain
  created without them with E_INVALIDARG (a sweep of all 32 bits on the host).
- A null out-pointer on GetBuffer, GetHwnd, GetLastPresentCount and GetRestrictToOutput
  is DXGI_ERROR_INVALID_CALL, not E_POINTER or E_INVALIDARG.

dxgi_host_parity_test compares the layer with the host for each of these (PROBE_WARP=1
for WARP): 18 of 26 rows differ before, 0 after, on both. dxgi_device_test and
dxgi_swapchain_test now expect the host's answers.

AI-assisted: yes
2026-11-23 15:47:27 -06:00
997d130892 dxgi_device_test: under Wine 9 the default adapter provider finds no adapter (#6873)
Squash-merged after diff review of PR #6873 - dxgi_device_test: under Wine 9 the default adapter provider finds no adapter
2026-11-23 09:44:00 -06:00
55200be11e dxgi_device, dxgi_swapchain: skip what needs a desktop when the process has no interactive window station (#6301)
Squash-merged after review of PR #6301 - dxgi_device, dxgi_swapchain: skip what needs a desktop when the process has no interactive window station
2026-11-23 08:16:35 -06:00
3d48c4adb0 dxgi_device_test: the not-a-proxy fixture is pointer-sized
The helpers read a vtable pointer (8 bytes) from the object they are given;
the fixture was a 4-byte int, so they read past it. Found in review.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 21:22:18 +00:00
974da138db d3d12_xs: a device created as IDXGIDevice1 keeps the proxy as its identity and the layer's adapter
create_device_proxy returns the proxy's DXGI pointer when the title asks for
IDXGIDevice1. D3D12XboxCreateDevice passed that pointer to set_device_outer,
so the Vulkan device's outer identity was the DXGI pointer, and
set_device_adapter_provider, which knew only the primary vtable, set nothing:
GetAdapter then loaded the host's dxgi.dll and returned a host adapter.

set_device_outer resolves the proxy first (device_proxy_primary), and
set_device_adapter_provider takes either pointer, returns whether it set the
provider and says so on stderr when it did not.

dxgi_device_test creates the device as IDXGIDevice1 on WARP, a hardware
adapter and the Vulkan device. Found by @kacper-serewis in review.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 21:09:31 +00:00
1b3a0d80f3 d3d12_xs: the device proxy answers IDXGIDevice1 (GetAdapter), step 3 of the GDKX boot sequence
A GDKX title asks its device for IDXGIDevice1, then GetAdapter and
EnumOutputs(0), to find the output it gives SetFrameIntervalX. The proxy
refused the QueryInterface, and a PC ID3D12Device has no IDXGIDevice to
forward to.

The proxy now answers IDXGIObject, IDXGIDevice and IDXGIDevice1 as one COM
object with the device (a second vtable pointer in the proxy, same reference
count and QueryInterface). GetAdapter and GetParent return the adapter of the
device behind it: the host DXGI adapter with the device's LUID on the host
backend, the layer's own rt::dxgi adapter on the Vulkan device
(set_device_outer installs that provider).

dxgi_device_test walks it on WARP, the first hardware adapter and the Vulkan
device.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 20:35:26 +00:00