Commit Graph

4696 Commits

Author SHA1 Message Date
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
15350f6da6 rdna2spirv: seed the POPS collision word so the wait loop ends (SHADER-POPS-COLLISION-SEED)
A pixel shader with an ordered section (POPS) reads the hardware's collision word, which sits in the SGPR after the
user SGPRs and the primitive mask: collision wave id in bits 0-9, this wave's id in bits 16-25, overlap in bit 31.
The program waits until wave_id + ~collision_id is below src_pops_exiting_wave_id + ~collision_id (unsigned). The
translator orders the section with fragment-shader interlock and reads the exiting id as 0, and the word was
whatever the push constants held at that dword, usually 0. With wave id == collision id the test is
0xffffffff < 0xffffffff, never true, so a wave that reached the loop ran it until the loop guard (65,536 rounds).
The overlap test before the loop skips it whenever a lane is on in EXEC, so it is a wave (a host subgroup) with EXEC
all off there; on 32-wide subgroups that is either half of a wave64 program whose lanes are all off.

The SGPR is now the source of the program's wave-id extract (s_bfe_u32 with field 0x000a0010) when the program reads
that SGPR's entry value (shader_meta's user_sgpr_reads), and it is set at entry to 0x00010000 (no overlap, wave id 1,
collision id 0): the loop leaves after one round. A program without that extract keeps the old behaviour.

- tools/rdna2spirv.py: pops_collision_sgpr and the entry store.
- tests/semantic/test_pops_collision_seed.py: subgroups of 64 and 32 lanes, with and without the seed, and the SGPR
  search; the GPU fixture runtime/test/shaders/ps_pops_wait_loop.asm (check.py, run_gpu_tests.py) and its llvm-mc
  listing.
- tests/semantic/spirv_wave_interp.py: the interlock instructions run as no-ops (a run has no other primitive).
- runtime/test/vk_harness.cpp: a fragment shader that needs pixel interlock on a device without it is unsupported
  (77), as for barycentrics.
- docs/design.md, docs/d3d12_vulkan.md: the POPS rows.

GPU: on an RTX 4070 SUPER the fixture gives 4096 of 4096 pixels as expected; with the seed taken out every pixel's
round count is 0x00010000.

Idea from Marvisak/VIctory 7ac1f54, written anew.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-25 19:45:31 -05:00
13e0d78eb4 test: bind a PSO before direct heap dispatch 2026-11-25 21:43:35 -03:00
2769c5a739 d3d12: never defer buffer V#s past console-fix budget (RT-CONSOLE-FIX-NEVER-DEFER-BUFFER-VSHARP)
In fix_console_slots, when the LEONIDA_CONSOLE_FIX_US budget expires, do not null or defer buffer descriptors (!(w3 >> 30)). Only defer image T# descriptors to retry_console_slots.

Buffer V# descriptors only rebase address offsets and are fast to fix, whereas image T#s perform costly texture lookups and view creation. Compute shaders during world transition (e.g. lib_cs_01144) read loop bounds and record counts from buffer descriptors; nulling them causes infinite loops and device loss.

Tested with console_heap_vsharp_slots_test and vk_console_heap_gpu_test.

AI-assisted (Claude Code).
2026-11-26 03:39:08 +03:00
bbc7506559 d3d12: stub draws only for this device's mesh stubs; =color stubs override the state that hides them
Review follow-up for #1549:
- record_draw no longer skips a draw with an unregistered PSO: graphics stubs are registered now, so a draw with a PSO from another implementation fails the list again (Close: E_INVALIDARG), as on main. A stub records its kind (none, compute, mesh) when stub_or creates it; stub_pipeline_kind(pso, device) gives it only for the list's own device, and DispatchMesh skips only that mesh stub's draws. A mesh draw with another device's stub fails the list. record_dispatch keeps main's bypass.
- LEONIDA_STUB_PIPELINES=color turns off the title's culling, wireframe fill, sample mask, alpha to coverage, depth and stencil tests, blending and logic op for the stub, keeping the write mask. The B4G4R4A4 fallback's refusal of blending and logic ops now waits until it is known whether the pipeline is such a stub.
- docs/boot.md: the cover needs a triangle topology and stays inside the scissor; what is turned off; which draws stay recording errors.

