Commit Graph

38 Commits

Author SHA1 Message Date
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
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
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
bf42427ed3 feat(dxgi): add IDXGIFactory5 tearing query, present-mode selection, and waitable swapchains 2026-11-22 07:32:02 -03:00
ede8c96f3d fix(dxgi): use primary DEVICE_LOCAL heap to avoid double-counting BAR1 aperture 2026-11-22 07:00:57 -03:00
571cad4d8a fix(dxgi): share video-memory reservation state across adapter handles per LUID 2026-11-22 06:59:07 -03:00
0bc74260d4 feat(dxgi): implement Vulkan-backed IDXGIAdapter3 enumeration and swapchain state queries 2026-11-22 06:09:11 -03:00
a8b83d8565 DXGI swapchain: Present checks its arguments, ResizeBuffers refuses held buffers, 0 means the client area
Measured on the host DXGI (RTX 5070 and WARP): Present(n > 4) is
DXGI_ERROR_INVALID_CALL and DXGI_PRESENT_TEST doesn't present;
ResizeBuffers while the app holds a back buffer is DXGI_ERROR_INVALID_CALL
and keeps the size; a zero width or height at creation or in ResizeBuffers
takes the window's client area. The shim presented on TEST, destroyed held
buffers, and used 256x256 / the old size.
2026-11-22 12:49:02 +05:30
e99514591a fix(dxgi): preserve R10G10B10A2_UNORM logical backbuffers and reject unsupported formats in ResizeBuffers 2026-11-22 03:00:13 -03:00
9363490570 feat(dxgi): add Vulkan-backed IDXGIFactory4 and IDXGISwapChain3 COM shim with HWND GPU test 2026-11-22 02:06:28 -03:00