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.
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.
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.
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>
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>
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>
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>
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.