d3d12_stub_draw_test: =color with CULL_MODE_BACK, FILL_MODE_WIREFRAME, SampleMask 0 and a reverse-Z GREATER test against a depth target cleared to 0; a draw with another implementation's PSO (switch off); DispatchMesh with a mesh stub on its own device's list (closes) and on another device's (fails). Each fails on fa223d8 or on the first version of this fix; every case is reported. The B4G4R4A4 path has no test (the GPUs here render A4R4G4B4).
2026-11-25 21:35:42 -03:00
78159b8865 d3d12: LEONIDA_STUB_PIPELINES builds a real graphics pipeline from built-in stages (MVP-GPU-04)
A graphics PSO whose translated shader is missing used to be created with no Vulkan pipeline and never
registered. Its draws did not become no-ops as the comment said: record_draw refused them, so the whole
list failed to close.

Now a vertex pipeline with a missing translation (no shader library, or no entry for its FSSM/FSPX
program) takes a vertex and a pixel stage from src/stub_pipeline.h and goes through the normal
create_graphics path: registered, built eagerly, drawn through replay and the validation layer.

- LEONIDA_STUB_PIPELINES=1: the vertex stage puts every vertex outside the clip volume, so a draw
  changes no pixel (the old intent), but the render pass, attachments and push constants are real.
- LEONIDA_STUB_PIPELINES=color: every three vertices cover the viewport and the pixel stage writes
  magenta (1 to UINT/SINT targets) to each render target, so stubbed passes show on screen.
- Point-list PSOs get a PointSize write; the vertex stage's Position is a bare output, so
  rect_list_geometry takes it.
- Compute and mesh stubs stay unregistered; record_draw and DispatchMesh now skip a draw on an
  unregistered pipeline as record_dispatch already did, instead of failing the list.

d3d12_stub_draw_test draws with both modes into an RGBA8 and an R32_UINT target and reads them back;
d3d12_stub_pipelines_test now expects a registered pipeline. docs/boot.md describes the switch.
2026-11-25 21:35:10 -03: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
a42bffdc3e Merge origin/main into heavy-pipeline-cache
main's per-pipeline compute journal (pipeline_cache_journal.h) now persists every compute build and survives a
crash, so the compute build takes main's build_compute_pipeline and the heavy cache keeps graphics pipelines only.
CMake keeps both test sets; docs and the create_pipeline comment say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 05:27:39 +05:00
f36d89ebcc Merge remote-tracking branch 'origin/main' into title-texture-partial-mips
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-26 01:26:03 +01:00
4d811fcee9 Merge remote-tracking branch 'origin/main' into shadow-keep-gpu-writes
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-26 01:23:09 +01:00
0ebd4286ea d3d12: a slot-133 shadow keeps the GPU's writes where the title's bytes did not change (LEONIDA_SHADOW_KEEP)
ShadowPages copies pages that carry no sign of a title write (aliased,
unguarded, reopened with their 64 KiB block, write-watched or pinned) at
every refresh, and that copy overwrote what a shader had stored in the
shadow with the title's unchanged bytes. A value a compute program writes
for the next frame then read back as the title's old bytes every other
frame.

Each tracker now keeps a 64-bit sum per 256-byte piece of the bytes it
copied last (runtime/src/shadow_keep.h) and copies a piece only when the
title's bytes differ. Zeroed pages forget their sums. LEONIDA_SHADOW_KEEP=0
copies every job whole, as before. New CPU-only test shadow_keep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gt9hwRYcpySx4P4ncQ3wD5
2026-11-26 01:22:14 +01: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
de3ee203b2 Merge remote-tracking branch 'origin/main' into vk-pipeline-large-admission
Conflict in runtime/test/large_module_gate.h: kept main's forwarding header to runtime/src/large_module_gate.h (unchanged) and put LargeModuleQueue after the include; it admits with the gate's admits() and a blocking Ticket under its own mutex, so try_enter and the try_to_lock Ticket are no longer needed.
2026-11-26 00:58:30 +01:00
a1df1713d4 d3d12: LEONIDA_TITLE_PARTIAL_MIPS fills the readable smaller mips of a title texture whose larger ones are not there
The XG layout of a 2D texture of one slice stores its mips from the smallest to the largest, so the mips from m on
are a prefix of its footprint (mip_chain_bytes). With LEONIDA_TITLE_PARTIAL_MIPS=1 the readability probe returns the
readable prefix (texture_memory_readable_bytes), first_mip_within the first mip it holds; when the last slot-70 view
starts there or later, those mips are filled and only the T#s of views that start there or later are published. The
others stay on the fallback until a later fill has their mips. A texture not filled, or filled in part, whose pages
came through a map change is marked stale so the next pass fills it.

