Commit Graph

30 Commits

Author SHA1 Message Date
cd63047345 Merge pull request #1940 from Ryderadzeee 2026-11-22 10:39:35 -05:00
28ef599619 Runtime: pick the Vulkan GPU by the harnesses' rank (native over Dozen)
The runtime's standalone device (d3d12_vulkan_device.cpp) still took
"the first usable device, replaced by every later discrete GPU". #915
fixed that rule in the test harnesses because Mesa's Dozen (Microsoft
vendor 0x1414, "Microsoft Direct3D12 (<gpu>)") reports a discrete GPU, so
on a PC with the OpenCL/OpenGL/Vulkan Compatibility Pack the runtime
could run on the Vulkan-on-D3D12 wrapper while the tests used the native
driver. Even without Dozen, on a two-dGPU PC the runtime took the last
GPU and vk_test_device.h the first.

- runtime/src/vulkan_device_filter.h: vulkan_device_rank() (native over
  Microsoft's layers, then discrete > integrated > virtual > CPU), with
  the device type as an int so the header stays Vulkan-free.
- d3d12_vulkan_device.cpp: the first usable device of the highest rank.
- vk_device_pick.h: device_rank forwards to it (static_assert on the
  VkPhysicalDeviceType values).
- d3d12_indirect_rt_test, dxgi_swapchain_test, vk_image_fuzz,
  vk_sampler_test had the old loop and ignored LEONIDA_VK_DEVICE: they
  now filter and rank like the rest, and an unmatched filter fails
  instead of skipping.
- vulkan_device_filter_test: the rank order; docs/testing.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:27:09 +00: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
2c99d82448 Merge pull request #1050 from sanuk369 2026-11-22 01:38:03 -05:00
37e9e1e02a Tests: run four more GPU test programs under ctest, skipping without a Vulkan driver
d3d12_debug_markers_test, d3d12_fence_timing_test, d3d12_node_mask_test
and dxgi_swapchain_test were built but had no add_test, so ctest (and the
wine job's test list) never ran them; all four pass on an RTX 5070. Each
now exits 77 when there is no Vulkan GPU or driver, as the other GPU tests
do (dxgi_swapchain's SKIP branches exited 0, and with no driver at all it
failed at vkCreateInstance), and is registered with SKIP_RETURN_CODE 77.
2026-11-22 11:46:45 +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