Commit Graph

3847 Commits

Author SHA1 Message Date
beffaa9a47 Merge main into fix/null-descriptor-generated-dir 2026-11-26 12:19:12 +01:00
a73a57e133 Merge pull request #2187 from aslan2142/device-markers-amd
device-fault: AMD buffer-marker breadcrumbs name the dispatch that hung (RT-DEVICE-MARKERS-AMD)
2026-11-26 04:35:46 +01:00
e418c1e4b6 vulkan: AMD breadcrumbs name the dispatch that hung (LEONIDA_DEVICE_MARKERS)
On RADV a GPU hang ends in VK_ERROR_DEVICE_LOST with no checkpoints, so the
device-fault report lists the 64 dispatches in flight but cannot say which
one stopped the queue.

LEONIDA_DEVICE_MARKERS=1 (with LEONIDA_DEVICE_FAULT=1 or 2) enables
VK_AMD_buffer_marker where the device has it. Every dispatch the report
numbers writes its seq into its queue's slot of one persistent host-visible,
coherent buffer: at top of pipe before the dispatch (started) and at bottom
of pipe after it (finished), with vkCmdWriteBufferMarker2AMD. On a loss or a
stall report each queue's last finished and started seq are printed, and
the oldest started, unfinished dispatch is reported as the likely hang and
marked in the submitted-dispatch list. A history of the last 16,384
dispatches names it when it has left that list. The values are best-effort
after a loss, and the report says so.

The seq is now handed out when a dispatch is recorded, so the marker and
the list share one numbering; it counts every recorded dispatch, and the
list can show gaps where a submission recorded more than 64.

Cost with the switch on: two marker writes per dispatch and one history
entry; with it off nothing changes. Without the extension, or without
LEONIDA_DEVICE_FAULT, one "device-markers: unavailable" line is logged.

