Commit Graph

57 Commits

Author SHA1 Message Date
8f31de661d Merge pull request #3283 from kapitche
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:07:08 -05:00
0fd05a431a Merge pull request #2976 from nightsale
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:32 -05:00
608707c625 Merge pull request #2808 from bobcatchris
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:06:10 -05:00
5b3eb785cb DXGI: RegisterStereoStatusWindow/Event return S_OK with a cookie
Both returned E_NOTIMPL, which Microsoft documents only for the Windows 7 Platform Update. They now return S_OK with a unique cookie for UnregisterStereoStatus; stereo is never enabled so nothing is notified. Test: dxgi_swapchain.
2026-11-22 19:42:00 -05:00
e17bea316f dxgi: SetSourceSize stores the source region and refuses one too large
SetSourceSize answered S_OK and ignored its arguments, and GetSourceSize always
reported the back-buffer size, so a game that scales its source region could not
read back what it set.

Host-measured on Windows 11 with the system DXGI (RX 7900 XTX): a fresh
swapchain reports the back-buffer extent; SetSourceSize(64,32) round-trips while
GetDesc1 keeps the buffer size; a region larger than either buffer dimension is
DXGI_ERROR_INVALID_CALL and keeps the stored value; zero is accepted and stored;
GetSourceSize needs both pointers; and ResizeBuffers resets the source size to
the new back-buffer extent.

Present still does not scale by the source region; that stays a documented
difference and is not part of this change.
2026-11-22 17:37:54 -06:00
1ae9cee10a dxgi: implement Adapter::EnumOutputs and IDXGIOutput6 (D3D-313)
- Upgrade dxgi_com.h to dxgi1_6.h for IDXGIOutput6 / DXGI_OUTPUT_DESC1.
- Enumerate Win32 monitors via EnumDisplayMonitors / EnumDisplaySettingsW with headless 1920x1080@60 fallback.
- Implement Output (IDXGIOutput..IDXGIOutput6) and wire Adapter::EnumOutputs and SwapChain::GetContainingOutput against host dxgi.dll behavior.
- Add D3D-313 unit and host-comparison coverage in dxgi_swapchain_test.cpp (synthetic, no game data).