Off by default: the image still has memory for every mip. LEONIDA_TITLE_PARTIAL_MIPS_MB (2048) bounds the image
memory of the textures filled in part. Unset, the behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gt9hwRYcpySx4P4ncQ3wD5
2026-11-26 00:44:13 +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
c5359a4644 d3d12: the window write-back waits for the submission that wrote (RT-TITLE-WINDOW-WRITE-BACK)
The first cut copied the reached ranges back at the next refresh whether or not
the submission that wrote them had finished, so a range the GPU was still
filling could be read half done.

A batch is now kept with the retire ticket of the submission that will use it,
and the ranges are copied back only once the context reports that ticket done.
Anything not yet retired stays queued and is copied on a later refresh, still
before that refresh's forward copy, so the ordering that keeps the title's own
newer bytes is unchanged.

The test is unchanged and still passes: it asserts the pages are untouched
until the next submission and then hold exactly what the shader wrote.
2026-11-25 23:30:33 +00: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
dcdcade326 runtime: address review of the pipeline order recorder
- open(): when the existing log does not end with a newline (a process killed
  mid-line), write one first so the next session line is not glued to the cut
  line and its records are not filed under the previous run.
- Fix the hook comments (vulkan_replay.h, d3d12_vulkan_device.cpp, docs,
  README): the hook never blocks and allocates nothing, but the readiness
  callbacks take a non-blocking try_lock on the first request of a pipeline
  and of a variant.
- Close the order log after the exit pipeline cache write, not before.
- Remove the unused Slot::written and Slot::build_written.
- Tests: cut file then new session, flush stops at an unpublished slot,
  unknown session version rejected. Trailing whitespace fixed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 00:07:37 +01: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
cdbbb39554 Merge remote-tracking branch 'origin/main' into feat/pipeline-order-recorder 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
b145659304 Merge remote-tracking branch 'origin/main' into fix/explicit-lod-bias-moltenvk
# Conflicts:
#	tools/vk_subgroup_info.py
2026-11-25 23:54:57 +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
7a4d1f7721 runtime: record the order of first pipeline requests behind LEONIDA_PIPELINE_ORDER_LOG=1
RT-PIPELINE-PREWARM-ORDER phase 1. With the variable set to 1 the D3D12 device
appends, per compute, graphics and mesh pipeline and variant that the title
uses for the first time, one line to pipeline_order.log beside
pipeline_cache.session.bin: the description key, the variant, creation and
first-use times since the process started, the build time and whether the
handle was ready. One line of counts at exit. Off by default: nothing reads the
file yet, and a run without the variable carries no hook. It touches no cache
file, the memory gate or the compile queue.

The mesh pipeline's key folds in the MS hash (the graphics key does not cover
it). Documented in runtime/README.md and docs/d3d12_vulkan.md, and the doc test
checks the variable is read and named in both.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 23:47:38 +01:00
40e94ebb20 runtime: pipeline order recorder and replay request hook (RT-PIPELINE-PREWARM-ORDER, phase 1)
pipeline_order.h: a passive recorder of the first request of each pipeline and
variant, with its text file format (checksummed lines, truncated or damaged
lines skipped on read) and a lock-free, allocation-free hot path with a writer
thread of its own. ComputePipeline and GraphicsPipeline get a `requested`
callback, called where a submission is prepared, also for handles that exist
already. Nothing uses either yet; the device wiring is the next commit.

Tests (CPU only): pipeline_order_test (first request only, variants, order,
round trip, truncation at every byte, damaged lines, sessions, full record,
bounded file, unwritable file, 8 threads, no allocation, counts line) and
replay_pipeline_order_hook_test (ready, lazy, skipped, unbound variant).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 23:47:38 +01:00
c5f1807515 rdna2spirv: translate v_cmpx in DPP form (SHADER-VOPCX-DPP)
Extend #957's DPP VOPC compare to v_cmpx: the same lane selection, with the
result written to EXEC. v_cmpx prints no destination, so src0 is its first
operand. Only the forms where every lane writes its bit are taken, as for
v_cmp. 78 pipeline-library pixel shaders of 1.0.2.1 were refused for it; all
78 now translate and pass spirv-val.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 23:36:00 +01: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