Commit Graph

27 Commits

Author SHA1 Message Date
273b3bdf9d [integration] Linux/Proton and native Windows: boot through the story load (RT-PROTON-STORY-LOAD)
One squashed commit of a fork that was developed on a Linux/Proton machine and
tested on two native Windows machines. On all of them the retail 1.0.2.1
package now launches, shows its launch movie, first-run pages and landing
prompt, runs the story load to its end with the loading slideshow drawing its
artwork, and enters the world phase. A first world frame is not verified yet.
docs/linux_proton.md has the setup, a healthy boot's timeline, the machines
and where it stops.

Runtime: frames in the title's own window; DirectStorage pinned reads,
page-list scatter/gather, BCPack and unshuffle with a locally generated
predictor file; pooled, device-local and deferred image backing for streamed
and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table
that degrades instead of refusing a submission; a descriptor hash finalizer
(off until a library carries it); directly indexed heap offsets for compute
dispatches and VS/PS/GS draws; title buffer windows outside a fragmented
arena; opt-in device-local copies of streamed buffer views; write-fault
retries under the tracker lock, shared trackers and write-watched title memory
for native Windows; device-loss, compute-input and memory probes.

Translator: loop bounds at structured exits, the eight FidelityFX programs
that use a packed-dot form the disassembler skips, buffer bounds modes per
view kind, a compaction option, the hash finalizer option.

Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows
boot script, the paired compute translation script.

No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted
by people on the machines named in docs/linux_proton.md.

Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-24 11:42:12 -06:00
c89b413448 Finish a pending presenter capture before reusing its staging buffer 2026-11-23 22:05:11 +00:00
88797f3ebd d3d12: LEONIDA_CAPTURE writes the presented frames to disk
A question that keeps coming back on the boot path is "what is actually on screen", and the window is not a reliable
answer: under Wine it is not mapped at all, and even on Windows a compositor or a capture-blocked surface can hide
the content. The presenter already copies every presented frame into a staging buffer when capture is enabled, so
this adds the disk side: `LEONIDA_CAPTURE=<dir>` writes each captured frame as a binary PPM and appends the extent
and the mean RGB to `<dir>/index.txt`, with `LEONIDA_CAPTURE_EVERY` and `LEONIDA_CAPTURE_LIMIT` bounding the run.

Off unless set, and created with the folder if it is missing. The write happens on the fence that already covers the
copy, so the present path is untouched.

