Commit Graph

4163 Commits

Author SHA1 Message Date
2624c78e40 runtime: respect XMA loop end subframes (RT-XMA-LOOP-END-SUBFRAME) 2026-11-25 11:52:54 -06:00
9520db5187 runtime: cap all list-value wait pauses, scale demoted caps, and test Pump 2026-11-25 18:52:28 +01:00
a14f74c2b2 Rebase pending flips when the frame interval changes 2026-11-25 11:35:53 -06:00
c367a1e36d runtime: stop inner_coverage_requirements scan at SPIR-V preamble boundary 2026-11-25 18:20:25 +01:00
1f1248b95d runtime: unlock ImageMemoryPool across driver allocations and fix BlockRanges alignment overflow 2026-11-25 18:12:54 +01:00
ca00cc0e03 xmem: a slot-31 copy leaves the title's own mappings at the paired CPU range
copy_page_mappings (queue slot 31, CopyPageMappingsBatchX) mirrors every page
it maps or unmaps at a GPU-only destination onto the paired CPU range
(title_gpu_views::to_cpu). It did so even where the title had mapped that CPU
page itself with XMemMapPhysicalPages or XMemMapPhysicalPagesScatter: a copy
replaced the title's page, and an unmap (kind 2) left the title's CPU page
reserved. The title's next read of it faulted, and the run ended.

The console's CopyPageMappingsBatchX edits only the GPU-only range's page
table, so a CPU page holding a mapping of the title's (physical, scatter or a
slot-31 copy onto that address) is now left as it is. Pages the mirror made
itself, zero plants and pages with no mapping still follow the GPU-only range,
so the D3D12 layer's reads at the CPU view keep working. Each page kept is
counted and the first ones are logged.

The unmaps these paths make are now labelled in the read-fault report
(CopyPageMappingsBatchX unmap / paired CPU page / remap / hole,
XMemMapPhysicalPagesScatter unmap / remap) instead of the default "unmap".

xmem_test: test_copy_page_mappings_cpu_view now checks that a copy onto, and
an unmap of, a GPU-only page whose paired CPU page the title mapped keep the
title's bytes at the CPU page. Both checks fail on the old code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 18:02:47 +01:00
0120ea194c runtime: refuse duplicate Location 1 outputs and speed up dual_source_fragment preamble scan 2026-11-25 17:48:35 +01:00
5657240e35 rdna2spirv: f16 interp deltas and toward-zero p2 narrow (SHADER-468)
Measured on the RDNA2 iGPU (gfx1036, tools/f16_interp_probe.py, 98,304
samples over 12 native draws): the SPI writes P10/P20 for a 16-bit
channel as per-half f16 differences (round to nearest even), the
weighted sum stays f32, and v_interp_p2_f16 narrows toward zero --
the driver's ISA runs the pair inside s_round_mode 0x000c, so the
narrow is toward zero whatever the shader's own MODE writes are.
The rdna2 model explains 98,274 of 98,304 samples; the previous
translation (f32 deltas, nearest-even narrow) explains 62,226.