AI-assisted.
2026-11-22 23:10:03 +01:00
78183db304 Merge pull request #3531 from Ewann 2026-11-22 17:02:34 -05:00
3c0aa65071 Merge pull request #3280 from kapitche 2026-11-22 17:01:13 -05:00
dac96d2d65 DXGI: CreateSwapChainForHwnd checks MSAA, buffer count and format before the size, like the host
A description with width 16385 and MSAA 4, one buffer or a bad format is
DXGI_ERROR_INVALID_CALL on the host runtime's DXGI, not E_INVALIDARG
(found by Kam471 in the review of #3531). Five multi-fault cases added
to the side-by-side comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:37:10 +01:00
e62744353b DXGI: CreateSwapChainForHwnd refuses what the host runtime's DXGI refuses
Measured on RTX 5070 / 621.14: bitblt effects, window-incompatible
scaling and alpha modes, flags outside 0x2/0x20/0x40/0x800/0x1000/0x2000,
shared/read-only/discard-on-present/UAV usage, a null or non-queue
device, null window/description/output are DXGI_ERROR_INVALID_CALL; a
side above 16384 is E_INVALIDARG. dxgi_swapchain_test compares 40
descriptions with the host. The CoreWindow path keeps its old checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:27:31 +01:00
e66a9c71c5 Merge pull request #3284 from kapitche 2026-11-22 15:16:40 -05:00
3ac9743ce8 Merge pull request #3268 from Ryderadzeee 2026-11-22 15:16:21 -05:00
237d590237 Merge pull request #3259 from Vyral1978 2026-11-22 15:16:16 -05:00
ec6847a7f7 Merge pull request #2974 from Ryderadzeee 2026-11-22 15:13:43 -05:00
cb32d2d942 Merge pull request #2876 from Ryderadzeee 2026-11-22 15:12:48 -05:00
9a507b063d Merge pull request #2822 from bobcatchris 2026-11-22 15:12:19 -05:00
64272954c2 Merge pull request #2791 from bobcatchris 2026-11-22 15:12:01 -05:00
1d2d67dc37 DXGI: keep IDXGIObject private data on the factory, adapter and swapchain
SetPrivateData, SetPrivateDataInterface and GetPrivateData accepted the data and discarded it, so GetPrivateData always returned DXGI_ERROR_NOT_FOUND. They now store a copy of the bytes, hold a reference for an interface until it is replaced or removed, and answer DXGI_ERROR_MORE_DATA for a buffer that is too small. Test: dxgi_swapchain.
2026-11-22 15:11:35 -05:00
b62a30c37c DXGI: RegisterVideoMemoryBudgetChangeNotificationEvent succeeds with a cookie
The method returned E_NOTIMPL and a zero cookie. It now returns S_OK with a unique cookie for UnregisterVideoMemoryBudgetChangeNotification; the budget is recomputed on every QueryVideoMemoryInfo, so the event is never signalled. Test: dxgi_swapchain.
2026-11-22 14:58:20 -05:00
bdf052a2d8 DXGI: match native waitable swapchain frame latency limits 2026-11-22 23:57:08 +04:00
afd0d4c622 dxgi: IDXGIFactory6 and IDXGIFactory7 on the Vulkan factory (D3D-2)
CreateDXGIFactory2(IID_IDXGIFactory7) and QueryInterface for
IDXGIFactory6/7 failed on the layer's factory, which stopped at
IDXGIFactory5.

- EnumAdapterByGpuPreference returns the one Vulkan adapter at index 0
  for every preference.
- RegisterAdaptersChangedEvent / UnregisterAdaptersChangedEvent keep a
  cookie registry. The adapter list never changes, so the event is
  never signalled.

Every return code follows the host dxgi.dll, measured on Windows 11
with an RTX 3070:
- a preference outside the enum is accepted;
- a null out is DXGI_ERROR_INVALID_CALL;
- past the end is DXGI_ERROR_NOT_FOUND with *out cleared;
- a non-adapter riid is E_NOINTERFACE;
- a null event or cookie, and an event registered twice, are
  DXGI_ERROR_INVALID_CALL;
- cookies start at 1 and are separate from the occlusion cookies;
- an unknown cookie is DXGI_ERROR_NOT_FOUND.

dxgi_swapchain_test checks each answer. With main's factory it fails
at QueryInterface(IDXGIFactory6/7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:55:41 +01:00
32fc04a14e dxgi: MakeWindowAssociation refuses unknown flag bits
The factory answered S_OK for every flags value, while the host rejects anything
outside DXGI_MWA_NO_WINDOW_CHANGES, DXGI_MWA_NO_ALT_ENTER and
DXGI_MWA_NO_PRINT_SCREEN with DXGI_ERROR_INVALID_CALL (measured on Windows 11
with the system DXGI), so an invalid call looked accepted. Reject unknown bits
before recording the window, and cover the accepted combinations and two unknown
bits in the swapchain test.
2026-11-22 13:40:33 -06:00
7b8eed6f21 dxgi: ResizeTarget resizes a windowed swapchain's client area
ResizeTarget answered S_OK and ignored its argument, so a windowed game that
switches resolution through the DXGI 1.0 path kept the old window: the host
moves the target's client area to the mode's Width x Height and leaves the back
buffers alone until ResizeBuffers (where 0 means the new client area).

Measured on Windows 11 with the system DXGI (RX 7900 XTX): ResizeTarget(nullptr)
is DXGI_ERROR_INVALID_CALL, ResizeTarget(0x0) is accepted and the window's
minimum tracking size decides the result, ResizeTarget(234x156) gives a 234x156
client area with the buffers at 128x128, and ResizeBuffers(0, 0, 0) then takes
234x156. The swapchain test now covers the same sequence on the shim.
2026-11-22 13:40:31 -06:00
ed8528885b Validate DXGI ResizeBuffers1 node masks and presentation queues 2026-11-22 22:59:57 +04:00
4f4cc860ad Match DXGI on an out-of-range GetBuffer index 2026-11-22 22:34:58 +04:00
900473fcce Merge pull request #2343 from edupode 2026-11-22 13:14:02 -05:00
fd9bc14131 dxgi: return DXGI_STATUS_OCCLUDED on CreateSwapChain fullscreen fallback and add test 2026-11-22 23:12:44 +05:30
342eef5eb5 dxgi: match native DXGI INVALID_CALL for CreateSwapChain params and E_NOINTERFACE on Factory::GetParent 2026-11-22 23:12:44 +05:30
7ec740b9be dxgi: implement Factory CreateSwapChain delegation, GetParent, and SwapChain GetCoreWindow/GetRestrictToOutput 2026-11-22 23:12:43 +05:30
bec58c9aac fix: return parent device from DXGI swapchain 2026-11-22 16:40:23 +00:00
cd63047345 Merge pull request #1940 from Ryderadzeee 2026-11-22 10:39:35 -05:00
09857dfa54 Validate DXGI flip-model swapchain sample descriptions 2026-11-22 19:08:35 +04:00
2d32cd2576 Merge pull request #1801 from Ryderadzeee 2026-11-22 09:48:19 -05:00
8d27bec8d6 Merge pull request #1780 from Ryderadzeee 2026-11-22 09:15:18 -05:00
a0af2deb87 Merge pull request #1766 from Ryderadzeee 2026-11-22 09:15:11 -05:00
4d6febbde3 Merge pull request #1761 from SHAURYASANYAL3 2026-11-22 09:15:08 -05:00
083e502e66 Validate DXGI flip-model swapchain formats 2026-11-22 18:14:25 +04:00
e6bb76cd58 Reject changes to DXGI swapchain creation flags on resize 2026-11-22 18:06:12 +04:00
84016932e0 Validate DXGI flip-model swapchain buffer counts 2026-11-22 17:59:40 +04:00
0904055f3a dxgi: implement CreateSwapChainForCoreWindow and occlusion status registration
Implements CreateSwapChainForCoreWindow on Factory for UWP / Game Core Scarlett titles by querying ICoreWindowInterop for the underlying Win32 HWND, and implements RegisterOcclusionStatusWindow / RegisterOcclusionStatusEvent returning sequential cookies.

Adds mock ICoreWindow unit tests in dxgi_swapchain_test covering argument validation, null HWND failure, functional swapchain presentation, and occlusion status registration.
2026-11-22 19:27:37 +05:30
985a0ee4dc Merge pull request #1719 from waltingford 2026-11-22 08:38:45 -05:00
23a014bb06 dxgi: match frame statistics error notifications (D3D-211) 2026-11-22 08:25:54 -05:00
bf3fb1efa6 Merge pull request #1631 from bobcatchris 2026-11-22 08:08:16 -05:00
cc467ab60b dxgi: round-trip the swapchain rotation
SetRotation returned S_OK without storing the mode and GetRotation always reported identity. Store it and return E_INVALIDARG for a null output, matching the other getters. Cover the default, a 90-degree round-trip and the null argument in dxgi_swapchain.

Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain_test passes. No game files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:45:59 -06:00
3746f917b5 dxgi: store the swapchain background color and matrix transform
IDXGISwapChain1::SetBackgroundColor and IDXGISwapChain2::SetMatrixTransform returned S_OK without storing anything, and their getters returned E_NOTIMPL. Store both values and return the DXGI defaults, transparent black and the identity matrix. Null pointers return E_INVALIDARG.

Cover the defaults, round-trips and null arguments in dxgi_swapchain. Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain_test passes. No game files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:44:56 -06:00
7c32417608 Merge pull request #1604 from bobcatchris 2026-11-22 07:38:30 -05:00
c083d09f19 dxgi: report swapchain frame statistics from the presenter
GetFrameStatistics returned E_NOTIMPL even though the swapchain already tracks successful presents. Record the QPC at each successful present and fill PresentCount, PresentRefreshCount, SyncRefreshCount and SyncQPCTime; failed and test presents still change nothing. The test checks the values and the null-argument error.

Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain passed with and without LEONIDA_VK_VALIDATION=1. No game files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:33:56 -06:00
c94ca41411 dxgi: answer swapchain GetDevice and GetFullscreenDesc
The swapchain kept the factory but discarded the device passed to CreateSwapChainForHwnd, so both IDXGIDeviceSubObject::GetDevice and IDXGISwapChain1::GetFullscreenDesc returned E_NOTIMPL. Hold that device (as native DXGI does), return it through QueryInterface, and describe the windowed swapchain with a zeroed fullscreen description and Windowed = TRUE. The swapchain test now checks both.

Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain passed with and without LEONIDA_VK_VALIDATION=1. No game files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:32:44 -06:00
1e5d0dbeb9 fix(dxgi): probe VK_PRESENT_MODE_IMMEDIATE_KHR for DXGI_FEATURE_PRESENT_ALLOW_TEARING 2026-11-22 08:18:25 -03:00
a6daa4cfff fix(dxgi): reject Get/SetMaximumFrameLatency on non-waitable swapchains with DXGI_ERROR_INVALID_CALL 2026-11-22 08:15:47 -03:00