Commit Graph

4696 Commits

Author SHA1 Message Date
b65ec46b7c runtime tests: vk_null_descriptor_test builds without glslangValidator
ba626820 added the test with a guard in main only: without glslangValidator
CMake leaves LEONIDA_TEST_NULL_DESCRIPTORS_SPV undefined, but run() still
names it, so the file does not compile and the Linux runtime build, which
installs no glslang (runtime.yml linux-gpu-tools), stops there. Compile the
helpers only with the shader, as main already assumes, so the test reports
itself unsupported (77) like the other GLSL-based tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:46:48 +01:00
61c3421875 Keep queued flips when reapplying the frame period 2026-11-25 12:46:44 -06:00
e54c69175a d3d12: evict geometry views on range release and retry refused ranges
RT-GEOMETRY-VIEW-EVICTION: free GeometryViews entries when their backing
title range is released or unmapped, deferring Vulkan storage reclamation
until in-flight GPU work completes, and retry cap-refused ranges once
budget is freed.

- Queue released title ranges from xmem (XMemFree/Default, VirtualFree
  MEM_RELEASE/MEM_DECOMMIT, XMemMapPhysicalPages unmap, CopyPageMappingsBatchX
  unmap range) via leonida::geometry_writes::note_released.
- Add coalesced sub-range freeing and empty-block Vulkan destruction to
  TitleBufferWindows.
- Retire overlapping views immediately from lookup/find/refresh/watch and
  title_va_aliases, and reap their backing storage once
  completed_retire_ticket() reaches the view's retire ticket.
- Track free_generation_ per refused key so resolve() short-circuits while
  nothing changed and retries once budget is reclaimed.
- Extend geometry_views_test.cpp with small-cap eviction, deferred GPU
  retirement, retry, and full block reclamation checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:46:30 +02:00
52d768a0dc runtime: respect IndependentBlendEnable=FALSE in B4G4R4A4 stand-in blend fallback 2026-11-25 19:44:56 +01:00
9f9a7c5f30 Merge pull request #1798 from ImLele69/rt-title-texture-gone
Merging.

**Why merged**
- **The bug:** a texture whose last reference was a descriptor overwritten inside the title-texture registry was destroyed on a thread that already held the registry mutex. Its destructor then locked that mutex again (`resource_deadlock_would_occur`, an abort under Wine).
- **The fix:** such a texture now leaves `gpu_placements` immediately, under `descriptor_mutex`, which that thread never holds. Its registry entry stops naming it until `drain_titles_gone` erases it after the registry lets go.

**Why it's good**
- It's small, and on the slot-70 view path used during the load.
- The deferred part only holds a registry entry with no resource, so nothing the submission thread reads points at freed memory. That was the window in the first revision, fixed in 152cee255.
- `log_title_census` and the refresh skip such entries.
- **Tested** on an RTX 4070 SUPER (Windows 11), merged onto current main:
  - full ctest 448/449, where the only failure is the known depth-resolve MFAA case;
  - the 13 title/texture/heap tests pass under Vulkan validation with no VUID;
  - the consistency set is unchanged (one timing flake passed on re-run; the PR is C++ only).
  - The diff was reviewed for safety: no game data, no new I/O.

**Follow-ups welcome**
- A test that releases the last reference from inside `write_placed_texture_view`.
- The same guard on the slot-71 UAV path.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-25 13:42:53 -05:00
a013410f8e runtime: guard rel32 range, stub_page arithmetic, and VirtualProtect failure in clzero_patch 2026-11-25 19:42:17 +01:00
7f56e6a50b runtime: step try_clzero_loop by VirtualQuery regions and guard wraparound in cpu_emulation 2026-11-25 19:39:50 +01:00
a03715c46a vk_subgroup_info --lod-bias: measure mipLodBias with one compute dispatch, no test programs needed (SHADER-EXPLICIT-LOD-BIAS-MVK)
tools/vk_lod_bias.py clears a two-level R32_SFLOAT image to 0.0 / 1.0 and
samples it at explicit LOD 0 through samplers with mipLodBias 0 and +1, from
Python through ctypes. vk_subgroup_info.py --lod-bias reports the answer as
explicit_lod_bias; lod_bias_probe.py uses it first and draws ps_ssharp only as
a fallback, with the Homebrew llvm-mc hint when llvm-mc is missing (#1774
review). build.py and make_game.py can now measure too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:38:34 +01:00
ed34b996ce runtime: harden submit_phases period parsing and skip Scope overhead when disabled 2026-11-25 19:35:17 +01:00
0c4bdde51c runtime: guard overflow/div-by-zero and remove duplicate passes in d3d12_xs_alloc_size 2026-11-25 19:32:28 +01:00
065df3d8b2 runtime: guard align_up_saturating against zero alignment and add unit tests (RT-XS-ALLOC-SIZE-GUARDS-AND-TESTS)
Guard align_up_saturating against zero alignment (to == 0) in runtime/shims/d3d12_xs_alloc_size.h, avoiding division by zero and underflow.