- Gen.f16_round: f32 -> nearest-f16 value via f16_bits +
  UnpackHalf2x16 (integer-built bits, so no driver folds the round
  trip away, #512/#513); applied to the P1-P0 / P2-P0 deltas of
  16-bit-channel reads in attribute().
- v_interp_p2_f16 narrows with f16_bits(rtz=True) and keeps the
  SHADER-430 partial-write high half via write_lo16.
- vk_harness: scan both stages for Float16 / StorageInputOutput16 /
  Float64 capabilities (77 when the device lacks them), enable the
  matching Vulkan 1.1/1.2 features, VKH_PC_BYTES to shrink the
  push-constant range for hand-written fixtures, and VKH_SHADER_INFO
  to dump the driver's fragment disassembly.
- tests/semantic/test_interp_f16_round.py: the two telling cases
  (f16 delta overflow to inf; toward-zero vs nearest-even tie).
- tests/semantic/test_interp_p1lv_f16.py: reference oracle updated
  to the measured model (f16 deltas, f32 sum, toward-zero narrow).
- docs/design.md: 16-bit interpolation row records the SHADER-468
  measurements and remaining unverified items.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-25 18:45:22 +02:00
ec95c3c0b4 runtime: pause list value wait timeouts while submitted or held work can still satisfy them 2026-11-25 17:45:11 +01:00
3233b9857f d3d12: track live console-heap V# slots in a host-RAM bitset
When released_backings or title_va_aliases().invalidations() advances,
refresh_console_heap() previously scanned all 32-byte slots of heap.copy
linearly to find live buffer V#s (!(w[3] >> 30) && (w[2] || w[6])). When
heap.copy sits in arena.mapped (uncached write-combined GPU memory), each
buffer release triggered ~180k uncached PCIe reads across a 5.5 MiB heap.

Add a portable host-RAM bitset (leonida::ConsoleHeapVsharpSlots in
runtime/src/console_heap_vsharp_slots.h) updated at every resource-heap
write to heap.copy (fix_console_slot, deferred fix_over zeroing,
for_each_zeroed, and add_console_heap reset), and iterate only live V#
slots during invalidation passes (0 reads from heap.copy; 64 slots skipped
per word via std::countr_zero).

Item: RT-CONSOLE-HEAP-VSHARP-BITSET
2026-11-25 17:20:50 +01:00
9e7720c9e7 Merge pull request #1893 from OreoFR/rt-depth-format-copy-staged
replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED)
2026-11-25 17:19:44 +01:00
ae74f89d1e test: respect LEONIDA_HOST_ADAPTER and layer LUID in d3d12_texture_tiles (RT-TEXTURE-TILES-HOST-ADAPTER)
runtime/test/d3d12_texture_tiles_test.cpp previously used an unguided native_device() adapter loop that ignored LEONIDA_HOST_ADAPTER and the layer's Vulkan device LUID, defaulting to an integrated GPU (e.g. Intel UHD) on dual-GPU laptops even when configured for discrete GPU testing.

Pass vulkan->GetAdapterLuid() to native_device() and query LEONIDA_HOST_ADAPTER matching the pattern in d3d12_buffer_tiles_test.cpp, skipping the native reference comparison cleanly when the requested adapter lacks tier 2 tiled resources instead of failing on the wrong hardware.

AI-assisted (Claude Code)
2026-11-25 19:19:20 +03:00
9439e6083d dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE)
When a boot stops, the startup trace names the files the title opened, but most of its reading goes
through DirectStorage requests and ReadFile on files it opened long before. With LEONIDA_IO_TRACE=<file>,
each DirectStorage request (file, offset, sizes, zlib/BCPack, request name) and each ReadFile, ReadFileEx
or ReadFileScatter on a disk file (path, offset, size) is one line with the local time.

The line is flushed at once into a file shared for reading, so the last reads before a crash are on disk
and can be watched while the game runs. Paths are asked of the handle each time, because a handle value
is reused after a close. io_trace_test covers positioned, overlapped and reused-handle reads, DirectStorage
lines with good and bad name pointers, and pipes being left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:02:02 +05:00
1c5e2dcab1 title HUD: with no frame in an interval, show how long since the last one
A hang read as "0 fps 0.0 ms (worst 0)", which looks like a slow frame. Now it reads
"0 fps, no frame for 12.5 s". title_hud_test checks it after presents stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:01:18 +05:00
e4c413a3a5 heavy pipeline cache: a write covers what was noted before it started, counted, not timed; teardown keeps fast builds too
GetTickCount64 moves in 10-16 ms steps, so a slow build noted during a write in the write's own tick was taken
as written. The schedule now counts notes. And without an offline seed every build goes to the heavy cache:
fast ones never schedule a write, so teardown writes the cache whenever any build went into it, which is what
pipeline_cache.session.bin used to keep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:57:43 +05:00
e86b3ceaa8 d3d12_xs: LEONIDA_TITLE_HUD shows frame rate, memory and pipeline compiles in the window's title bar (RT-TITLE-HUD)
A tester has no way to see, during a boot, whether the game is slow because of frame time, memory pressure or
pipelines compiled in the frame. With LEONIDA_TITLE_HUD=1 the window the title presents in gets, twice a
second:
- fps and the average and worst frame time from PresentX;
- private memory and working set;
- local GPU memory against the DXGI budget, and shared GPU memory;
- pipelines created and the seconds spent in vkCreate*Pipelines in the last interval (with
  LEONIDA_MEM_PROBE);
- time since the first present.

A thread of its own sets the text with SendMessageTimeout, so a busy or hung window thread never holds a
present. title_hud_test drives a real window from another thread and checks the text and the shutdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:51:50 +05:00
ae0a3d0449 d3d12: the device-fault report names what the process and the driver had at each fault address (RT-FAULT-ADDRESS-OWNER)
A fault address alone does not say whose page it is. Each one now also gets:

- VirtualQuery of the same number on Windows: base, allocation base, state, protection and type. A host
  import, a range of the title's memory or a raw CPU pointer that reached a shader shares the number.
- With LEONIDA_ADDRESS_BINDINGS=1, VK_EXT_device_address_binding_report: a debug messenger records the GPU
  range of every buffer, image and allocation the driver binds and unbinds (src/address_binding.h). The
  report lists the live objects containing the page, the nearest below and above, and recently unbound
  objects that held it.

address_binding_test checks the record and the report on synthetic bindings, and the feature and extension
on the device chain. On an RTX 5070 Ti (617.42) the messenger saw ~50,000 binds in a retail boot, and the
world-start WRITE_INVALID address was in none of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:46:00 +05:00
9f1f5bf9a6 d3d12: a pipeline cache for the offline cache's misses, written while the game runs (RT-HEAVY-PIPELINE-CACHE)
pipeline_cache.session.bin can't keep what a crashed run compiled: it is written at device teardown only, and
a cache seeded from the multi-GiB corpus returns the whole corpus, over its write limit. So the slow builds
the corpus misses (the pipeline library's compute programs, 3 to 7 s each on an RTX 5070 Ti) are compiled
again on every boot.

Each graphics and compute build now first asks the corpus cache with
VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT. A miss is built against a second cache, seeded from
pipeline_cache.heavy.bin next to pipeline_cache.bin, so that cache holds only the misses.

A build of at least LEONIDA_HEAVY_PIPELINE_CACHE_MS (500 by default) schedules a write. A thread of its own
writes the cache 3 s after the newest slow build and no later than 20 s after the first unwritten one,
through the session cache's staging file and rename. At teardown it writes what is left. 0 turns it off,
and with it pipelineCreationCacheControl unless LEONIDA_PIPELINE_COMPILE=cache-only asks for it.

Measured with vk_pipeline_check on the RTX 5070 Ti (617.42): a cache-only create of four library compute
programs the corpus lacks returns VK_PIPELINE_COMPILE_REQUIRED in under 1 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:40:23 +05:00
86519799ba runtime: cache helper Vulkan device procs, fix uncounted BDA fault and BAR/cleanup guards (RT-VK-HELPER-PROC-CACHE-AND-GUARDS) 2026-11-25 16:35:30 +01:00
f95b23e518 d3d12: write the session pipeline cache when the run ends with the device alive (RT-SESSION-CACHE-AT-EXIT)
pipeline_cache.session.bin was written only in ~Device. A title never
releases its device, so a real boot kept none of what it compiled: not
after a normal exit, a console close or a crash, and every boot built the
world start again.

save_pipeline_caches_at_exit writes the session cache of every live device
(a registry the Device constructor and destructor keep), once per process,
after stop_pipeline_compiles. A build still running on another thread is
given wait_ms, then the previous file is kept, as at teardown. gta6rt calls
it at the run's exit, at a console close, and from an unhandled-exception
filter (a fault in the title or its DLLs, the int3 after a device loss),
which then passes the exception on, so the exit code is unchanged.

d3d12_compile_teardown_test's exit case checks that the file is written
with the device alive, and only once.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:24:17 +01:00
79a76a75c3 runtime: support dynamic topologies in indirect draws and report per-reason skip counts (RT-INDIRECT-TOPOLOGIES-AND-STATS) 2026-11-25 16:00:22 +01:00
e5a4976224 d3d12: real SO_STATISTICS query pools (D3D-302)
With VK_EXT_transform_feedback enabled on the device, an SO_STATISTICS heap is a real VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT pool, begun and ended indexed on the stream (vkCmdBeginQueryIndexedEXT / vkCmdEndQueryIndexedEXT). ResolveQueryData copies the two 64-bit results (NumPrimitivesWritten, PrimitivesStorageNeeded) in the same order. The layer still refuses StreamOutput PSOs and still does not implement SOSetTargets, so no primitive reaches a stream yet and the counts stay 0; without the feature the heap is made without a VkQueryPool and resolves zeros, as before.
2026-11-25 09:56:34 -05:00
b0f3d3998f Merge pull request #1631 from Tyrannys/title-window-overflow
d3d12: test that a view past the title-window cap is never the raw VA (RT-TITLE-WINDOW-OVERFLOW)
2026-11-25 15:52:34 +01:00
14f04ce2d2 d3d12: stage title textures when the image cannot take host copies
Select the upload path after checking both format features and image usage. Keep required staging available for mapped linear textures and only retry host backing when the image supports it. Exercise both capability failures with synthetic GPU readback.

AI-assisted-by: OpenAI Codex (gpt-6.2-astra)
2026-11-26 00:52:29 +10:00
d2158084cc Merge main into input-out-of-the-box: the input script row from #1843 with the keyboard pad on by default 2026-11-25 19:49:32 +05:00
daf31b820b replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED)
A CopyTextureRegion of the depth plane from a D32_SFLOAT_S8_UINT image into a
D32_SFLOAT one was replayed as vkCmdCopyImage. Vulkan requires depth/stencil
formats to match exactly (VUID-vkCmdCopyImage-srcImage-01548), and the NVIDIA
driver (RTX 4070 Laptop, 621.40) wrote past the end of the D32 image: the
world-start WRITE_INVALID device loss, with the fault at the first byte after a
2560x1440 D32_SFLOAT image (VK_EXT_device_address_binding_report) and this VUID
reported by the validation layer just before the loss.