d3d12_present_test turns it on and checks the files against the colour the test clears to: at least half the captured
frames (it resizes and injects failures on purpose, so a frame caught mid-transition is a near miss), and no frame
black. A capture that reads the wrong or a stale buffer fails there instead of in a report months later.
2026-11-24 00:48:42 +03:00
059f79129b presenter: recover a lost surface instead of a sticky E_FAIL (#6832)
Squash-merged after diff review of PR #6832 - presenter: recover a lost surface instead of a sticky E_FAIL
2026-11-23 09:55:22 -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
57c175391d Revert #2490: its console-ABI list proxy breaks run_tiny_frame (please rebase and split)
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 04:42:53 -05:00
f0aaf26cc1 Merge pull request #4662 from kapitche
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:57 -05:00
72c6b0a0a9 d3d12_present_test: do not assert the screen pixel for a GPU that does not drive the window's monitor 2026-11-22 22:50:49 -05:00
fa5f26db8e Merge origin/main: DXGI device fields coexist with the console-ABI device state 2026-11-22 20:39:59 -07:00
7cc353106f d3d12_xs: PC-shaped lists for PC callers, atomic queue layout, S_OK queue tail
Review findings from shdann's Windows run of the new console queue/list
work:

- d3d12_debug_markers (and every GPU harness compiled against the PC
  headers) drove lists through the console-shaped proxy, so PC slots past
  26 — including the PIX markers at 56-58, which have no console
  counterpart — reached unrelated console methods or were dropped.
  create_device_proxy gains console_lists: false hands the real
  (PC-shaped) list back from CreateCommandList. The GPU tests pass false;
  the title path keeps the console default.
- queue_proxy asserted E_NOTIMPL for the queue's console tail, but those
  slots deliberately answer S_OK now — frame pacing flows through them.
  The test's contract is updated; the fence tail stays refused.
- ChildProxy::queue_layout was a plain unsigned char read and written
  from many threads; it is atomic like the device-wide detection it
  caches.

xs_proxy_mock_test and loader_test pass under Wine; the modified test
objects compile clean under clang-cl. The GPU harnesses need a real
adapter — covered by shdann's Windows run.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 18:41:23 -07:00
27be996d4f Merge pull request #3578 from Emma 2026-11-22 17:02:48 -05:00
f38b10ea5b Tests: d3d12_present_test reads the screen only where its own window is on top
The on-screen colour check ran whenever the test's window was the foreground window, but the foreground window
can still be covered at its centre (an always-on-top window, or one another process showed without taking the
foreground). GetPixel on the screen DC then returned that window's pixel and the test failed, although the
presented images had already been checked: 3 of 20 runs on the Radeon iGPU and 5 of 30 on the RTX 3070 with
another application in use.

A read now counts only when WindowFromPoint at the centre, taken to its root window, is the test's window before
and after the read; otherwise the check is skipped with a line saying the centre is covered, like the existing
"not in front", HDR and CLR_INVALID skips. A pixel that is not the clear colour is read again every 50 ms for up
to a second before the EXPECT, since how long the compositor takes to show the last frame is not known; nothing is
presented meanwhile, so a wrong colour that stays still fails. A click-through layered overlay is not seen by
WindowFromPoint and still fails the check; the comment says so.

docs/d3d12_vulkan.md: the sentence on the check names the new condition.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 22:46:40 +02:00
5c2cf9074f Merge pull request #3016 from 0xTehuti 2026-11-22 15:14:05 -05:00
36343d86b1 test: prevent present and swapchain tests from stealing focus (SW_SHOWNOACTIVATE) 2026-11-22 20:07:03 +01:00
6a2246c299 TEST-330: check presented colour via swapchain readback under Wine 2026-11-22 18:19:43 +01:00
98e9acfb91 Merge pull request #1908 from Jolymmiles 2026-11-22 10:39:19 -05:00
17a27f23cc d3d12_present_test: check the presented images through the capture, GDI screen read only where it works
Under Wine's macOS driver the test failed at its last step, the GDI read of the screen: GetPixel on the screen DC
returns CLR_INVALID there for every pixel, even one GDI painted itself (BitBlt from the screen DC fails too), and
the window's own DC holds Wine's GDI surface (white), not the image presented through the Metal layer. The
presenter itself was fine: all the injected-failure checks passed, MoltenVK made 320x240 and 400x300 swapchains
at contents scale 1.0, and the driver reported no out-of-date presents. The "present failed" lines in that log
(VkResult -1000001004 twice, then -1 = VK_ERROR_OUT_OF_HOST_MEMORY) are the test's own injections; markers around
them showed each line inside its injection.

The test now enables the presenter's capture and checks the whole presented image for the clear colour at the
swapchain's size after the first 60 frames, after the resize and at the end, on every platform. The screen check
stays where GDI can read the screen; a CLR_INVALID there is reported and skipped instead of failing. The test also
says on stderr that the next three "present failed" lines are expected, since they were read as faults twice.
Checked under CrossOver's Wine 11 with MoltenVK 1.4.3 on an Apple M3 Max: the test passes, and with the clear
colour changed the capture check fails at the first 60 frames.
2026-11-22 18:59:21 +04:00
a24d8cc6ba runtime: fallback and clamp swapchain extent when surface reports undefined extent (D3D-165) 2026-11-22 19:48:05 +05:30
1f71839aa3 runtime: fallback and clamp swapchain extent when surface reports undefined extent (D3D-165) 2026-11-22 18:59:51 +05:30
85520f2a64 Merge pull request #1560 from Instru Control 2026-11-22 07:38:12 -05:00
1cca596655 Merge pull request #1391 from Flyander 2026-11-22 07:37:55 -05:00
ec6645401d [TEST-200] Make M1 CTest skips accurate 2026-11-22 13:13:38 +01:00
84a0b02161 Test Vulkan swapchain retry after a surface query failure 2026-11-22 15:43:12 +03:30
95288af6df Tests: skip d3d12_present on-screen colour check on HDR displays (TEST-209)
On a Windows HDR desktop, DWM scales SDR content by the user's configured
SDR white level, causing GDI GetPixel reads to reflect the boosted and
potentially clipped values (e.g. 66,205,255 for a 51,153,230 clear).

Use IDXGIOutput6::GetDesc1 to check if the monitor displaying the test window
is running in HDR mode (DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020), and skip
the on-screen colour check with an informative message if so, avoiding false
test failures.

Tested on AMD Radeon RX 9070 (driver 26.10.1, Windows 11).
AI-assisted.
2026-11-22 13:03:17 +01:00
de47dbd0aa d3d12_present_test runs under ctest; skipped (77) without a Vulkan device with presentation
tests/test_ctest_registration.py requires every built *_test to be run by
ctest. d3d12_present_test now exits 77 when vktest::Device can't be created
with presentation, like xbox_present_test, and is registered with
SKIP_RETURN_CODE 77.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:53:04 +01:00
Ryx
147f9300cf Runtime: presenter survives failed submits and recreations, and counts only shown frames (review)
From VictorJulianiR's review of the presenter, with Vonsek's measurements:
- A failed blit submission left the frame's fence reset with nothing to signal it, so the next present waited
  forever (Vonsek: the retry reached vkWaitForFences with UINT64_MAX). An empty batch now takes the acquire
  semaphore and signals the fence, and the swapchain is recreated next time to give back the image that was
  never presented. If that batch fails too, or a fence wait or reset fails, the presenter stops (ok() is
  false). A back buffer the device does not know is refused before an image is acquired for it.
- A swapchain recreation published the new swapchain before its per-image semaphores existed, so a failed
  semaphore left a presenter that could submit with a null one. The images and semaphores are now built in
  local storage and published only when all exist; on a failure the partial objects are released and the next
  present tries again.
- An out-of-date present was counted as presented (Vonsek: 69 VK_SUCCESS and one VK_ERROR_OUT_OF_DATE_KHR
  reached 70). presented() now counts VK_SUCCESS and VK_SUBOPTIMAL_KHR only; the caller still gets VK_SUCCESS.

d3d12_present_test gives the device and presenter their functions through a driver double that forwards to the
real driver. It counts real out-of-date presents (the frame counts allow for them) and live binary semaphores.
It reports one present as out of date and one as suboptimal, fails the second semaphore of a recreation, and
fails one blit submission. Against the old presenter the test fails at the frame count after the resize, where
this RTX 5060 Ti reported a real out-of-date present.

Docs: the presenter is named as leonida::VulkanPresenter, made by rt::d3d12::create_window_presenter, and the
test is described as 60 frames then 10 after a resize (AlxcBTW).
2026-11-22 04:55:03 +01:00
Ryx
e876fc830e Runtime: present D3D12 back buffers to a window on Vulkan (milestone M0)
- vulkan_present.h: VulkanPresenter blits a back buffer (an ordinary texture
  in D3D12's PRESENT state, layout tracked like any other) to an acquired
  swapchain image and presents it on the same VkQueue, after the
  application's work. Two frames in flight, a present semaphore per image,
  FIFO for vsync else MAILBOX/IMMEDIATE, swapchain recreated on resize or
  out-of-date/suboptimal, minimised windows skip presents.
- rt::d3d12::create_window_presenter / WindowPresenter: Win32 surface for a
  Vulkan device created with presentation; holds the device. This is the back
  end a DXGI shim or PresentX would call; the game's own front end is still
  open (docs question 6), so neither is invented here.
- Standalone device enables VK_KHR_surface/win32_surface and VK_KHR_swapchain
  when present; the test helper can too.

Test: d3d12_present_test opens a window and presents 60 frames through the
Xbox-ABI proxy (reset, PRESENT->RENDER_TARGET, clear, ->PRESENT, execute,
present, fence), resizes the window (swapchain recreated, scaled blit),
switches to unsynchronised presents, and reads the screen with GDI:
51,153,229 for a 51,153,230 clear. Clean under the Khronos validation layer,
as are the other GPU tests; 6/6 ctest.
2026-11-22 04:54:51 +01:00