Add standalone CPU-only unit test runtime/test/d3d12_xs_alloc_size_test.cpp covering align_up_saturating, render_target_element_bytes, console_depth_planes, console_render_target_size, console_depth_stencil_size, and console_placement.

Register test executable and CTest in runtime/CMakeLists.txt.

AI-assisted (Claude Code)
2026-11-25 21:29:28 +03:00
cf5127e811 runtime: early-exit pending_through and cache semaphore completions in RetireTickets 2026-11-25 19:28:17 +01:00
2cca47b5c8 loader: compat run-time loads honour LoadLibraryEx flags and Windows-loaded dependencies
Review follow-up for #1565:
- LoadLibraryEx with DONT_RESOLVE_DLL_REFERENCES on a LEONIDA_COMPAT_DIR module fails with ERROR_NOT_SUPPORTED, before loading or returning a loaded handle, as for bundled DLLs.
- A compat DLL that Windows loaded as another compat DLL's dependency is recognised: compat_handle() finds it by its full path, and owns_compat_handle() by its folder (read outside mutex_, since GetModuleFileNameW can take the loader lock), so GetModuleHandle and LoadLibrary return it and GetProcAddress never fills in a missing export from the shim.
- A name with a directory gets the compat DLL only when it is that file; any other path goes on as without the folder.
- Names outside ASCII reach the compat lookup (it runs before the ASCII / wide split).
- The folder's file names are listed once per Loader, so lookups no longer touch the disk.

loader_test: test_compat_runtime_edges adds six cases for the first four points, through LoadLibraryExA/W, LoadLibraryW, GetModuleHandleW and GetProcAddress; all six fail on 582e14d. The listing has no functional test.
2026-11-25 15:15:43 -03:00
e500e99494 d3d12: CPU-fillable placed BC images share a zero image without host copies too
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:14:30 +01:00
435d7541fe dstorage: harden staging_bytes overflow and StagingPool::Lease reuse 2026-11-25 19:11:10 +01:00
fba6ce2427 runtime: add O(1) envelope fast path and explicit wrap to title_texture_refresh 2026-11-25 19:06:48 +01:00
28fc0262d2 d3d12_xs, test: say which route slot 31 remaps through; cover the retail route
queue_copy_page_mappings logs once whether CopyPageMappingsBatchX goes to an
installed batch hook or to the default adapter over xmem's range callback
(copy_page_mappings_fn), so a boot's read-fault reports can be matched to the
implementation the tests cover. Nothing in the runtime installs a hook, so a
retail run takes the default adapter.