depth_format_pair: two depth formats with the same depth encoding but not the
same VkFormat (D32 / D32S8, D16 / D16S8, X8_D24 / D24S8) take the image ->
scratch -> image path depth <-> colour and A8 copies already use; the depth
aspect has the same texel layout in a buffer on both sides.

replay_copy_offset_test: the D32S8 -> D32 and D32 -> D32S8 depth-plane copies
are staged (no vkCmdCopyImage, depth aspect, 4 bytes a texel), and D32 -> D32
keeps vkCmdCopyImage. Fails without the change (6 checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:48:26 +01:00
45219a6400 d3d12 test: skip the write-back check when a refused import is a shadow
On a driver that refuses importing a section view (RADV: amdgpu userptr takes
anonymous memory only), the layer answers with a shadow at the same title VA,
so the `may_refuse` early return never fires. The forward readback still
passes through the shadow, but a shadow is never written back, so the new
reverse-copy check failed on an AMD iGPU under Wine. Check the caller's pages
only when the buffer is a real import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:44:19 -05:00
769634dd61 Merge main into fix/host-import-prefix 2026-11-25 09:40:21 -05:00
446574e761 Merge pull request #1785 from IlyassRS3/fix/rt-title-window-and-arena-bounds
runtime: harden title_window_plan and ArenaBlocks bounds/overflow checks (RT-TITLE-WINDOW-AND-ARENA-BOUNDS)
2026-11-25 15:40:05 +01:00
c3b58ef03d Merge pull request #1732 from kawaii-shakal/arena-rebar-cap
d3d12: keep a Resizable BAR arena in VRAM when the driver excludes it from a very large buffer (RT-ARENA-REBAR-FIT)
2026-11-25 15:38:52 +01:00
24a29f8b4e Merge pull request #1827 from DadaCap/title-staged-no-host-copy
d3d12: title images use the staged upload on a device without host image copies (RT-TITLE-STAGED-NO-HOST-COPY)
2026-11-25 15:37:56 +01:00
34ab89f896 tests: enable VK_EXT_transform_feedback in vk_pipeline_check (D3D-302)
The runtime's device enables VK_EXT_transform_feedback whenever the extension is present, and AMD's driver makes it part of a pipeline's cache key, so the cache vk_pipeline_check seeds offline no longer hit in gta6rt: pipeline_cache_seed failed 3/3 on an RX 7900 XT (adrianmjim). Link the same VkPhysicalDeviceTransformFeedbackFeaturesEXT the runtime enables, next to the mesh-shader one, and list it with the other always-enabled extensions in the header and docs/pipeline_check.md.

Tested: pipeline_cache_seed passes on an NVIDIA RTX 3080 Ti (NVIDIA does not key on the extension, so it cannot reproduce the AMD failure). AI-assisted.
2026-11-25 09:35:29 -05:00
66b27ac6e2 lod_bias_probe: measure whether the sampler applies mipLodBias instead of keying --explicit-lod-bias on MoltenVK's driver ID (SHADER-EXPLICIT-LOD-BIAS-MVK)
The same MoltenVK 1.4.2 drops the bias on an Apple M3 and applies it on an
Apple M5 Pro (#1774 review), so the driver-ID rule turned ps_ssharp red on
the M5 Pro. tools/lod_bias_probe.py translates vs_ids and ps_ssharp without
the flag and draws LOD_BIAS 0, +1 and -1 with vk_sampler_test; the flag is
on only when +1 and -1 read the no-bias levels. run_gpu_tests.py, build.py
and make_game.py take its answer; vk_subgroup_info.py is back as on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:18:12 +01:00
aa8018b7ff d3d12: large pipelines compile side by side within a memory budget (RT-BIG-COMPUTE-BUDGET)
Compute modules over 128 KiB and graphics pipelines of 1 MiB of SPIR-V or more wait at one gate for the process until their estimates fit the memory that is free, instead of one at a time. PipelineCompiles::build gives a submission as many lanes for them as can be in at once, largest first, and fills the rest with small ones. A thread that waits for its place holds no PSO's lock, and one that has a place waits for none. The warm-up's compiles are speculative. LEONIDA_SERIAL_BIG_COMPILES=1 keeps one at a time, 0 has no limit, LEONIDA_BIG_COMPILE_BUDGET_MB fixes the budget.
2026-11-25 15:11:11 +01:00
4aa21d1a83 runtime: large compiles wait for memory in arrival order, demand before speculative (RT-BIG-COMPUTE-BUDGET)
LargeModuleGate moves to runtime/src (a forwarding header keeps vk_pipeline_check and its test as they are) and gets a second constructor, whose budget is read whenever a place is given or returned. Its modules get in in the order they came, a speculative one only while no demand waits and within a quarter of the budget. large_compile_budget_bytes() is three quarters of the smaller of the free RAM and the room under the commit limit. CPU test: the bound, one always, order, priority, every wake-up, the budget of the moment and the setting.
2026-11-25 15:11:10 +01:00
71a769d7d8 Merge pull request #1691 from OreoFR/rt-slot57-depth-raster
d3d12_xs: depth, stencil and raster state for slot 57 native pipelines from state blob A (RT-SLOT57-DEPTH-RASTER)
2026-11-25 14:55:52 +01:00
77baf90627 Merge pull request #1703 from OreoFR/rt-dual-source-blend
d3d12: dual-source blending reads SV_Target1 at Location 0, Index 1 (RT-DUAL-SOURCE-BLEND)
2026-11-25 14:46:46 +01:00
02d719cdac Merge main into title-window-overflow; keep only the window-cap test
Main's ba626820e already handles a title address past
LEONIDA_TITLE_WINDOWS_MB: the persistent geometry copy backs it, or
else every view writer emits a zero-size V# (loads 0, stores dropped),
so the raw VA never reaches the GPU (#1537). That replaces this branch's
zeroed scratch window, so the runtime and docs side take main's version.

The d3d12_title_window_cap test stays, rewritten for main's behaviour:
with a cap of 0, two CBVs of private title memory are written zero-size
(no base, no records, never the raw VA), no window is made, and a
dispatch through one reads zeros. Main had no test that dispatches
through an over-cap title address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:41:35 -06:00
5e95fa2f46 Merge pull request #1671 from OreoFR/rt-slot57-blend-state
d3d12_xs: blend state for slot 57 native pipelines from state blob A (RT-SLOT57-BLEND-STATE)
2026-11-25 14:28:49 +01:00
9a96b8ba6a gameinput: preserve controller transitions between polls 2026-11-25 13:25:48 +00:00
03096929f4 Merge main into first-run-pad-focus
Keep main's first-run profile without GPU completion labels and this
branch's focused keyboard pad (LEONIDA_KEYBOARD_PAD=1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:19:48 -06:00
857314142c Use the single Vulkan array layer for 3D image views 2026-11-25 16:17:47 +03:00
06c3b4a6ac RT-D24-CPU-ROUNDEVEN: Depth24 CPU conversions independent of the thread's rounding mode
depth24_quantize multiplied in float and rounded with std::nearbyint, and depth24_to_float divided in double and
narrowed to float; all three follow the calling thread's rounding mode, while depth24_convert.comp is roundEven of a
correctly rounded product and integer arithmetic. Under FE_DOWNWARD or FE_TOWARDZERO 0x1p-23f quantised to 1, not 2,
so CPU clears (vulkan_replay.h depth24_clear_value) could disagree with GPU uploads and copies.

No fesetround (a library must not change the caller's environment, and fenv access can be compiled out). No existing
helper fits (vulkan_replay.h's round_half_even is in a header that includes this one's users and rounds only once), so
depth24_detail::round_even is floor/fmod based like it: exact in every mode. The float product is formed exactly in a
double (24 x 24 bits), rounded to 24 significant bits by scaling with ldexp and round_even, then rounded to the
integer, which is the shader's two roundings. depth24_to_float uses the shader's integer formula,
float(m + 1) * 2^(e-47), every step exact.

depth24_cpu_test (no GPU, no Vulkan loader; same pattern as clear_color_test) runs the conversions under
FE_TONEAREST, FE_DOWNWARD, FE_UPWARD and FE_TOWARDZERO and compares with a float multiply + nearbyint reference run
under the default mode, with fixed cases (0x1p-23f -> 2, 0.5f -> 8388608 tie to even).

AI-assisted. Checked with g++ -std=c++20 -O2 (also -frounding-math, -ffast-math); not built with MSVC.
2026-11-25 13:16:42 +00:00
59c1586d4e d3d12: LEONIDA_HOST_IMAGE_COPY switch, auto off on NVIDIA
The layer enables VK_EXT_host_image_copy for WriteToSubresource and
ReadFromSubresource whenever the device has the extension and its
hostImageCopy feature. On an RTX 4070 SUPER (Windows 11) a real boot lost
the device with WRITE_INVALID in 7 of 7 runs that used host image copies
and in 0 of 2 that did not. The mechanism is not known yet.

LEONIDA_HOST_IMAGE_COPY chooses: 0 never, 1 whenever available, auto (the
default, also for unset or unrecognized text) as 1 except on NVIDIA
(vendorID 0x10DE), where it is off. Off, the extension is neither enabled
nor chained, so no image gets host-transfer usage and every CPU texture
copy takes the existing staging submit, as on a device without it.

The choice is a pure function (src/host_image_copy_policy.h) with a unit
test of its table, and device creation logs one line with the choice and
the reason in place of the old "no VK_EXT_host_image_copy" line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-25 08:07:27 -05:00
ca68cb7859 fix: stage texel-misaligned imported host texture copies 2026-11-25 14:01:35 +01:00
56846f650d tests: isolate host-prefix coherence and preserve full heap coverage 2026-11-25 14:01:35 +01:00
3f81c4015b d3d12: preserve logical offsets in sub-page host imports 2026-11-25 14:01:35 +01:00
9428f57da2 runtime: share indirect clamp buffers across queue families and fix safety bugs
Pass device queue families into IndirectArgumentClamp and its ScratchBuffers so both clamped-argument scratch chunks and HostArea counter buffers are created with VK_SHARING_MODE_CONCURRENT when graphics and async-compute families differ (matching enable_copy_scratch).

Also fix four safety/correctness issues in runtime/src/vulkan_indirect_clamp.h:
- Free VkDeviceMemory before retrying the next memory type when vkBindBufferMemory fails in make_area(), and guard vector push_back against allocation failure.
- Zero released HostArea counter words after reading them so a later aborted/unsubmitted batch reusing the same slot never double-counts prior counters.
- Reject non-4-byte-aligned argument_offset and count_offset in prepare() (the compute clamp reads uint32 words via BDA).
- Read areas_[slot.area].buffer under mutex_ in prepare().

Item ID: RT-INDIRECT-CLAMP-SHARING-AND-SAFETY
Claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162686562
2026-11-25 13:46:01 +01:00
ea6d535ff5 d3d12: title images use the staged upload on a device without host image copies (RT-TITLE-STAGED-NO-HOST-COPY)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:40:50 +01:00
c68f494160 RT-INPUT-SCRIPT-NO-SDL3: serve LEONIDA_INPUT_SCRIPT without SDL3
A build without SDL3 answered GameInputCreate with no devices and E_NOTIMPL
for every other slot, so the title waited at its first "press A" prompt
forever: no CI artifact or offline build could get past it.

With LEONIDA_INPUT_SCRIPT set, gameinput_no_sdl.cpp now serves one scripted
pad (an Xbox One gamepad) driven by the script alone: device enumeration
through RegisterDeviceCallback (blocking, async, dispatcher), FindDeviceFromId,
and GetCurrentReading/GetNextReading/GetPreviousReading whose gamepad and UI
navigation state follow the script. Readings are taken when the title asks,
so no thread polls. Without the variable it behaves as before.

The parser, the 300 ms timeline, the button names, the press log lines and
the UI navigation mapping move from gameinput.cpp into gameinput_script.h,
which both shims use; nothing in it needs SDL. gameinput.cpp checks the
shared SDL button numbers against SDL_GamepadButton at compile time.

gameinput_no_sdl_test --input-script (CTest gameinput_no_sdl_script) checks
the scripted pad on a fake clock. Docs: runtime/README.md, docs/gameinput.md,
docs/linux_proton.md, docs/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:39:13 -05:00