Commit Graph

2729 Commits

Author SHA1 Message Date
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
6312c057f8 xgameruntime: export XErrorReport, which XGameRuntimeInitialize requires
xgameruntime.lib's XGameRuntimeInitialize looks up "XErrorReport" with
GetProcAddress next to QueryApiImpl, the InitializeApiImpl* entries and
UninitializeApiImpl, and refuses to initialise when it is missing. In the
retail executable that is the lookup at +0x55e2b7e and the null check at
+0x55e2c08, after which boot stops at an int3 (+0x5a91c21).

The shim now exports XErrorReport(HRESULT, const char*) as a DLL export,
forwarding to the IXErrorImpl report it already served (callback, S_OK).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 15:34:37 -05:00
b7a3fed28d pe_loader: give a /GA executable its own TLS at index 0 (retail boot AV at exe+0x104075)
The retail game_scarlett_master.exe is built with /GA: it reads its TLS as
ThreadLocalStoragePointer[0] directly, without _tls_index, because the process
EXE always owns index 0. Mapped into gta6rt, index 0 belongs to gta6rt.exe, so
the game's allocator read gta6rt's TLS block and faulted at exe+0x104075.

load() now rewrites each `mov r64, gs:[58h]` in the EXE's executable sections
(53,246 sites in the retail exe) to `mov r64, gs:[1480h + 8 * slot]`, reading a
TlsAlloc slot (TEB->TlsSlots). Each thread's value there is a small view with
the image's TLS block at [0] and at [tls_index]. The rewrite is the same length
and runs before any of the image's code, TLS callbacks included. DLLs and
images whose index is already 0 are left alone; LEONIDA_TLS_GA_PATCH=0 turns it
off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 15:34:37 -05:00
718e27ba6a docs: public D3D12.X presentation/device slots and x64 layouts (#6522)
Squash-merged after diff review of PR #6522
2026-11-23 12:54:03 -06:00
3ca3c4725d tiny_game_abort_test: the native reference accepts Wine's abort() exit code 3 (#6539)
Squash-merged after diff review of PR #6539
2026-11-23 12:50:05 -06:00
713a949b5b runtime(spirv_stores): check every declared member [0, total) is NonWritable (#6550)
Squash-merged after diff review of PR #6550
2026-11-23 12:47:18 -06:00
56fafc6896 GPU tests: exit 77 when maxPushConstantsSize < push_bytes in vk_compute_test, vk_store_test and vk_sampler_test (#6554)
Squash-merged after diff review of PR #6554
2026-11-23 12:46:09 -06:00
7e1571a96f test: root UAV s4:s5 in the counted indirect dispatch shader (#6566)
Squash-merged after diff review of PR #6566
2026-11-23 12:42:57 -06:00
0c6ff794c2 resource_detile: prevent uint32/size_t size wraparound and reject overlapping spans (#6567)
Squash-merged after diff review of PR #6567
2026-11-23 12:42:41 -06:00
a86d7f9508 d3d12: an integrated GPU reports UMA and refuses MEMORY_POOL_L1 heaps, as the host does (#6569)
Squash-merged after diff review of PR #6569
2026-11-23 12:42:09 -06:00
dfe4e4ad3a d3d12: guard null pInputElementDescs and validate graphics/compute PSO descriptors (#6689)
Squash-merged after diff review of PR #6689
2026-11-23 12:36:37 -06:00
1599683caf d3d12: reset predication in ClearState and align SetPredication / AtomicCopyBuffer validation (#6815)
Squash-merged after diff review of PR #6815
2026-11-23 12:32:05 -06:00
23060e0877 runtime: xg_xs.dll shim, XGCreateTextureComputer and XGSuggestSwizzleMode as traced E_NOTIMPL (RT-489) (#6891)
Squash-merged after diff review of PR #6891
2026-11-23 12:29:34 -06:00
b036470cea D3D12_FEATURE_D3D12_OPTIONS: answer the five booleans from the enabled Vulkan features (#6578)
Squash-merged after diff review of PR #6578
2026-11-23 12:25:31 -06:00
4da716493f d3d12: reject null arrays and invalid lists in ExecuteCommandLists (#6610)
Squash-merged after diff review of PR #6610
2026-11-23 11:16:29 -06:00
f6a00fc4d8 rdna2spirv: --fma khr covers the f64 FMAs (v_div_fmas_f64) with OpFmaKHR on doubles (#6635)
Squash-merged after diff review of PR #6635
2026-11-23 11:10:12 -06:00
6adeaf0b25 Runtime: guard closed-list IA/OM/PSO state setters and expand D3D12 Close parity tests (#6644)
Squash-merged after diff review of PR #6644
2026-11-23 11:07:42 -06:00
2c7095ddf5 fix(test): isolate mods scratch directory per process (#6660)
Squash-merged after diff review of PR #6660
2026-11-23 11:03:38 -06:00
17cc9a7a92 d3d12: validate and track SetDescriptorHeaps and directly-indexed root flags (#6674)
Squash-merged after diff review of PR #6674
2026-11-23 11:00:10 -06:00
a6a7aba987 regen_fixtures: find the generated fixtures by their header instead of the SHADERS list (#6680)
Squash-merged after diff review of PR #6680
2026-11-23 10:58:55 -06:00
e76640014a docs: the AMD driver took 34 minutes on LeafRehydration's dispatch-loop module; the current translation compiles in 3 s (SHADER-995) (#6739)
Squash-merged after diff review of PR #6739
2026-11-23 10:49:09 -06:00
0656b0b200 Loader: W lookups find a mapped image by its non-ASCII name; ANSI lookups ignore case outside ASCII (#6754)
Squash-merged after diff review of PR #6754
2026-11-23 10:47:01 -06:00
86a7807dd4 Barycentric fallback on by itself on AMD's Windows driver for gfx90c (#5933) (#6828)
Squash-merged after diff review of PR #6828
2026-11-23 10:42:42 -06:00
042c5f3783 xmem: physical pages, default allocators, XMemIsToolsMemAvailable; XMemVirtualAlloc takes 2 MiB pages and placeholders (#6919)
Squash-merged after diff review of PR #6919
2026-11-23 10:40:07 -06:00
99c7509671 rdna2spirv: implement 14 image_gather4_{c_l,cl,c_cl,b,b_cl,c_b,c_b_cl}[_o] variants (#5206)
Squash-merged after diff review of PR #5206
2026-11-23 10:38:36 -06:00
1924c8f91c fix(runtime): validate PE64 headers and executable section bounds in code_hooks (#5395)
Squash-merged after diff review of PR #5395
2026-11-23 10:37:31 -06:00
5cf3dafe3e runtime: honor mapped executable argv startup modes (#6117)
Squash-merged after diff review of PR #6117
2026-11-23 10:36:08 -06:00
e0816d6af2 pe_loader: a static load's DllMain gets a non-NULL lpvReserved (#7307)
Loader::initialise(Module&) called every DllMain(DLL_PROCESS_ATTACH) with
lpvReserved NULL. Microsoft's DllMain reference: "If fdwReason is
DLL_PROCESS_ATTACH, lpvReserved is NULL for dynamic loads and non-NULL for
static loads." The executable gta6rt maps and the DLLs it imports are the
static case; a run-time LoadLibrary (load_runtime_module) and a
GetProcAddress forwarder (resolve_module_export) are dynamic.

Each Module now records whether it was mapped inside a run-time load, and a
static module's DllMain gets a pointer to a CONTEXT captured for the call.
TLS callbacks and the process detach in ~Loader (an unload: NULL) are
unchanged.

loader_test: a host load() + initialise() must give a non-NULL lpvReserved
(fails on main), the same image through load_runtime_module NULL. The
lifecycle observer checks lpvReserved on detach only.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:30:32 -06:00
26fdf4170b file_system: CopyFile2 falls back to CopyFileExW on Wine 9 (RT-237) (#3655)
Squash-merged after diff review of PR #3655
2026-11-23 10:04:42 -06:00
a637671a94 mods: a mod.json with a UTF-8 byte-order mark loads; UTF-16 is named; contexts are bounded before the cast (#6724)
Squash-merged after diff review of PR #6724 - mods: a mod.json with a UTF-8 byte-order mark loads; UTF-16 is named; contexts are bounded before the cast
2026-11-23 10:00:38 -06:00
4da521de3e xgameruntime: serve XAccessibilityImpl and XLauncherImpl offline (speech synthesis, launcher) (#6810)
Squash-merged after diff review of PR #6810 - xgameruntime: serve XAccessibilityImpl and XLauncherImpl offline (speech synthesis, launcher)
2026-11-23 09:58:41 -06:00
35b4a8e00d d3d12_xs: D3D12ConfigureVirtualMemoryX returns S_OK (RT-5 first call) (#6792)
Squash-merged after diff review of PR #6792 - d3d12_xs: D3D12ConfigureVirtualMemoryX shim (first unimplemented call of the title)
2026-11-23 09:58:30 -06:00
2ae127201c runtime: build host_adapter_test only with the Windows runtime (#6783)
Squash-merged after diff review of PR #6783 - runtime: build host_adapter_test only with the Windows runtime
2026-11-23 09:55:52 -06: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
9b72d0d2cc tests: check sparse buffer sharing evidence within each API dump record (#6756)
Squash-merged after diff review of PR #6756 - tests: verify sparse queue-family indices within each buffer record
2026-11-23 09:55:11 -06:00
8714c3503b [RT-197] Add the XMA2 decoder C ABI boundary (#3441)
Squash-merged after diff review of PR #3441
2026-11-23 09:54:45 -06:00
9a9ca1ec14 d3d12: match Windows recording-time ExecuteIndirect validation (#6830)
Squash-merged after diff review of PR #6830 - d3d12: match Windows recording-time ExecuteIndirect validation
2026-11-23 09:53:12 -06:00
c3f171d0cb allocator_proxy, queue_proxy tests: take the guard fault's code in the filter (#6864)
Squash-merged after diff review of PR #6864 - allocator_proxy, queue_proxy tests: take the guard fault's code in the filter (Wine 9)
2026-11-23 09:53:02 -06:00
e1b51bf95c Exercise bounded integer 2D texel fetches in the pixel sweep (#6785)
Squash-merged after diff review of PR #6785 - Exercise bounded integer 2D texel fetches in the pixel sweep
2026-11-23 09:52:44 -06:00
87c6c2b261 file_system_test: a refused delete keeps the host's attributes, not the ones set (#6861)
Squash-merged after diff review of PR #6861 - file_system_test: a refused delete keeps the host's attributes, not the ones set
2026-11-23 09:52:38 -06:00
ee56bf9335 runtime: a timed condition-variable wait releases its mutex on Wine 9 (#6847)
Squash-merged after diff review of PR #6847 - runtime: a timed condition-variable wait releases its mutex on Wine 9
2026-11-23 09:51:06 -06:00
1d73504242 runtime: retain import report when initialization fails (#6835)
Squash-merged after diff review of PR #6835 - RT-486: Retain the import binding report when initialization fails
2026-11-23 09:50:42 -06:00
2c72b0d281 d3d12: validate DXR acceleration-structure prebuild and recording inputs (#6825)
Squash-merged after diff review of PR #6825 - d3d12: validate DXR acceleration-structure prebuild and recording inputs
2026-11-23 09:49:28 -06:00
43a9c04501 Exercise translated pixel image_load through a matched integer descriptor (#6833)
Squash-merged after diff review of PR #6833 - Exercise translated pixel image_load through a matched integer descriptor
2026-11-23 09:48:21 -06:00
bc773d3073 rdna2spirv: v_pk_mul_lo_u16 forms each half as ((x << 16) * y) >> 16 (#6836)
Squash-merged after diff review of PR #6836 - rdna2spirv: v_pk_mul_lo_u16 forms each half as ((x << 16) * y) >> 16 (AMD driver drops the mask)
2026-11-23 09:45:17 -06:00
997d130892 dxgi_device_test: under Wine 9 the default adapter provider finds no adapter (#6873)
Squash-merged after diff review of PR #6873 - dxgi_device_test: under Wine 9 the default adapter provider finds no adapter
2026-11-23 09:44:00 -06:00
2dbcb882c9 d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80 (#6935)
Squash-merged after diff review of PR #6935 - d3d12_xs: route the public HLE's Xbox device slots 48/73/78/79/80
2026-11-23 09:42:42 -06:00
e15e2c59ea RT-5: the retail executable reaches 17 GDK runtime classes through 161 linked thunks, and imports no xgameruntime.dll (#6751)
Squash-merged after diff review of PR #6751 - RT-5: the retail executable reaches 17 GDK runtime classes through 161 linked thunks, and imports no xgameruntime.dll
2026-11-23 09:39:20 -06:00
51d010100d xgameruntime notes: settle the assumptions the executable's thunk list answers (RT-5 follow-up) (#6865)
Squash-merged after diff review of PR #6865 - RT-5 follow-up: settle the xgameruntime assumptions the executable's thunk list answers
2026-11-23 09:35:55 -06:00
a365b5c85c xgameruntime_store: measure XStoreGameLicense's 104-byte layout from the retail executable (#6884)
Squash-merged after diff review of PR #6884 - xgameruntime_store: measure XStoreGameLicense's 104-byte layout from the retail executable
2026-11-23 09:35:34 -06:00