Tests: vulkan_device_markers (portable: numbering, marker writes, ring,
likely-hang verdicts, the 32-bit wrap) and vk_device_markers (a real device:
after the wait the started and finished markers equal the last seq; SKIP
without the extension).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:29:35 -05:00
b3e541b224 d3d12_xs: drop the null-RTV marks of a descriptor heap when it is released
The null-view marks (#1504, by ubiquitarianism) are kept by the real CPU
handle. They were moved by descriptor copies and cleared by a view made
with a resource, but never dropped when the heap went away, so an RTV heap
made later at the same address inherited stale marks and its clears were
skipped. The heap proxy now records an RTV heap's real CPU range and
heap_release drops the marks in it. The barrier conversion keeps no state
across calls, so it needs nothing here.

xs_proxy_mock_test: an RTV heap's marked view is skipped while the heap
lives and cleared after it is released; a mark outside it stays; a second
heap at the same address starts unmarked and marks again. docs/d3d12_vulkan.md
says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 22:03:00 -05:00
7b1fe62850 Keep main's watchdog switch and say where the peek default went
f0611b752 took the executable's addresses out of the code. Two behaviours
changed with it; the removal stays, the changes are now explicit:

- runtime/src/main.cpp: the watchdog kick runs again only with
  LEONIDA_TITLE_WATCHDOG=0, as on main; LEONIDA_TITLE_WATCHDOG_KICK only
  supplies the two RVAs it needs. Either variable alone leaves the
  watchdog armed and the loader says so once (before this commit the kick
  ran whenever LEONIDA_TITLE_WATCHDOG_KICK was set).
- scripts/windows-boot/boot.ps1 no longer has the game- and
  session-state RVAs built in, so LEONIDA_PEEK has no default and the
  RESULT states read "?" unless LEONIDA_GAME_STATE_RVA and
  LEONIDA_SESSION_STATE_RVA are set. The script now warns when they are
  not, and runtime/README.md (LEONIDA_PEEK, LEONIDA_TITLE_WATCHDOG and
  _KICK rows), scripts/windows-boot/README.md and docs/first_run_ui.md
  say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:55:15 -05:00
8d686309b0 Merge main into integration/boot-combined (RT-BOOT-COMBINED)
Conflict in runtime/shims/d3d12_xs_device.cpp, proxy_copy_descriptors_simple:
keep this branch's copy_null_rtv_marks call and main's fsdraw::enabled()
gate for the descriptor-copy diagnostic.

tools/rdna2spirv.py merged without a textual conflict, but #1662 on main
calls restore_dot4_inline_sel in the exact re-anchoring path, which this
branch had deleted. The merge puts main's function back so that call
resolves; the next commits reconcile it with the dot4 op_sel rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:49:53 -05:00
7f3d0095a2 Merge pull request #2094 from qhukz13/cont/geometry-view-eviction
d3d12: evict geometry views on range release and retry refused ranges
2026-11-26 03:43:17 +01:00
bbc8ef17c6 test: geometry views across a submission's replays, invalidation and block removal
geometry_views_test case 13 runs DeviceState's order for one submission with
an idle GPU (completed == submitted): execute_begin, the drain at
kAfterExecutes in before_execute_, the replay records its ticket, execute_end.
Another queue's replay began before the release and one more begins after
the retirement. It checks that
- the drain retires the view but does not reap it (a ticket read in the drain
  reaped it in the same call),
- the view waits until every replay begun before the retirement recorded its
  submission, then for the last of their tickets, and not for the later replay,
- the retirement invalidates answers made without an alias (forget_copy:
  changed_ranges, invalidations, take_removed),
- the destroyed block leaves for_each_block, changes layout_generation and is
  reported to the device (title_block_gone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:31:52 -05:00
702fbaa969 test: keep geometry_views_test's GeometryViews off the stack
Since #2098 every TitleBufferWindows carries a 128 KiB published_ array, so the
eight GeometryViews this test puts on the stack pass the 1 MiB Windows default
and the test died at startup with a stack overflow. They are heap-allocated now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:31:45 -05:00
b21b47b052 d3d12: no table keeps naming a destroyed title-window block
#2098's TitleBufferWindows::published_ and update_gpu_backed assumed blocks are
never destroyed: for_each_block fed every block made so far into the console
heap pass's backed table, and the table was rebuilt only when the published
count grew. With empty blocks now destroyed, a freed block stayed in the table,
and its "never of memory that is not there" contract broke.

- A destroyed block's published_ slot keeps its other fields; only its address
  (now atomic) goes to 0, and for_each_block and find_mapped skip it. A slot is
  never reused before release(), so a lock-free reader never sees one half
  rewritten.
- layout_generation() changes whenever a block is made or destroyed;
  update_gpu_backed uses it instead of the block count to see a change.
- destroy_block tells the device (DeviceState::title_block_gone): the block's
  span goes into released_ranges, as a released backing's does, so the backed
  table cuts it at once and the key entries and heap slots answering into it go
  at the next refresh. A block is destroyed only once its last range was freed,
  after the GPU work that used it completed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:30:07 -05:00
266f335dda d3d12: a retired geometry view invalidates the answers it made without an alias
forget_geometry_alias only removed the view's alias ranges. vsharp_address and
placed views take geometry_va() answers straight from GeometryViews, with no
alias entry, so a retirement left the console heap slots translated through
them, and the GPU key table's entries, pointing at the view after its reap.

TitleVaAliases::forget_copy records the retired view as a removal: its title
range (CPU address and GPU twin) goes into changed_ranges with an invalidations
bump, so the console heaps translate those slots again, and its shader VA into
take_removed, so the GPU key table drops answers into it. That is what remove()
does for a range that has an alias; recording the answers instead would cost a
table entry per answer on the hot path, while this costs one entry per
retirement. The retirement runs before refresh_shadows() (previous commit), so
the submission about to run already translates without the view.

pool_spans keeps a retired view's shader_va, but only for its statistics line;
nothing answers from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:28:25 -05:00
861bb0546e d3d12: reap a retired geometry view only after the replays that may name it
drain_geometry_releases retired released views at submitted_retire_ticket(),
read in before_execute_. The submission about to run records its own ticket
only after that, so it was not covered, and with an idle GPU
(completed == submitted) drain_released reaped the view in the same call,
before the lists recorded against it ran. A sparse bind in the same replay or
another queue's replay can take tickets in between, so submitted + 1 is not
enough either.

- VulkanContext::set_after_execute: called at the end of every replay that
  called before_execute_, however it returns, once its submissions are recorded.
- GeometryViews::execute_begin/execute_end track the replays in progress. A view
  retired at kAfterExecutes takes the serial of the last replay begun once it
  is unreachable, and gets its ticket (submitted_retire_ticket(), read under
  the views' lock) only when every replay up to that serial has ended.
- before_execute_ drains before refresh_shadows(), so this submission's console
  heap slots are never translated to a view retired in the same call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:28:04 -05:00
50afd24e94 vk_texture_test: tag index 1 as bound in both sampled arrays it fills (2D and 2D array)
Since #2098 a tagged module reads its instruction's array only when the table entry's kind names it. The harness
binds index 1 in images[1] (binding 0) and in the 2D-array images[1] (binding 3), but tagged it 2D only (2D array
in cube mode), so ps_array_resinfo and ps_get_lod_array read the 1x1 fallback on every driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:25:04 -05:00
7d38eee116 Merge main into RT-GEOMETRY-VIEW-EVICTION
Conflict in runtime/shims/d3d12_title_buffer_windows.h: main (#2098) added the
lock-free published_ block list (for_each_block, find_mapped); this branch
destroys empty blocks. Both are kept; a destroyed block's published_ entry is
cleared here, and the follow-up commits make that safe for the lock-free readers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:22:30 -05:00
3abb99cad9 Merge pull request #2159 from quartz-heron-58/gameinput-script-reads
gameinput test: read the pad before expecting a scripted press to end (TEST-GAMEINPUT-SCRIPT-READS)
2026-11-26 03:15:40 +01:00
ef34931860 Merge pull request #2123 from qhukz13/cont/d16s8-d24-uav
d3d12: depth-stencil UAVs for console D16S8 (format 118) made as D24S8
2026-11-26 02:52:29 +01:00
ad41fd5175 Merge pull request #2059 from qhukz13/cont/test-serialize-win10
d3d12_title_va_test, d3d12_compute_test: serialize root signatures through the shared helper, so the heap-directly-indexed cases run on Windows 10
2026-11-26 02:25:52 +01:00
9ea22eaf44 gameinput test: read the pad before expecting a scripted press to end (TEST-GAMEINPUT-SCRIPT-READS)
Since #2098 a scripted press lasts its 300 ms and then until the title has made
six GetCurrentReading calls since it began. gameinput_test --input-script still
expected the press to be over after 350 ms and three reads, so ctest
gameinput_script failed on main in every build with SDL3 (it is disabled
without SDL3, so CI did not show it).

The test now checks that the press is still held at that point, reads the pad
six more times and then expects the release. Test only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 08:28:59 +08:00
8d832fd109 Merge main into rt-title-every-budget (#2122)
#2098 split the every-pass loop of refresh_title_textures by mode: with
LEONIDA_TEXTURE_REFRESH_ASYNC every persistent mapping is polled each
pass and only stale unmapped textures are visited, without it all mapped
or stale ones are. The async branch is kept as main has it.
LEONIDA_TITLE_EVERY_BUDGET_US applies to the synchronous pass, the one
before a submission on the submitting thread; under async the pass runs
on the refresh worker and the limit does not apply (README says so).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:04:24 -05:00
c50ed94b35 Merge pull request #2098 from Moriz82/pr/upstream-1125
Improve post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)
2026-11-26 01:01:15 +01:00
fc71534883 Make the live compute warm-up limit opt-in; main's warm-up stays the default
#2098's LEONIDA_COMPUTE_WARMUP_LIVE_MAX_BYTES defaulted to 128 KiB, so while the title submits it skipped exactly the
large modules main's warm-up (#1889) exists to build, with LargeModuleGate already ordering them behind a submission's
compiles. At the maintainers' decision ("main wins") it is opt-in now: unset or 0 is no limit, as on main; <n> leaves
warm-ups of modules over n bytes to their first use while the title submits, as #2098 measured with 131072.

This reverts the test-side override of fb60a1cf4: d3d12_big_compute_warmup runs with main's environment again. The
switch is documented in runtime/README.md beside the other #2098 switches, and in docs/d3d12_vulkan.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:37:48 -05:00
3a2820b3bf Merge main c1e1ef0b8 into RT-POST-LOAD-GPU-MEMORY (#2098)
Two conflicts:

- d3d12_com.cpp, note_direct_heap_indexing: main's console_descriptor_table_va(cbv_srv_uav_base_) for the tracked
  table, with this branch's per-site once() flag instead of note_once on every draw.
- d3d12_vulkan_device.cpp, PipelineState::build_compute: this branch's body (build_compute_pipeline, journal, compile
  helper). main's dev_status::Build around the compute create moves into build_compute_pipeline, next to the
  pipeline_profile::DriverCall, so the status line still names the compute pipeline in the driver.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:36:19 -05:00
33bd07cf86 Merge pull request #1176 from abnalstlll-byte/feat/test-wine-timeouts-device-filter
runtime, tests: bound dstorage and dxgi tests with ctest timeouts and route device filter tools through wine (TEST-WINE-TIMEOUTS-DEVICE-FILTER)
2026-11-26 00:32:02 +01:00
75f6890bb9 Keep the storage view's pNext chain alive for the 2D-array mirror view
#2098's 2D mirror of a 2D-array image (BindlessSet::MirrorViews) copies storage_info, pNext chain and all, after the
block that made the storage view. That chain (VkImageViewUsageCreateInfo, VkImageViewSlicedCreateInfoEXT) was declared
inside the block, so the mirror's vkCreateImageView followed a dangling pointer into stale stack; winevulkan walked it
without end. That was the 120 s hang of d3d12_existing_heap (and its two variants), d3d12_r9g9b9e5_uav,
d3d12_depth_stencil_uav, xbox_depth_storage and xbox_d16s8_storage on lavapipe and the iGPU alike: each makes a UAV
of a 2D-array (or cube) texture. The two structs are declared before the block now.

Found with a winedbg backtrace of the hung test (bind_image_views_locked's make_mirror lambda, line 6604), then
confirmed by disabling the mirror in a scratch tree: all six tests pass then too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:30:31 -05:00
c1e1ef0b81 Merge pull request #1953 from abnalstlll-byte/feat/rt-lazy-pipeline-f16-top-location
d3d12, test: pass device_.f16_half_top_location in lazy graphics pipeline stage_words (RT-LAZY-PIPELINE-F16-TOP-LOCATION)
2026-11-26 00:27:57 +01:00
093be901ae Merge pull request #2141 from abnalstlll-byte/feat/rt-direct-heap-arena-remap
d3d12: remap directly-indexed heaps to arena shader VA (RT-DIRECT-HEAP-ARENA-REMAP)
2026-11-26 00:27:10 +01:00
1f64d91c3f xg_xs_test: a render target without a mode takes main's general layout model
#2098 added a check that XGCreateTextureComputer refuses a render target with no layout mode (E_NOTIMPL). On main the
second (general) layout model lays out the render targets xg_xs_layout.h does not, and xg_xs_test already expects
S_OK for those ("the other render targets still use the general layout model"). The check now says the same for this
one: the explicit-mode model refuses it and the general model makes the computer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:21:39 -05:00
fb60a1cf4a d3d12_big_compute_warmup: run without the live warm-up limit
main's warm-up test has the warm-up thread build every compute module after a submission. Its 132 KiB modules are over
#2098's LEONIDA_COMPUTE_WARMUP_LIVE_MAX_BYTES (128 KiB by default), which leaves big warm-ups to their first use while
the title submits, so four of them were never started and the test's "each once" check failed. The limit is a
separate feature from the gate order the test checks; it is set to 0 for this test only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:20:18 -05:00
38385762bd dev overlay: the title HUD's VRAM and private memory figures
LEONIDA_DEV_OVERLAY (#2137) showed the working set and free RAM, with
no GPU memory and no private memory. It now shows both, from the same
code as the title HUD:

- src/memory_figures.h holds VramBudget, the private-bytes choice (the
  larger of PrivateUsage and PagefileUsage, since Wine fills only the
  latter), the "RAM ..." and "VRAM ..." text with "n/a" where there is
  no figure, and a publisher for the device's GPU memory figure. No
  Vulkan, and Win32 only under _WIN32, so the overlay's test still
  builds on every host.
- A device with VK_EXT_memory_budget publishes a reader when it is
  created and withdraws it first thing when it is destroyed (the lock
  is held during a read, so a reader never outlives its device).
  latest_vram() calls the reader at most once per 500 ms for both
  views. The HUD reads it instead of its own per-device lambda.
- The overlay's last line is now "RAM 2.5 GB (ws 1.0)   VRAM
  3.5/16.0 GB +0.5 shared"; cores and free RAM keep their own line.

Tests: dev_overlay_test checks the text with and without figures, the
private-bytes fallback, and the publisher (one read per refresh, only
the publishing device withdraws). title_hud_test checks that a HUD
without its own source shows the published figure.
d3d12_vram_budget_test checks that the device publishes its figure
while it lives and withdraws it on release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:18:57 -05:00
d4fb292344 Merge main into rt-title-hud-vram-budget
Brings in #2137 (LEONIDA_DEV_OVERLAY), which the next commit extends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:18:55 -05:00
7b1d71e218 Leave the layer's below-arena V#s alone in the table scan
#2098's scan_title_table nulls a table V# whose base nothing backs (rebase_title_vsharp's `unbacked`). A V# the
layer wrote itself for one of its own buffers that the driver put below the arena holds the low 48 bits of a negative
offset, which the shaders read sign-extended (vsharp_address accepts it). On the RDNA2 iGPU, upload buffers live in
ReBAR memory below the arena, so the scan took such a V# for an unbacked title address and nulled it before the
dispatch read it: d3d12_compute, d3d12_fspx_compute, d3d12_unmapped_vsharp, d3d12_graphics_indirect_heap_resources
and d3d12_compile_teardown failed there and passed on lavapipe, where the buffers sit above the arena.

rebase_title_vsharp now leaves a base with bit 47 set alone when its sign-extended offset is one of the layer's
backings (gpu_backings), as vsharp_address reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:15:45 -05:00
b83ae01f5c Build pipelines through main's PipelineCompiles path again, not #2098's pre-pass
At the maintainers' decision, main's compile path wins over #2098's second one. #2098 made every lazy PSO
asynchronous (async_build = true) and built what a submission needs in a pre-pass of VulkanQueue::execute, one
pipeline after another on the submitting thread, with a per-variant state machine (replay_get / replay_await) and a
wait budget (LEONIDA_PIPELINE_WAIT_MS, LEONIDA_PIPELINE_WAIT_FRAME_MS). That bypassed PipelineCompiles and
PipelineWorkers (parallel compiles with resource_mutex_ released, #1742) and the LargeModuleGate budget (#1889), which
d3d12_pipeline_workers(_eager) and d3d12_big_compute_* check.

Removed: the pre-pass (collect_pipeline_awaits, await_pipelines, PipelineAwait, ComputePipeline/GraphicsPipeline::
await), PipelineState's Build states, replay_get/replay_await, set_pipeline_build_hook, the wait budget and its 10 s
line, and d3d12_pipeline_wait_test, which tested only that. PipelineState is wired as on main again: async_build =
LEONIDA_ASYNC_PIPELINES, queue_build for asynchronous builds, build_compute / variant through PipelineCompiles
otherwise.

Kept from #2098, adapted to main's path:
- the record-time build request (request_pipeline_build): queue_build without counting a skip;
- compile-helper deferral: a compute build the helper is still making publishes nothing, so its next use asks again;
- big warm-ups left to their first use while the title submits (LEONIDA_COMPUTE_WARMUP_LIVE_MAX_BYTES):
  src/pipeline_wait.h keeps only the last-submission time this reads, noted by VulkanQueue::execute.
docs/d3d12_vulkan.md, "Pipelines still being built", says what is left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:05:25 -05:00
ffcfe68f12 Merge pull request #2137 from Snooozs/dev-overlay
runtime: LEONIDA_DEV_OVERLAY shows what the runtime is doing over the title's window (RT-DEV-OVERLAY)
2026-11-26 00:02:32 +01:00
a0723a9e92 Merge pull request #671 from aslan2142/frame-pacer-bounded-queue
OLD-9189: restore old upstream PR 9189 - FramePacer: at most `latency` frames in flight while armed (mailbox replace)
2026-11-26 00:01:37 +01:00
8564bb48bb Merge pull request #688 from aslan2142/game-rmdir-create-race
OLD-9215: restore old upstream PR 9215 - file_system: RemoveDirectory and a create inside the folder are ordered as on the host
2026-11-26 00:00:45 +01:00
d4681041ec Merge pull request #710 from aslan2142/gpuav-as-type
OLD-8414: restore old upstream PR 8414 - d3d12: arena AS resources take their address from vkGetAccelerationStructureDeviceAddressKHR
2026-11-25 23:59:57 +01:00
340e8a415c Merge pull request #638 from aslan2142/skip-int3-wine
OLD-7824: restore old upstream PR 7824 - startup_trace: LEONIDA_SKIP_INT3 works on title threads and with Wine's breakpoint address
2026-11-25 23:59:09 +01:00
92170fe7af d3d12: remap directly-indexed heaps to arena shader VA (RT-DIRECT-HEAP-ARENA-REMAP)
In write_direct_heaps(), the bound resource and sampler heaps were passed using raw cbv_srv_uav_base_ and sampler_base_. For console descriptor heaps shadowed in the GPU address arena, this supplied the title's host console VA rather than the shader VA where GPU descriptor reads land, triggering GPU device loss (READ_INVALID) in compute/graphics passes during world transition.

Remap the bound bases through console_descriptor_table_va() before writing them to user SGPRs and tracking in remember_table() and graphics_user_data(). Update d3d12_set_descriptor_heaps_test to assert that recorded dispatch user data receives the remapped console_descriptor_table_va addresses.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-26 01:58:24 +03:00
696d70da19 Merge pull request #677 from aslan2142/root-sig-flag-mask
OLD-7234: restore old upstream PR 7234 - d3d12_xs: pin that the root-signature flag mask keeps every public flag (old upstream PR 7140)
2026-11-25 23:58:18 +01:00
809d1869af Merge pull request #657 from aslan2142/root-constants-zero
OLD-8904: restore old upstream PR 8904 - root_signature: accept root constants of 0 values, as the host does (D3D-942)
2026-11-25 23:57:31 +01:00
d34c426ef9 Merge pull request #684 from aslan2142/t-drive-overlay
OLD-8161: restore old upstream PR 8161 - file_system: T: is a folder of each process's own in the overlay
2026-11-25 23:56:38 +01:00
722fee9af6 Merge main into delay-import-thread-order-notes (#643)
#634 rewrote the same runtime/README.md paragraph on the loader. Its text
stays, and its relocation sentence takes this PR's wording: DIR64 and
HIGHLOW relocations, the other types rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:54:12 -05:00
21d3662ad8 Merge pull request #634 from aslan2142/loader-rebase-without-reloc-dir
OLD-8847: restore old upstream PR 8847 - pe_loader: move an image with no relocation directory; refuse only on IMAGE_FILE_RELOCS_STRIPPED
2026-11-25 23:53:26 +01:00
d86ac98133 Fill a never-filled mapped texture before its first submission (async refresh)
OreoFR's point on #2098 holds: with LEONIDA_TEXTURE_REFRESH_ASYNC=1 the before-execute hook only wakes the refresh
worker (request_title_refresh), so a slot-133 texture the title maps, writes and uses in its next submission (a video
plane) can be read empty by that submission while the worker has not come to it.

The hook now first fills, on the submitting thread, the mapped textures that were never filled (mapped && !fills),
with try_to_lock on the registry: the worker may hold it for a fill that needs this queue, so it does not wait. A
fill that needs generic staging is left to the worker, as the pass does. Everything else stays on the worker.

Test: d3d12_mapped_plane_async (d3d12_existing_heap_test --mapped-plane-async, which sets the switch itself) maps a
written R8 plane and copies it to a readback buffer in the first submission, with host image copies and with the
staged upload; every byte must be the written one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:50:07 -05:00
844519ab59 Merge main into stream-output (#1630)
Brings in main after #1891, so main's tip is the single merge base;
no conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:35:35 -05:00
1bf5eeafd7 Merge pull request #1891 from BubsMcgee/tf-device-foundation
d3d12_vulkan_device: detect and enable VK_EXT_transform_feedback + vk_pipeline_check parity (D3D-TRANSFORM-FEEDBACK-DEVICE)
2026-11-25 23:32:25 +01:00
17b5992b83 Merge pull request #804 from aslan2142/test1700-rdna3-repacking
OLD-7505: restore old upstream PR 7505 - w64_graphics, design: the wave32 VS run is the halves of the wave64 waves, not a repacking (TEST-1700)
2026-11-25 23:31:14 +01:00
f6cb4aedfc runtime: LEONIDA_DEV_OVERLAY shows what the runtime is doing over the title's window (RT-DEV-OVERLAY)
A click-through window of its own with its own thread: frame and submission rate, a submission's CPU time by phase, the
phase running now, pipeline builds in flight, indirect draws, cores and memory. Off by default. submit_phases keeps
per-phase counts of the threads inside a phase, so overlapping submissions of several queues leave none behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:28:38 +01:00
6100d3c43c runtime/README.md: name the 29 switches #2098 reads
tests/test_docs_env_vars.py failed: LEONIDA_TEXTURE_REFRESH_ASYNC, LEONIDA_SUBMIT_ASYNC, the LEONIDA_CONSOLE_HEAP_GPU
family, the shadow GPU copies and the diagnostics this branch reads were in no document. One row each in "Switches of
the D3D12 layer for a retail boot", from the comments at the code that reads them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:28:22 -05:00
8dc07b3a4b d3d12, test: unify f16 halves linking helper and pass top_location in lazy stage_words (RT-LAZY-PIPELINE-F16-TOP-LOCATION)
Move per-pipeline f16 halves linking into a shared helper PipelineState::link_f16_halves
called by both eager create_graphics() and lazy stage_words() paths, always passing
device_.f16_half_top_location. Previously, stage_words() omitted top_location, causing
it to default to 29 and relocate outputs beyond the device limit on hardware where
maxVertexOutputComponents < 124 (e.g. top_location = 14 on 64-component limits).

Add f16_half_top_location to VulkanDeviceInfo (0 = read from device limits; non-zero =
override for testing low-limit devices).
Expose rt::d3d12::pipeline_stage_words() to allow inspecting linked lazy pipeline SPIR-V.
In runtime/test/d3d12_f16_halves_test.cpp, add low top_location = 14 tests verifying that
out-of-budget pipelines are rejected at CreateGraphicsPipelineState, in-budget pipelines
relocate within location 14 and execute correctly through the lazy path on first draw, and
explicitly verify that the linked SPIR-V stage modules' highest Location does not exceed 14.
Keep unit check #11 in runtime/test/spirv_f16_halves_test.cpp.

Tested:
- spirv_f16_halves_test (passed)
- python -I scripts/check_no_game_data.py runtime/shims/d3d12_com.h runtime/shims/d3d12_vulkan_device.cpp runtime/test/d3d12_f16_halves_test.cpp (clean)
No retail game data or keys.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-26 01:25:22 +03:00