upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/d3d12_com.cpp
AgeCommit message (Collapse)Author
10 daysMerge main c1e1ef0b8 into RT-POST-LOAD-GPU-MEMORY (#2098)Jan Trencansky
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>
10 daysd3d12: remap directly-indexed heaps to arena shader VA ↵d7ommy
(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).
10 daysMerge main into RT-POST-LOAD-GPU-MEMORY (#2098)Jan Trencansky
main d3b8251bc brings #1889 (large compiles within a memory budget), #1987 (unbound T# reasons), #1759, #1860 and others under this branch. Conflicts: - d3d12_vulkan_device.cpp, includes: both (pipeline_cache_journal.h and large_module_gate.h). - d3d12_vulkan_device.cpp, fix_console_slot's T# branch: main's form (counts refused_reasons, #1987), with this branch's comment on why a slot that is no T# is nulled. The same reason count is added to console_tsharp_check, the GPU console-heap path's T# registration, so its log line has the reasons too. - d3d12_vulkan_device.cpp, the heap log: both blocks (the release filter / GPU heap lines and main's "unbound T#s by reason" line). - d3d12_vulkan_device.cpp, PipelineState::build_compute: this branch's body (build_compute_pipeline, journal, compile helper) behind main's entry: the `Work` argument and enter_build, so a large module takes its place at big_compile_gate() before variants_mutex_, as #1889 requires (a thread that waits for memory holds no PSO lock). build_compute_pipeline's own big_compile mutex now follows main's BigCompiles: taken only with LEONIDA_SERIAL_BIG_COMPILES=1 (it was on by default here), so the default is main's budget, not one at a time. - d3d12_vulkan_device.cpp, queue_locked: this branch's Build-state jobs (claim, defer, finish). main's `requested_`/`publication` mechanism they replace is not kept. build_variant passes Work::speculative for a "warmup" build and Work::demand otherwise, as main's queue_build did. - vulkan_replay.h, ComputePipeline: main's comment on `large`, and this branch's `await`. - vulkan_backend.h: this branch's LEONIDA_SUBMIT_ASYNC block, with main's lock order in the state_mutex_ comment (state_mutex_ -> pipeline_mutex_ -> resource_mutex_ -> tracker_mutex_ -> submit_mutex_). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 daysMerge pull request #1759 from ↵aslan2142
abnalstlll-byte/feat/rt-xdxr-bvh-rehydrate-batched2x xbox_bvh_builder: implement RehydrateRaytracingAccelerationStructureBatched2X (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
10 daysImprove post-load GPU memory and pipeline handling (RT-POST-LOAD-GPU-MEMORY)Moriz82
Fall back to a dedicated buffer allocation when the shared arena fills. Update console descriptors and resource backing, preserve pipeline cache entries, and replay mesh records using bounded indirect arguments. Keep scripted input available until read and cover the runtime and translator paths with synthetic tests. Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
10 daysxbox_bvh_builder: review fixes for batched rehydration ↵Jan Trencansky
(RT-XDXR-BVH-REHYDRATE-BATCHED2X) Maintainer fixes on top of the author's rehydration, carried over from the reviewed branch onto the rewritten head: - Scratch: each element of a batch gets a region of its own in one buffer per call, at D3D12's acceleration-structure alignment, and the command list holds that buffer until its next Reset (rt::d3d12::hold_until_reset). Before, every element and every list shared one builder-wide buffer with no barrier between the builds, and growing it released a buffer that builds already recorded could still use. - Fresh builds: a rehydrate always builds from geometry. PERFORM_UPDATE is cleared together with SourceAccelerationStructureData, so the layer never refits from the dehydrated stream's bytes. - The leaf frame compressionParams gives is described as not applied yet, which is what the code does. - The test reads back rehydrated builds made without scratch (ScratchAccelerationStructureData = 0), the shape the title uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 daysMerge pull request #1814 from timbot103/d3d-clear-uav-3d-sliceaslan2142
D3D-CLEAR-UAV-3D-SLICE: clear selected 3D UAV slices and rectangles
10 daysruntime: support dynamic topologies in indirect draws and report per-reason ↵IlyassRS
skip counts (RT-INDIRECT-TOPOLOGIES-AND-STATS)
10 daysD3D-CLEAR-UAV-3D-SLICE: clear selected 3D UAV slices and rectanglestimbot103
10 daysIntegrate post-story-load memory, queue and Vulkan runtime changesMoriz82
Preserve physical window aliases across remaps, order console list values, and replay bounded indirect graphics with captured draw state. Coordinate pipeline lifetime, texture refresh and queue teardown. Add synthetic CPU and GPU coverage for the integrated paths. Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-authored-by: ivanepsilondelta <264061546+ivanepsilondelta@users.noreply.github.com>
10 daysMerge main into RT-DIRECT-HEAP-GRAPHICS (#1232)Jan Trencansky
This merges #1064 as prepared (its head + a merge of main), so it brings #1232 up to date with main and with #1064. #1232's branch carried #974 (merged into main since) and an older head of #1064 (7c47fd946). main already supplies the directly indexed heaps to graphics draws (integration #984): graphics_user_data() on DrawInstanced, DrawIndexedInstanced and DispatchMesh, at RootArgumentLayout::graphics_arguments_end (pack_stage(Stage::Pixel)'s end_sgpr, set when the console layout places the signature), LEONIDA_GRAPHICS_DIRECT_HEAPS=0, its notes for a signature on the s0 layout or one that fills s31, and d3d12_graphics_direct_heaps_test (recorded draws and the VS/PS GPU reads). That form stays. What this pull request adds beyond it is carried onto it: the mesh case. Conflicts (all taken from #1064's merged branch, then the PR's mesh parts carried over): - runtime/shims/d3d12_com.cpp: main's graphics_user_data()/with_direct_heaps() and notes. The PR's own graphics_user_data(), GetEnvironmentVariableA switch and no-room notes are main's in another form and dropped. Carried: the comment says a mesh shader reads push dword d as s(d + 8) through #974's window, so it gets the heaps after its arguments from s16 (main's comment still said the mesh stage gets none); and DispatchMesh reports once when a heap falls past the mesh window (push dword 24 and up, s32 for the mesh shader), the case raised in the review of #1232 (mesh_ok accepts arguments up to push dword 24). - runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (graphics_arguments_end from pixel.end_sgpr; the PR set it from its Spill::block form, which main did not take from #974). - runtime/test/glsl/cs_user_data.comp: main's (identical direct-indexing mode). - docs/d3d12_vulkan.md: main's section 3.4 with #1064's compute paragraph; the graphics paragraph's "a mesh shader ... is not modelled" replaced by the mesh window position, cited to issue #14 comment 7143020922 as a report not reproduced here, the window-overflow note and the mesh test. - runtime/test/d3d12_mesh_test.cpp (no conflict): the PR's recorded-argument checks kept (vertex and mesh draw with 4 constants, resource-only rebind, 23 constants, 30 constants); the 30-constant comment now says it keeps pack()'s s0 layout on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 daysMerge main into RT-DIRECT-HEAP-COMPUTE (#1064)Jan Trencansky
main already supplies the directly indexed heaps to compute dispatches (integration #984, the tree this pull request was split from): with_direct_heaps()/compute_user_data() on Dispatch and the ExecuteIndirect dispatch path, RootArgumentLayout::compute_arguments_end (kNoSgpr for a spilled signature), LEONIDA_COMPUTE_DIRECT_HEAPS=0, and the first form of this test (direct dispatch, indirect after a resource-only rebind, the GPU read through the heap). That form stays. What this pull request adds beyond it is carried onto it: the review-round reports, the extra recorded-argument checks, the census tool and its evidence. Conflicts: - runtime/shims/d3d12_com.cpp: main's with_direct_heaps()/compute_user_data() and its one-argument note_direct_heap_indexing(). Carried: compute_user_data() makes the note itself, so an ExecuteIndirect dispatch with no heap bound is reported too (record_dispatch's own call removed), and a heap with no inline dword left is reported once per heap kind ("compute root arguments leave no inline SGPR for the resource/sampler heap"); a spilled signature (main: kNoSgpr) gets one note of its own. Dropped: the PR's GetEnvironmentVariableA switch (main's direct_heaps_enabled) and its "graphics heap-base SGPR is not supplied" notes (main supplies the graphics heaps). - runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (compute_arguments_end and graphics_arguments_end with their comment; compute_arguments_end only when the compute arguments do not spill). - runtime/test/glsl/cs_user_data.comp: main's; its direct-indexing mode (s5 = 0xFFFFFFFC, heap at s9) is this pull request's, byte for byte. - runtime/test/d3d12_compute_test.cpp: the PR's block replaces main's earlier form of it (a superset: adds the bundle dispatch that inherits the parent's heaps, an indirect dispatch with only the sampler heap, signatures ending at s30 and s31, and the LEONIDA_COMPUTE_DIRECT_HEAPS=0 expectations). - docs/d3d12_vulkan.md: main's section 3.4 (the BatchCull s7 and PreSkin s9 evidence), with the PR's census paragraph (tools/compute_heap_layout_census.py, the seven paired layouts, the heap order as a hypothesis) and the no-room and spill reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 daysMerge main into D3D-448-GRAPHICS (#974)Jan Trencansky
main already lays graphics root arguments out in the console layout (from s8, one dword per table: #939's graphics-root-layout patch in #984's form, pack_stage(Stage::Pixel), RootArgumentLayout::graphics_console, graphics_arguments_end, LEONIDA_GRAPHICS_STAGE_LAYOUT=0 for pack()). That form stays. What this pull request adds beyond it is carried onto it: the mesh-shader root window (translator, index "root_window", mesh_ok, the two refusals) and its tests. Its own graphics spill handling (Spill::block) and LEONIDA_GRAPHICS_ROOT_LAYOUT=pc are not carried: main keeps pack()'s s0 layout for a graphics signature past s31, and its switch does what =pc did. Conflicts: - runtime/src/root_signature.h, root_signature.cpp: main's pack_stage (compute spill array, spill_dword); the Spill enum, first_spilled and spilled_dwords dropped. The header keeps the PR's evidence note, with Stage::Pixel. - runtime/shims/d3d12_com.h: main's comment and members, with the mesh window described; mesh_ok added (false by default, set only for a console-layout signature that Stage::Mesh also places); the PR's second graphics_console dropped. - runtime/shims/d3d12_vulkan_device.cpp (CreateRootSignature): main's pixel/packed form; the PR's Stage::Mesh pack and its log line added, mesh_ok = pixel.ok && mesh.ok. The mesh-shader refusal without "root_window" (no conflict) stays. - runtime/shims/d3d12_com.cpp: DispatchMesh keeps main's any_nonempty_viewport() and graphics_user_data() after the PR's mesh_ok check; address() keeps main's comment. The PR's kNoSgpr guard in constants()/address() stays, reworded: in main a spilled compute parameter has first_sgpr kNoSgpr, and kNoSgpr + offset wrapped round to s0. - runtime/src/shader_library.h: both (main's wave64_graphics, the PR's root_window). - runtime/test/d3d12_mesh_test.cpp: main's mesh shader-kind byte on both containers (also the PR's ms_old); the PR's two-parameter signature replaces main's 25-dword padding onto the s0 layout; both test blocks kept (the PR's window refusals, main's DISPATCH_MESH command signature), each in its own scope. The =pc case is dropped (main's switch is read once per process). - runtime/CMakeLists.txt (no conflict): the mesh test uses ps_draw.spv again; the ps_draw_s0.spv rule is gone. - runtime/test/glsl/ps_draw.frag, vs_depth.vert, vs_draw.vert, vs_draw_int.vert, ps_depth_write.frag and runtime/test/shaders/ps_m15, ps_m2, ps_m2_array, ps_m2_literal, ps_m2_uoff, ps_m3, ps_m3_post, ps_m3_query, vs_m15, vs_m3 (.asm): main's (the same s8 rewrite done twice); ps_draw.frag's mesh-test note updated. - runtime/test/root_signature_test.cpp (no conflict): the Spill::block cases dropped, the window cases kept. - docs/design.md: main's rows (loop guard, direct resource heap) and the PR's user-data row. - docs/d3d12_vulkan.md (no conflict): section 3.5 and the CreateRootSignature bullet rewritten for main's form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 daysA submission scans its tables with its own device's scannerJan Trencansky
The merge had taken the base's process-wide scan hook (title_va_aliases), which belongs to the first device that registered. A second device over the same GPU then had its tables scanned by the first: d3d12_rebound_second_device, a test of #939, failed on it. #939 scans through the context of the device (VulkanContext::set_table_scanner), which the merged device still registers. That one is asked first now and the process-wide hook serves a context without a scanner. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
10 daysMerge the #984 result as of 71a783e56 into the #939 mergeJan Trencansky
Fourteen commits the #984 merge gained after 8a242efeb: its own failing tests (xmem_test under Wine, check_tls_index0, vk_bindless_grow, xs_present_lazy_test), the console-heap probe and the poke experiment behind their switches, Python tool fixes, and the title watchdog default. No conflicts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysMerge the #984 result (main + RT-PROTON-STORY-LOAD) into #939Jan Trencansky
The base is 8a242efeb, the merge of main and #984. 68 files conflicted; they were resolved in seven groups by one rule: the same change in two forms keeps the base's form, everything only #939 has is kept, and where the two solve one problem in two ways the base's is the frame and #939's plugs into it. A, the Xbox proxy (d3d12_xs_device.cpp/.h, d3d12_xs.cpp, d3d12_xs_pso_stream.cpp/.h, d3d12_xs_alloc_size.h, d3d12_xs_desc_clean.h, device_proxy_test.cpp, queue_proxy_test.cpp): the base's files with #939's additions ported in. Device slot 57 asks #939's NativeGraphicsFactory first and falls back to the base's proxy_create_graphics_pipeline_from_native_code on E_NOTIMPL. Kept from #939: the providers (texture lease, raw texture view, resource by address, constant view, descriptor mapping, depth-stencil UAV, texture pages), the title-backed descriptor mirror, slot 13's feature answers, GPU labels on list slots 71/72. Dropped: #939's duplicates of the boot ladder routes, its fallback window, its slot 133 stand-in. A2 (xs_proxy_mock_test.cpp): the base's test with #939's slot 70 raw-buffer case; presentation cases follow #939's rule that a device which ever had a handler has no queue fallback. B1, the Vulkan device (d3d12_vulkan_device.cpp, d3d12_com.cpp/.h, shader_library.h, queue_families.h, pipeline_cache_file.h, startup_trace.h): one lazy-pipeline mechanism, the base's; #939's pending_base_compile and first_use_backend_pipelines dropped, prepare_on_bind and cold_graphics_compile kept. create_texture keeps the base's signature; #939's deferred backing is folded into the base's placed-memory binder. #939's quad lists as triangle indices. B2, the D3D12 tests (d3d12_existing_heap, a8_dimensions, pipeline_cache_seed, title_va, rect_list, shader_library, loader_tls_index0, draw, compute, xmem_placed, shader_library_corpus): the base's tests where both carry the same case, #939's cases added (rebound tables, linear texture map, large vertex batch, executable shaders, default A8 views). C, the backend (vulkan_replay.h, vulkan_backend.h, vulkan_bindless.h, vulkan_scratch.h, vulkan_present.h, rect_list_geometry.h, vk_test_device.h, vk_pipeline_check.cpp, vk_store_test.cpp, bindless_sizing_test.cpp, replay_texture_barrier_test.cpp): the base's prepare_draw and lazy compute, its #1055 release rule and its rectangle generator; #939's rectangle variants, GPU quad index expansion, 1D/3D and depth-stencil UAVs, the label fence on the base's submit. D, memory, services, presentation (xmem.cpp/.h, xg_xs.cpp, xg_xs_test.cpp, title_va_alias.h and its test, main.cpp, frame_pacer.h, xbox_present.cpp/.h; xgameruntime_offline.cpp for one comment): the base's xmem with #939's label hooks, file-backed sections and pin_mapped_data; both texture computers in xg_xs.cpp, the base's answering first; --first-run-ui kept without host speech in its profile. E, build, tools, docs (runtime/CMakeLists.txt, make_game.py, tools/rdna2spirv.py, tools/shader_disasm.py, scripts, tests, docs; docs/README.md and tests/test_exe_shaders_stage.py beyond the conflicts): the base's v_dot4 decode, #281's disassembler form and tests/semantic/test_fspx_dot4_op_sel_disasm.py dropped; the base's executable-shader step with #939's cache fix; 366 registered tests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysd3d12: the poke experiment's table lookups only when it is onJan Trencansky
The submission path looked up the origin of every bound descriptor table (a lock and a map lookup each) for the LEONIDA_FSDRAW_POKE_CB experiment, whether or not the experiment was on; poke_cb then returned at once. The loop now runs only with the experiment. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysBoot diagnostics behind LEONIDA_LOCAL_DIAGNOSTICS, off by defaultJan Trencansky
#984 carries the probes its author followed a frame of the retail title with, marked LOCAL DIAGNOSTIC and in places 'not for upstream'. Several wrote to stderr with no switch from paths that run for every draw: record_draw (a mutex, a set lookup and up to a dozen lines per draw), ClearRenderTargetView, the submission's table dump, PresentX (present_diag and the plane dump), the presenter's path line, the heap and CopyDescriptorsSimple lines of the device proxy, the per-view CBV and SRV lines, the per-pipeline description string and the console-heap census. They stay, for the next person who has to follow a frame, behind one switch: LEONIDA_LOCAL_DIAGNOSTICS=1 (runtime/src/local_diagnostics.h, a row in runtime/README.md). Unset, none of them runs. Not changed: the diagnostics that already had a switch of their own (LEONIDA_CAPTURE_SOURCE, LEONIDA_MEM_PROBE, LEONIDA_XG_TRACE, --trace) and the replay's unresolved/unsupported lines, which report a dropped draw or list at the 1st, 2nd, 4th... occurrence. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysMerge main into RT-PROTON-STORY-LOAD (#984)Jan Trencansky
Merges main at 1154976d4 into the integration branch at 273b3bdf9 (merge base ece4ba5b3). 42 files conflicted; this commit is the resolution only. Build and test repairs follow in their own commits. Rule of resolution: where both sides added different things, both stay; where both made the same change in two forms, main's reviewed form stays and whatever #984's form did in addition is carried into it; where the two changed the same code for different purposes, both purposes are kept. Xbox proxy code (runtime/shims/d3d12_xs_device.cpp, d3d12_xs_device.h, d3d12_xs.cpp, d3d12_xs_alloc_size.h, d3d12_xs_desc_clean.h, registry.cpp): - d3d12_xs_device.cpp is #984's file with main's differing pieces ported in: env_slot and the configurable device routes, XboxQueueSlotRoutes, PresentationHandler / set_presentation_handler, the console caller rule for device slots 61 and 74 (#383, #385), route_xbox_device_slot, slot 81 as GetFrameStatisticsX, create_host_device, the console-form rule for slots 25 and 56, the console list IID of #359, and the forms of queue slot 18 (#403) and list slot 139 (#396). - Kept from #984: the list proxy with handle translation, queue slots 16/17 as Signal/Wait, the fence's completed-value mirror, the shared FrameTokenSource, PresentX through queue_present_x when no handler is attached (slot 30, or 32 on a queue detected as the newer layout), slots 27/53/55/57/70/71/133, the wider pc_resource_desc, S_OK for queue slots past the PC table. - Dropped: #984's GetFrameEventsX and LEONIDA_XS_FRAME_EVENTS_SLOT, its second-word rule for slot 61, its undetected-layout rule for queue slot 18, its list IID mapping to GraphicsCommandList6; main's copy of the base list proxy, its null-view slot 70 and its refusing slot 133. Proxy tests (runtime/test/xs_proxy_mock_test.cpp, device_proxy_test.cpp, queue_proxy_test.cpp): - Checks of both sides, each run once; main's forms of the render-target size and layout checks with #984's extra cases added; main's --env-slots-74 and #984's --env-slots-70. - Adapted to the merged code: the queue tail answers S_OK, slot 73 answers an unknown IID with the list proxy, the queue slot 18 case installs a console caller. Dropped: #984's slot 81 GetFrameEventsX cases. D3D12/Vulkan layer (runtime/shims/d3d12_com.cpp, d3d12_vulkan_device.cpp, runtime/src/command_list.h, frame_pacer.h, shader_library.h, vulkan_backend.h, vulkan_replay.h, runtime/test/command_list_test.cpp, d3d12_close_parity_test.cpp, d3d12_execute_indirect_validation_test.cpp, replay_texture_barrier_test.cpp, vk_pipeline_check.cpp, vk_test_device.h): - Resource::create_texture: #984's title images (deferred placed, pending streamed, title pool) and main's ordinary textures (#1413 shared blocks, #1364 staging fallback) are exclusive branches chosen by the texture's origin, so both pools run on disjoint sets of textures. - frame_pacer.h is main's pacer (#402) with #984's FrameTokenSource as the token counter. - main's forms kept for ExecuteIndirect (#1066, #377), the barrier into LAYOUT_UNDEFINED (#1055), the B4G4R4A4 stand-in, per-face stencil masks, the unaligned tile staging (#528) and the device-lost flag (#980). - shader_library.h: main's block inflate; #984's `bulk` parameter now defaults to true so main's callers keep it. - Dropped: #984's B8G8R8A8 stand-in for B4G4R4A4 targets, its refusal of separate stencil masks, its zero-count refusal in ExecuteIndirect, its wider UNDEFINED -> UNDEFINED release and the test case for it. Other shims (runtime/shims/dstorage.cpp, file_system.cpp, gameinput.cpp, xgameruntime_offline.cpp, runtime/test/xgameruntime_offline_test.cpp, xmem_test.cpp): - ReadFile and DirectStorage reads: #984's pinned kernel_writes read, then main's touch_pages retry on ERROR_NOACCESS. main's rt::fs::read_file is folded into #984's read_file. - gameinput: main's strict LEONIDA_INPUT_SCRIPT parser with #984's rsup/rsdown entries. - Speech synthesis: main's one silent voice and handle checks; #984's accept-anything form dropped. Build, tools, docs (runtime/CMakeLists.txt, runtime/cmake/translator_deps.cmake, scripts/build_runtime.ps1, make_game.py, tools/rdna2spirv.py, shader_disasm.py, shader_ir.py, shader_library.py, runtime/test/shaders/cs_imgload_tfe.asm, cs_imgload_d16_tfe.asm, docs/README.md, boot.md, d3d12_vulkan.md, runtime/README.md): - Unions of the test, target and source lists; spirv_loop_guard.py added to translator_deps.cmake. - rdna2spirv.py: main's DPP compare rule (#957), SMEM vcc base (#647) and widen_wave64_masks (#1021); #984's restore_skipped_instructions and restore_dot4_inline_sel. #984's duplicate widen_wave64_valu_masks dropped. - shader_disasm.py and shader_ir.py: main's structure with #984's one-line-per-dword llvm-mc input and wave flags. - shader_library.py: main's structure with #984's --compute-hashes and per-state compute variants. One file that did not conflict is changed here: tools/rdna2_decode.py. Git kept both sides' decoders for a VOPC compare with a DPP operand, and #984's narrower one shadowed main's; it is main's file again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysMerge pull request #1154 from PyZikYG/copy-queue-timestamp-supportQemmHD
Merging. **Why merged:** D3D-COPY-TIMESTAMP-CAPS: timestamp bits are tracked per queue family, and transfer-only families count as 0 bits because they can't reset or resolve queries. This was the first native Windows run of the fixed head; madhyn's Wine run was on an older head, and KernelSmoker ran vk_queue on Linux. Behaviour change: OPTIONS3.CopyQueueTimestampQueriesSupported can now be TRUE, and a copy queue that gets a transfer-only family returns E_FAIL from GetTimestampFrequency and GetClockCalibration instead of borrowing the graphics family's bits. **Why it's good:** d3d12_vulkan_device, d3d12_query_rules, vk_queue, vk_queue_query_sync and vk_queue_constructor_oom: 5/5 both plain and under validation on the 4070 SUPER. Tested on Windows 11 / RTX 4070 SUPER (NVIDIA 621.24), VS 2022 + Ninja RelWithDebInfo, Vulkan SDK 1.4.363.0. Merged alone onto main 0f98d193c, its ctests pass both plain and with LEONIDA_VK_VALIDATION=1. Cumulative with the rest of this batch on main 507029d1e: the repo-consistency set gives 578 passed / 5 skipped / 0 failed, compileall is clean, and full ctest is 317/318 with the usual 11 skips; the only failure is main's pre-existing d3d12_depth_resolve. All d3d12_* tests under validation: 119/120 with 0 VUIDs. The semantic suite has only the known environment-only failure. git merge-tree against current main 9c5e70661: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
11 daysMerge main into RT-SLOT41 (#377)Jan Trencansky
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 daysd3d12: RSSetScissorRects with more than 16 rectangles keeps the first 16 ↵Jan Trencansky
(D3D-SCISSOR-COUNT-PARITY) The multi-viewport change made a call with more than 16 rectangles an error, so the list's Close returned E_INVALIDARG. WARP closes such a list, and d3d12_close_parity has that row ("RSSetScissorRects(17)", match), so the test has failed on main since that merge. The call is no longer an error: the rectangles past the 16 a pipeline can have are dropped, with a one-time notice. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysd3d12: supply directly indexed heaps to compute dispatches ↵Moriz82
(RT-DIRECT-HEAP-COMPUTE) Compute shaders using direct resource indexing received a zero heap pointer. Snapshot each bound heap offset after the explicit inline root arguments on direct and indirect dispatches, so each command retains the bindings it had when recorded. When the explicit arguments leave no SGPR, keep them and report the missing heap slot once. The placement is a hypothesis with partial evidence. Of 2,959 direct-indexing compute entries, seven could be paired with recorded layouts. All seven resource reads agree with the predicted slot. The other 2,952 have no paired layout, and no paired sampler read establishes the relative heap order. tools/compute_heap_layout_census.py reproduces the count, with synthetic tests for agreement, disagreement and missing evidence. Built gta6rt and d3d12_compute_test with clang-cl. The Proton Vulkan fixture passed 64 buffer reads and 64 null controls on an RTX 4070. With the rollback switch, all 128 controls read zero. Both runs check the recorded arguments for bundle inheritance, indirect heap rebinding and the last inline SGPR. The synthetic SPIR-V fixture passed validation. AI-assisted (Codex and Claude Code agents). Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysRT-DIRECT-HEAP-GRAPHICS: graphics draws supply the directly indexed heaps ↵iFeyz
after their root arguments With CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED / SAMPLER_HEAP_DIRECTLY_INDEXED a console program reads the resource heap's address in the dword after its root arguments and the sampler heap's in the next, from s8 in VS/PS/GS and s16 in mesh shaders (DadaCap, issue #14 comment 7143020922), as #1064 does for compute. DrawInstanced, DrawIndexedInstanced and DispatchMesh now record them at RootArgumentLayout::graphics_arguments_end; a mesh shader reads the same push dwords through the #974 window. Nothing is written for a signature with parameters in the argument block or under LEONIDA_GRAPHICS_ROOT_LAYOUT=pc (no slot is measured there); LEONIDA_GRAPHICS_DIRECT_HEAPS=0 restores the previous arguments. d3d12_mesh_test checks a vertex and a mesh draw, a rebind, a signature ending at s30 and a spilled one.
11 daysMerge pull request #510 from jujumoneylol/pr/d3d12-multi-viewportaslan2142
d3d12/vulkan: implement multi-viewport and multi-scissor rendering (D3D-MULTI-VIEWPORT)
11 daysMerge commit 'refs/pull/1064/head' of ↵iFeyz
https://github.com/ubiquitarianism/leonida into feat/direct-heap-graphics
11 daysd3d12: report copy queue timestamp support from Vulkan queue capabilitiesPyZik
11 daysd3d12: supply directly indexed heaps to compute dispatches ↵Moriz82
(RT-DIRECT-HEAP-COMPUTE) Compute shaders using direct resource indexing received a zero heap pointer. Snapshot each bound heap offset after the explicit inline root arguments on direct and indirect dispatches, so each command retains the bindings it had when recorded. When the explicit arguments leave no SGPR, keep them and report the missing heap slot once. The placement is a hypothesis with partial evidence. Of 2,959 direct-indexing compute entries, seven could be paired with recorded layouts. All seven resource reads agree with the predicted slot. The other 2,952 have no paired layout, and no paired sampler read establishes the relative heap order. tools/compute_heap_layout_census.py reproduces the count, with synthetic tests for agreement, disagreement and missing evidence. Built gta6rt and d3d12_compute_test with clang-cl. The Proton Vulkan fixture passed 64 buffer reads and 64 null controls on an RTX 4070. With the rollback switch, all 128 controls read zero. Both runs check the recorded arguments for bundle inheritance, indirect heap rebinding and the last inline SGPR. The synthetic SPIR-V fixture passed validation. AI-assisted (Codex and Claude Code agents). Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysD3D-448-GRAPHICS: a graphics signature past the console window keeps its ↵iFeyz
inline part; the rest goes to the argument block On the console the parameter that does not fit and every one after it go to the argument block behind s[0:1], the ones before stay inline. No VS, PS or GS of 1.0.2.1 reads s[0:1] as an address (root_spill_census), so the graphics bind point now lays the inline part out from s8 and stores nothing for the rest (rt::rootsig::Spill::block), instead of giving the whole signature the PC layout. A write to such a parameter is dropped before kNoSgpr plus an offset could wrap to dword 0. The retail start-up signatures (25 and 30 dwords, every parameter visible to every stage, #974 review) are the case; the per-visibility log line is gone, LEONIDA_GRAPHICS_ROOT_LAYOUT=pc stays. Compute still refuses a spill.
11 days[integration] Linux/Proton and native Windows: boot through the story load ↵Moriz82
(RT-PROTON-STORY-LOAD) One squashed commit of a fork that was developed on a Linux/Proton machine and tested on two native Windows machines. On all of them the retail 1.0.2.1 package now launches, shows its launch movie, first-run pages and landing prompt, runs the story load to its end with the loading slideshow drawing its artwork, and enters the world phase. A first world frame is not verified yet. docs/linux_proton.md has the setup, a healthy boot's timeline, the machines and where it stops. Runtime: frames in the title's own window; DirectStorage pinned reads, page-list scatter/gather, BCPack and unshuffle with a locally generated predictor file; pooled, device-local and deferred image backing for streamed and placed textures; enhanced barriers into LAYOUT_UNDEFINED; a bindless table that degrades instead of refusing a submission; a descriptor hash finalizer (off until a library carries it); directly indexed heap offsets for compute dispatches and VS/PS/GS draws; title buffer windows outside a fragmented arena; opt-in device-local copies of streamed buffer views; write-fault retries under the tracker lock, shared trackers and write-watched title memory for native Windows; device-loss, compute-input and memory probes. Translator: loop bounds at structured exits, the eight FidelityFX programs that use a packed-dot form the disassembler skips, buffer bounds modes per view kind, a compaction option, the hash finalizer option. Tools and scripts: Linux boot scripts (Wine/Proton, no network), a Windows boot script, the paired compute translation script. No game data. AI-assisted (Claude Code and Codex agents), reviewed and booted by people on the machines named in docs/linux_proton.md. Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysd3d12: ExecuteIndirect accepts the argument ranges newer D3D12 runtimes acceptnatterman12
PC D3D12 runtimes disagree on five ExecuteIndirect cases. Older Windows 11 builds bound max_count * stride and check the argument offset at a zero count; newer ones (D3D12Core 10.0.26100.9818 on Windows 11 26300, WARP and NVIDIA alike) bound (max_count - 1) * stride + record_size and check nothing at a zero count. e1ec785b2 moved the layer to the older rule, so d3d12_execute_indirect_validation failed on every newer host, as it had failed on older ones before. The layer takes the wider rule again, in recording (d3d12_com.cpp) and in replay (vulkan_replay.h): it is the rule vkCmdDraw*Indirect states, no byte outside the buffer is read, and a refusal drops the whole command list for a call a shipping runtime runs. The test marks the five cases host_varies: the layer has to accept them and a live host may answer either way, so the test stops failing on one group of machines or the other. Two cases that neither rule accepts are added, and the positive GPU path replays both disputed shapes with validation on. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
11 daysD3D-448-GRAPHICS: a graphics signature past the console window keeps the PC ↵iFeyz
layout instead of being refused Measured by madhyn on the retail title with this pull request (#974 review): one of its start-up root signatures is past the console's inline graphics window (24 dwords from s8) and the compute one (28 from s4), so CreateRootSignature refused it outright and the title stopped with an unhandled exception before the frame loop it reached without this change. On the console such a signature goes to the argument block behind s[0:1], modelled for compute only (ROOT-SIG-SPILL-MODEL, #1009). Until it is for graphics, the graphics bind point keeps pack()'s layout for it (from s0, two dwords per table), what the layer did before the console layout, so no signature is worse off than on main. The new RootArgumentLayout::graphics_console tells address() which layout the table is in; a mesh shader still refuses such a signature. d3d12_mesh_test: a 30-constant signature is created and DispatchMesh with it invalidates the list.
11 daysD3D-448-GRAPHICS: graphics root arguments in the console layout, mesh ↵iFeyz
shaders through a window The graphics bind point laid root arguments out with pack() (from s0, two dwords per table), while the console starts them at s8 for VS/PS/GS with one dword per table (the corpus census, and the retail frame loop reading its tables at s8..s10). Compute already took the console layout (D3D-448); graphics waited because a mesh shader (s16) and a pixel shader (s8) share one push-constant block. - translator: user_data_dword() - a mesh shader loads s16..s31 from push dwords 8..23, s8..s15 as 0, s0..s7 unchanged, so root dword k is push dword 8 + k for every graphics stage; index.json records the window as "root_window" on mesh shaders. VS/PS/GS/CS are unchanged. - runtime: CreateRootSignature lays graphics out with pack_stage(Stage::Vertex) and checks Stage::Mesh (mesh_ok); a table is one dword at both bind points; DispatchMesh with a signature past the 16-dword mesh window invalidates the list; a mesh PSO whose mesh shader has no root_window (translated before) is refused with a log line. - fixtures: the GLSL stand-ins read the root arguments at push dword 8 + k; the M1.5/M2/M3 asm read their tables as one dword from s8. - tests: tests/semantic/test_ms_root_window.py (MeshEXT and --mesh-compute on the CPU interpreter), graphics-window cases in root_signature_test, the two refusals in d3d12_mesh_test. - docs: d3d12_vulkan.md 3.5, design.md user-data row.
11 daysruntime: connect native pipelines and title resources to the offline ↵Rain156
first-run UI Build on the public frame-loop integration in #321. Carry the texture-view and depth work from #213 and #261, the layout provider from #461, the responsive window from #526, and the rectangle generator from #682. Integrate the Xbox constant-buffer row addressing measured in #513 and the draw-time rectangle selection in #722. Keep all fixtures synthetic. The Windows GPU path resolves title-owned shader objects, retires geometry uploads per submission, materializes texture views on use, maps linear surfaces, and delivers completed GPU label writes. A first-run UI launch selects the tested settings for these paths.
11 daysd3d12: ExecuteIndirect keeps main's argument validation; DISPATCH_MESH has a ↵Mumogg
record size and returns after it Resolving the cherry-pick of efc347830 I dropped main's record-size, stride and span checks (e1ec785b2), which d3d12_execute_indirect_validation_test depends on and which matter to every D3D12 user (found in review on #377). They are back as on main, the record-size chain knows D3D12_DISPATCH_MESH_ARGUMENTS, and the early return for a DISPATCH_MESH signature comes after the checks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
11 daysd3d12: CreateCommandSignature creates a DISPATCH_MESH signature on a device ↵NiiRoZz
with mesh shaders The Vulkan layer created signatures for draw, draw-indexed and dispatch only and answered E_NOTIMPL for DISPATCH_MESH, which the PC runtime creates on any mesh-shader tier 1 device. A title that creates such a signature at startup and asserts on the result stopped there. The signature is created when the device has VK_EXT_mesh_shader (MeshShaderTier 1), as a new IndirectKind::dispatch_mesh (the name and value #3777 uses, so the two merge). ExecuteIndirect with it records nothing yet and says so once; #3777 replays it as vkCmdDrawMeshTasksIndirectEXT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit efc347830b9ccf1461baf9a764ac9e5e911de8f6)
11 daysd3d12/vulkan: implement multi-viewport and multi-scissor rendering (1..16 ↵Juju
viewports/scissors)
11 daysruntime: remove the local diagnostics and experiments; descriptor copies ↵Mumogg
check their memory - The "[rt] localdbg:" lines and the experiment switches are gone: LEONIDA_RECT_GREEN, LEONIDA_RECT_VS, LEONIDA_RECT_NOGS, LEONIDA_RECT_NOCULL, LEONIDA_RECT_FORCE, LEONIDA_VTX_TEST and LEONIDA_DEBUG_CLEAR, with the hard-coded test shader words. vulkan_replay.h returns unresolved_resource directly again. - The descriptor write-through and the table mirror for title-backed heaps only copy between committed memory they may read and write. A handle that is only a number (xs_proxy_mock's heaps) is left alone; the test crashed there before. - A slot 70 view over memory no buffer holds becomes a raw buffer view only when the title-memory registry (title_va_alias.h) holds the whole range, instead of any address below 4 GiB. xs_proxy_mock's null-view case passes again. Still switches: LEONIDA_GRAPHICS_STAGE_LAYOUT, LEONIDA_DESC_MIRROR, LEONIDA_SLOT70_TITLE, LEONIDA_RECT_FOURTH. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
11 daysMerge main (9ec34cdff) into the frame-loop boot stackMumogg
The stack is ladder-frame (ASTROWwwW's integration of the retail boot pull requests) with the old pull requests 7604, 7286, 7584, 6446, 8591, 7384, 7535, 7448, 9137 and 9419 and local fixes on top. main carries many of those commits as ancestors without their content, so the merge was made against main's tree, not its history: nothing main dropped is dropped again here. Resolved by hand: - d3d12_xs_device.cpp and frame_pacer.h: the stack's Xbox-ABI layer, plus main's uncapped pacer and its two new registration hooks (set_placed_at_va_pages_hook is called before slot 133's handler; the console descriptor heap handler is stored but slot 14 still uses the title-backed heaps of old PR 7021). - xmem.cpp, xmem_test.cpp: the stack's run-mapped physical pages. main's commit-on-touch xmem with the two view-protection fixes it lost (7e8e3c1db, 954fcb106) boots to 50,468 pipelines and then fails a submit with an unknown resource, so it is not used here yet. - acphal.cpp, acphal_test.cpp, vulkan_replay.h (acceleration structure copy), README: main's. - CMakeLists.txt, build_runtime.ps1, d3d12_com.cpp, d3d12_vulkan_device.cpp, shader_library.h, docs: both sides. Measured (Linux, Wine 11.21 staging, RTX 5070 Ti, driver 615.78.08, clang-cl 22.1.8 + xwin, own 1.0.2.1 copy, network off, LEONIDA_GRAPHICS_STAGE_LAYOUT=1, 300 s): 50,470 pipeline states created, 197,998 ExecuteCommandLists with none failed, 148,467 DrawInstanced, 99,008 PresentX. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
12 daysMerge remote-tracking branch 'origin/pr/9002'ItsNotRexed
12 daysMerge remote-tracking branch 'origin/pr/9715'ItsNotRexed
12 dayslocal: graphics stage layout experiment (s8), CB diagnosticsMumogg
12 daysd3d12: enforce cross-device ownership checks on queue, fence, and bundle pathsDenRakEiw
12 daysd3d12: harden Set*Root* closed-list, zero-count null, and foreign root sig ↵DenRakEiw
handling
12 dayslocal: merge #9137 (slot 133 kept as on ladder-frame)Mumogg
12 dayslocal: diagnostics (draw/present/clear/rect state), rect experimentsMumogg
12 daysd3d12: ExecuteIndirect bounds the span max_count * stride, and checks the ↵bailu12300
offset at max_count 0 d3d12_execute_indirect_validation reports five host-parity mismatches on the RTX 5060 and on WARP: the layer accepts an argument buffer range the host refuses. Both live hosts bound the bytes the signature can walk, max_count * stride, so a record that fits at the end of the buffer while its stride runs past it is refused (offset 240 with stride 20 in a 256-byte buffer), and both check the offset itself when max_count is 0, which the layer skipped entirely. The layer validated with (max_count - 1) * stride + record_size and only when max_count was non-zero. It now uses the same span as the host and validates every call, in d3d12_com.cpp (recording, so Close fails as the host's does) and in vulkan_replay.h (replay, which had its own copy of the old arithmetic). The test's positive GPU path recorded the same out-of-range calls the parity table marks as refused, so it moves to an exact-fit range (244 + 12 == 256) and a max_count 0 no-op at the buffer's end (offset 256), and the five parity rows take the verdict both hosts give here.
12 daysd3d12: only the title's memory gets a copy; the table scan covers the ↵Etr0p
declared slots and is timed The xmem shims record what they hand the title (XMemAlloc, XMemAllocDefault, XMemVirtualAlloc, the title's VirtualAlloc); an address outside those ranges is left as it was and counted. The submit-time scan reads only the CBV/SRV/UAV slots the bound table's root signature declares, and its cost is accumulated per ExecuteCommandLists. Section 3.3 describes the three places addresses are replaced and the two kinds of copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysd3d12: buffer addresses in the title's own memory reach a shader through an ↵Etr0p
arena window A root view or buffer V# may name the title's own memory outside any slot-133 buffer (a per-frame constant ring, #8862 section 3.5). The layer now makes a 64 KiB-aligned window of those pages in the GPU address arena, copies it before every submission like a slot-133 shadow, and names that copy instead: for root views when set, for V#s the layer writes, and for buffer V#s the title writes into a bound CBV/SRV/UAV table itself, rewritten in place before each submission. Counters per kind, LEONIDA_TITLE_WINDOWS_MB caps the windows (64 MiB). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysd3d12: shaders reach a title-placed buffer through the root views and buffer ↵Etr0p
V#s the layer writes Xbox device slot 133 places a buffer at the title's own VA, about 1.5 TiB on Windows, while a translated shader computes heap_base + console VA with heap_base the arena's device address. A root view or V# naming that VA missed the buffer. The layer now translates an address inside a title-placed buffer where it writes it (root CBV/SRV/UAV, CBV and buffer SRV/UAV V#s): to the arena offset of the slot-133 shadow, which now lives in the GPU address arena when it fits, or to an import's device address minus heap_base. New tests: title_va_alias_test, d3d12_title_va_test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysMerge branch 'pr7111' into ladder-frameASTROWwwW
# Conflicts: # docs/runtime_imports.md # runtime/CMakeLists.txt
12 daysd3d12: reset predication in ClearState and align SetPredication / ↵Dennis Schöneberg
AtomicCopyBuffer validation (#6815) Squash-merged after diff review of PR #6815
12 daysMerge branch 'pr7330' into ladder-frameASTROWwwW
12 daysd3d12: reject null arrays and invalid lists in ExecuteCommandLists (#6610)Dennis Schöneberg
Squash-merged after diff review of PR #6610
12 daysRuntime: guard closed-list IA/OM/PSO state setters and expand D3D12 Close ↵Dennis Schöneberg
parity tests (#6644) Squash-merged after diff review of PR #6644
12 daysd3d12: validate and track SetDescriptorHeaps and directly-indexed root flags ↵justr4mzi
(#6674) Squash-merged after diff review of PR #6674
12 daysd3d12: CreateCommandSignature creates a DISPATCH_MESH signature on a device ↵NiiRoZz
with mesh shaders The Vulkan layer created signatures for draw, draw-indexed and dispatch only and answered E_NOTIMPL for DISPATCH_MESH, which the PC runtime creates on any mesh-shader tier 1 device. A title that creates such a signature at startup and asserts on the result stopped there. The signature is created when the device has VK_EXT_mesh_shader (MeshShaderTier 1), as a new IndirectKind::dispatch_mesh (the name and value #3777 uses, so the two merge). ExecuteIndirect with it records nothing yet and says so once; #3777 replays it as vkCmdDrawMeshTasksIndirectEXT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysd3d12: match Windows recording-time ExecuteIndirect validation (#6830)Dennis Schöneberg
Squash-merged after diff review of PR #6830 - d3d12: match Windows recording-time ExecuteIndirect validation
12 daysd3d12: validate DXR acceleration-structure prebuild and recording inputs (#6825)Dennis Schöneberg
Squash-merged after diff review of PR #6825 - d3d12: validate DXR acceleration-structure prebuild and recording inputs
12 daysRuntime: pipeline-statistics queries around mesh draws (D3D-291) (#2359)LloydNicholson
Squash-merged after diff review of PR #2359
12 daysMerge pull request #4445 from pmilewsskiedu-gifItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysMerge pull request #4411 from pmilewsskiedu-gifItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysMerge pull request #4312 from Victor GarciaItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/d3d12_vulkan.md
12 daysMerge pull request #4282 from cixotdevItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysMerge pull request #4061 from ExopusItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysMerge pull request #4060 from sds-228ItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/d3d12_vulkan.md
12 daysMerge pull request #4038 from pmilewsskiedu-gifItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysMerge pull request #3315 from zneelItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # README.md
12 daysMerge pull request #2951 from AlxcBTWItsNotRexed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 daysMerge main for reserved texture tile mappinggabrielsteglich
12 daysRuntime: report device loss from blocking multi-fence waitspmilewsskiedu-gif
13 daysRuntime: unbind scissor rectangles on zero-count D3D12 callpmilewsskiedu-gif
13 daysMerge origin/main into queue-wait-before-signalAlxcBTW
13 daysD3D-448: console root-argument layout, measured for compute and used thereVictor Garcia
rt::rootsig::pack_stage() lays a root signature out for one stage the way the console compiler does: root order from the stage base, a table one dword (its 32-bit VA), a root view two, constants one per value, and the first parameter that does not fit refused (the spill array behind s[0:1] is not modelled). Compute (base s4) is measured: on the package's FidelityFX DLL, whose 29 compute containers carry their RTS0 next to the console-compiled program, base plus span equals RSRC2 USER_SGPR in 29 of 29, and root_sig_contract.py --model console finds all 20 translated programs compatible (the s0 model contradicts 7). VS/PS/GS s8 and MS s16 stay a census hypothesis. The compute bind point now uses this layout; graphics keeps pack(), since every stage reads one push-constant block and a mesh shader (s16) and a pixel shader (s8) would collide. A signature carries both layouts; binding it where its layout refused it invalidates the list. Test fixtures follow: the compute GLSL shaders read the new places, and the asm fixtures a D3D12 compute PSO runs are built with LEONIDA_USER_DATA_SHIFT=4 (compute_fixture.py shifts every SGPR and the RSRC2 user count), so the standalone harness keeps using them at s0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysruntime: notify QueueHolds when a held CPU Fence::Signal firescixotdev
When ID3D12Fence::Signal is deferred behind a pending GPU queue signal, Fence::Signal enqueues a FenceWaitDispatcher callback that calls vkSignalSemaphore directly instead of going through VulkanFence::signal. That callback previously never notified QueueHolds via holds().signaled(semaphore, value) and holds().pump_ready(), leaving any cross-queue Wait-before-Signal batch stalled on that fence value forever even after GetCompletedValue() reached it. Record whether vkSignalSemaphore succeeded, decrement held_ first, and then call holds().signaled(semaphore, value) and holds().pump_ready() with no dispatcher or queue lock held. Add cross-queue regression cases to check_held_cpu_signal in d3d12_fence_timing_test.cpp covering both a Wait queued before the held CPU Signal and a Wait queued while the CPU Signal is already held. Claim: https://github.com/ItsNotRexed/Leonida/issues/4084#issuecomment-7088187469 AI-assisted: yes (Antigravity)
13 daysd3d12: translate ARRAY_OF_POINTERS instances on the KHR pathsds-228
KHR TLAS builds hardcoded arrayOfPointers = VK_FALSE and passed the guest's console-VA pointer list straight to Vulkan. Carry DescsLayout into the recorded build, validate each pointer, stage a copy with heap_base added into a device-addressable buffer, and use it as the build input. The guest input is not modified and GPU-written pointer lists are refused. Adds ARRAY and ARRAY_OF_POINTERS RayQuery coverage plus a null-entry refusal check.
13 daysd3d12: ExecuteCommandLists refuses a list whose type isn't the queue'sExopus
ID3D12CommandQueue::ExecuteCommandLists only refused bundles: a DIRECT list ran on a COPY or COMPUTE queue (its draws recorded for a transfer-only or compute-only Vulkan family) and a COMPUTE or COPY list on any queue. D3D12 requires the list's type to be the queue's (the debug layer's EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH, message 836). A mismatched list now refuses the whole batch with nothing submitted, like the layer's other ExecuteCommandLists checks. d3d12_queue_list_type_test: every list type on every queue type, and a batch whose matching DIRECT list copies a marker while its second list doesn't match; the marker must not land. On the old code 8 of its 16 checks fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysd3d12: retain invalid upload self-copy Close rejectionpmilewsskiedu-gif
13 daysXDXR builder: BOX16 inner nodes for MINIMIZE_MEMORY bottom-level buildszneel
A bottom-level BuildRaytracingAccelerationStructure with MINIMIZE_MEMORY now writes BOX16 inner nodes (64 bytes, half boxes) instead of BOX32 (128 bytes): the same tree, about a fifth smaller. Prebuild info, the build and its refits take the choice from the same flags (xdxr_box16), so the sizes stay exact. Top-level builds keep BOX32 (world space: a half's step is 2 m at 2 km). Each child box is rounded outward from the exact box kept in scratch, in integer code (packHalf2x16's rounding is implementation-defined; AMD rounds toward zero). Past the half range a bound goes to +-inf outward and +-65504 inward, so empty slots stay empty; below the smallest normal half it goes to 0 or +-2^-14, never a denormal a flushing decoder would shrink. tools/xdxr_bvh.py half_round gets the same denormal rule, and check-build now compares every BOX16 word bit for bit with encode_box16 of the exact box of the triangles under it. Tests: five blas_box16_* cases in vk_xdxr_build_test (radix and small sort, an inactive triangle, values past 65504 and below 2^-14, a refit), and a MINIMIZE_MEMORY BLAS plus its in-place update through the D3D12 API in d3d12_xdxr_rt_test (prebuild and postbuild sizes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysMerge pull request #3693 from AyinakiItsNotRexed
13 daysMerge pull request #2297 from EwannItsNotRexed
13 daysMerge upstream main and preserve Vulkan runtime behaviorgabrielsteglich
13 daysperf(runtime): move a draw's views out of the command variant (D3D-391)Ayinaki
#2483 made the render targets and vertex buffers inline arrays in Draw. That is 704 of its 976 bytes, and a recorded command is sized by its variant's largest alternative, so every command in a list, barriers included, took 984 bytes. Draw now holds a shared_ptr to a DrawViews block that the D3D12 shim rebuilds only when the render targets or the bound vertex buffers change, so a run of draws still allocates nothing per draw. replay_cpu_bench: one recorded Command 984 -> 296 bytes; frame 3890 -> 3824 us, within run-to-run noise; allocations per command unchanged.
13 daysRuntime: command allocators and lists answer invalid arguments as the host doesEwann
Measured against the host D3D12 runtime (RTX 5070, driver 621.14) with d3d12_vulkan_device_test's compare_invalid_arguments: - CreateCommandAllocator and CreateCommandList1 took any type (7, 99, -1); the host refuses types past VIDEO_ENCODE with E_INVALIDARG. - CreateCommandList and CreateCommandList1 took a node mask with bits past node 0; the host answers E_INVALIDARG. - A null output was E_POINTER in all three; the host answers E_UNEXPECTED, after the argument checks. compare_invalid_arguments gets 35 "command allocator:", "command list:" and "command list1:" cases. Video list types are not compared: the host hands out a video list (E_NOINTERFACE for ID3D12GraphicsCommandList), while this layer creates a graphics list for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysMerge pull request #3255 from KanameSItsNotRexed
13 daysMerge pull request #2042 from VonsekItsNotRexed
13 daysMerge pull request #1161 from woreksamiItsNotRexed
13 daysMerge origin/main into queue-wait-before-signalAlxcBTW
13 daysMerge upstream main into reserved texture tile mappingsgabrielsteglich
13 daysQueue holds: review fixes (Present ordering, pins, timeline monotonicity, ↵AlxcBTW
fence lifetime, teardown, docs) - Present is queued behind held work (QueueHolds::after_held) and submitted in order by the releasing thread. - Held batches keep the pipeline states and root signatures of their lists; fences a queue waits on or signals are kept until the submission has completed on the GPU (a D3D12 queue holds them). - A held Signal released below an unheld one on the same fence leaves the Vulkan signal out (claimed under the submit lock). - A queue destroyed with held Signals completes the CPU waits on their fences and reports it. - A failed held batch is reported (take_held_failure, last_execute_result), its waits stay for the next submission, and the Signal behind it still signals. - d3d12_queue_handover_test: pairs, two-thread signalling stress, held Signal of a released fence, shared fence, teardown with a CPU waiter; --two-queues and --shared-queue modes on a caller-owned device. - Tests for each fix in vk_presenter_sync_test, vk_queue_query_sync_test and d3d12_m4_compute_test; docs section 4.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysRuntime: a bundle that sets viewports, scissors or render targets, or calls ↵KanameS
ClearState, fails its Close, as on D3D12 RSSetViewports, RSSetScissorRects, OMSetRenderTargets and ClearState had no bundle check, so the layer accepted them in a bundle while the PC runtime fails that bundle's Close (measured on an RTX 4060 Ti and WARP, no debug layer). They now invalidate the bundle like the other calls a bundle may not make. New host-comparison test d3d12_bundle_forbidden: ten calls, each in a bundle and, as a control, on a direct list, against the PC runtime on the default adapter and WARP. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
13 daysMerge pull request #2483 from Shadman PCItsNotRexed
13 daysRuntime: hold a CPU fence signal until the queue signals before it have ↵woreksami
completed ID3D12Fence::Signal from the CPU called vkSignalSemaphore at once, also while a queue Signal of a lower value was still pending on the GPU. Vulkan requires a host signal to stay below every pending signal (VUID-VkSemaphoreSignalInfo-value-03259), and D3D12 allows the order. The fence now records the highest value a queue will signal, under the same lock as the claim, and a CPU signal above a value the GPU has not reached yet (or made while an earlier one is held) is handed to the fence dispatcher, which applies it once the GPU passes that value, in the order the signals were made. The callback holds no pointer to the fence; when the fence is released (cancel) or the device is lost before the queue value is reached, the held signal is dropped, since signalling then would break the same rule. Until a held signal is applied, GetCompletedValue reads the GPU's progress. d3d12_fence_timing_test: a queue Signal kept pending by a Wait on a gate fence, a CPU Signal above it (held, then applied), and two CPU signals held behind one queue signal (applied in order). Fails on main's Fence at the first check: the event for the CPU value fired while the queue signal was still pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 daysMerge upstream main into codex/d3d12-compute-traceVonsek
Trace at the Dispatch entry point while preserving the newly merged bundle replay path.
13 daysperf(runtime): inline draw views and move into CommandList to eliminate ↵Shadman PC
allocations (D3D-289) In `replay_cpu_bench` and real game execution, recording draws was the largest remaining per-draw overhead (~155-160 ns and 4 heap allocations per draw call, measured by @traeb0n in #2123 follow-up finding D3D-289). Previously: - `d3d12_com.cpp` heap-allocated a dynamic `std::vector<TargetView>` for render targets and another `std::vector<VertexBufferView>` for vertex buffers (copying from the list's 32-element array). - `CommandList::draw(const Draw&)` then copied both vectors again into the `Command` variant inside `commands_`, resulting in 4 heap allocations per draw. This change: - In `runtime/src/command_list.h` (`leonida::Draw`): - Replaces `std::vector<TargetView>` with fixed inline `std::array<TargetView, 8> render_targets` (matching `D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT` = 8) and tracks `render_target_count`. - Replaces `std::vector<VertexBufferView>` with fixed inline `std::array<VertexBufferView, 32> vertex_buffers` (matching `D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT` = 32). - Adds rvalue `bool draw(Draw&&)` overload that moves the command into `append(std::move(draw))`. - In `runtime/shims/d3d12_com.cpp`: - Stores `render_targets_` as an inline `std::array<leonida::TargetView, D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT>`, eliminating heap reallocations on `OMSetRenderTargets`. - Directly passes `vertex_buffers_` without copying into a temporary vector. - Moves `draw` with `check(list_.draw(std::move(draw)))`. - In `runtime/src/vulkan_replay.h`: - Iterates over bound render targets using `slot < draw.render_target_count && slot < draw.render_targets.size()`. - In `runtime/test/d3d12_com_test.cpp`: - Adds static assertions verifying `Draw` move constructibility, move assignability, and fixed inline array sizes. - Updated `docs/d3d12_vulkan.md` with the contract details. Result: 0 heap allocations per draw call (down from 4), eliminating ~155-160 ns recording overhead per draw call. Tested: - `python -m compileall -q make_game.py tools tests`: OK - `python -I make_game.py --help`: OK - `static_assert` checks in `d3d12_com_test.cpp`: verified Hardware: Tested on AMD Radeon RX 7800 XT (driver 24.20.19.05 / Vulkan 1.4.359 / Windows 11). AI-assisted. Standard library / C++ only; no game content or carved assets. Item: D3D-289 Depends on: #2123
13 daysMerge pull request #2145 from KanameSItsNotRexed
13 daysMerge pull request #2112 from SirKinggItsNotRexed
13 daysMerge upstream main into codex/d3d12-compute-traceVonsek
Keep the newly merged graphics descriptor trace coverage ahead of the compute calls in the shared fixture.
13 daysRuntime: map sparse reserved RGBA8 texture tiles (D3D-285)gabrielsteglich
13 daysRuntime: a bundle's draws run with the parent's state, and what the bundle ↵KanameS
set stays on the parent A draw recorded in a bundle took the bundle's own viewport, targets, root arguments and buffers. A bundle cannot set a viewport, so every bundle draw was dropped without an error, and nothing of the parent's state reached it. Only the stencil reference and the blend factor were handed back. Inside a bundle, state calls, draws and Dispatch are now kept as deferred calls, and ExecuteBundle plays them on the parent through the members a direct call uses, between the bundle's state-free commands, in order. A draw sees the parent's state plus what the bundle set, and what the bundle set stays on the parent, as measured on the PC runtime. This replaces the stencil-reference and blend-factor carry-back fields. Trace lines are written once, when the bundle records the call. ClearUnorderedAccessView is refused in a bundle, like the other clears. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>