d3d12_xmem_placed_test gains queue_remap_default_route, for that route: no
hook, a legacy-paired GPU-only destination, and a GPU-only pool backed only
through its CPU alias. The title maps a page of its own at one CPU twin while
the remap waits behind queue work (deferred with list values, waited for with
LEONIDA_LIST_VALUES=0), so ownership is checked when the remap is applied.
After the copy the GPU-only pages hold the pool's bytes, the other twin follows
them and the title's page keeps its bytes; after an unmap the GPU-only pages
and the mirrored twin are reserved and the title's page still holds its bytes.
On the code before this pull request the title's page check fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 19:04:43 +01:00
f1332737d4 runtime: speed up uav_clear format lookup and channel pack/unpack with unit tests 2026-11-25 19:01:18 +01:00
6c462cc77a runtime: guard XdxrBuilder empty dispatches, layout failure reset, and pipeline cleanup 2026-11-25 18:55:29 +01:00
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
1f8ccc6ff4 runtime/README: DStorage requests fail with E_NOTIMPL when the queue processes them
EnqueueRequest returns void; validate_request runs on the queue worker (execute_request and prepare_in_background), so BC2 and, with LEONIDA_DSTORAGE_EXTENDED=0, BCPack, swizzle and page-list requests fail there rather than returning the error.
2026-11-25 14:35:49 -03:00
da4ce8c273 Merge pull request #1849 from DadaCap/console-fix-no-null
d3d12: changed console heap slots are fixed without a time limit by default, not given to shaders as null (RT-CONSOLE-FIX-BUDGET-NULL)
2026-11-25 18:33:19 +01:00
4ad6d3f5ea runtime/README: xapu and chad are served by shims/xapu_chad.cpp; note LEONIDA_DSTORAGE_EXTENDED=0
Review follow-up for #1517: the runtime target links shims/xapu_chad.cpp for both xapu.dll and chad.dll (shims/xapu.cpp and shims/chad.cpp only build for their ABI tests), and LEONIDA_DSTORAGE_EXTENDED=0 makes BCPack, swizzle and physical-page requests return E_NOTIMPL (shims/dstorage.cpp validate_request).
2026-11-25 14:24:47 -03: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
98c457ec4f gta6rt: threads that fault together wait for the first one's cache write (RT-SESSION-CACHE-AT-EXIT)
A boot ended with eight title threads faulting within a second. Each
entered the filter; the ones after the first returned at once and went on
to the title's filter, which can end the process during the write. The
write now runs under std::call_once, so they wait for it.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:06:49 +01: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
a26b12760e d3d12: the exit save writes the finished pipelines while a build runs, on a bounded thread (RT-SESSION-CACHE-AT-EXIT)
A 1,308 s boot ended in a title fault with 2 builds still running, and the
exit save kept the old file, so the run's pipelines were lost again. At
exit there is no later moment to wait for: after wait_ms the cache is
written with the pipelines finished so far (it is not created
EXTERNALLY_SYNCHRONIZED, so reading it during a build is valid). The write
runs on its own thread and is given 3 s, so a driver that blocks the read
cannot hold the ending process; the file is published by a rename, so a
write cut off leaves the previous one whole.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:01:00 +01:00
223913540b address binding: destroy the debug messenger before its instance
vkDestroyInstance with a live messenger breaks the debug-utils rules. The device teardown and the
failed-creation path now remove it first. d3d12_conservative_raster_test with LEONIDA_VK_VALIDATION=1
LEONIDA_ADDRESS_BINDINGS=1 LEONIDA_DEVICE_FAULT=1 runs with no validation message on an RTX 5070 Ti.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 21:00:21 +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
152cee2550 d3d12_vulkan: a texture destroyed inside the registry leaves gpu_placements at once
Review of #1798: the submit path reads gpu_placements under descriptor_mutex alone, so the
placement of a texture destroyed inside the registry must go before ~Resource frees it.
descriptor_mutex is never held there (~Resource takes it itself, in image_owner and
forget_image); only the title_textures erase waits for drain_titles_gone. log_title_census
skips an entry without a resource, and refresh_title_textures leaves the registry scope
before it unlocks.
2026-11-25 16:57:17 +01: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
27a861adc9 gta6rt: keep the exit-save filter when the title installs its own (RT-SESSION-CACHE-AT-EXIT)
The retail title calls SetUnhandledExceptionFilter (from
api-ms-win-core-errorhandling-l1-1-0), which replaced the runtime's filter:
a title fault at 354 s ended the process without the cache write. The
title's call is now served by the runtime, which keeps its filter
installed and passes the exception on to the title's.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 16:36:44 +01: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
b9739b70d3 d3d12: describe VK_EXT_transform_feedback as detected/enabled, nothing uses it yet
Addresses Snooozs's review on #1236: the comments and the log line no longer claim StreamOutput PSO acceptance, SOSetTargets or capture that this foundation does not have. #1630 adds the SO_STATISTICS query pools that use it.
2026-11-25 09:55:12 -05:00