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>
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>
Review of #4468: replay_cpu_bench compares the row name with std::strcmp
instead of by pointer, and replay_texture_barrier_test also replaces the
aligned forms of operator new and delete, so that an allocation of an
over-aligned type is counted.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
emit made a std::vector<VkImageMemoryBarrier2> for each TextureBarrier: one
heap allocation for each enhanced texture barrier. The barriers of the usual
one or two layout pieces are now in a stack array; a vector holds them only
when a range has more than two pieces.
replay_cpu_bench gets an enhanced texture barrier row, and its self-test
fails when emit allocates for that row. replay_texture_barrier_test checks
the barriers of a one-piece range (no allocation) and of a three-piece range.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- replay_cpu_bench: #3693 moved a draw's render targets and vertex buffers into Draw::views (D3D-391); the bench
builds a DrawViews block instead of writing the old inline arrays.
- xgameruntime_user_test links file_system.cpp, which now defines rt::fs::game_dir that xgameruntime.cpp calls.
- check_sparse_queue_family: a vkCreateInstance refused because the api_dump/validation layer is not installed is
the documented "layer absent" skip (77), not a failure.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- replay_cpu_bench: Draw::vertex_buffers is a fixed array by input slot since D3D-289; set slots 0 and 1.
- test_shader_checks: TOTAL counts the standalone cs_fmt_d16_xyz / cs_heap_init dumps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every command's detail::Prepared carried a draw's fields (a copy of the
GraphicsPipeline, eight attachment slots, depth, vertex and index views),
456 of its 1288 bytes, and the whole entry is refilled for every command on
every ExecuteCommandLists. They move to detail::PreparedDraw in
PreparedList::draws, which Prepared::draw indexes; the pool is kept between
executions like the PreparedList itself and reset() keeps its vectors'
storage. The entry is now 856 bytes.
The draw keeps a pointer to the context's GraphicsPipeline instead of a
copy (a vector and a std::function per draw): VulkanQueue::execute holds
the resource lock from prepare through emit, which add/remove_pipeline
need exclusively, and unordered_map elements don't move. emit builds the
colour attachments in a std::array of D3D12's 8 instead of a vector per
draw, and to_attachment takes the attachment const, so the const_cast goes.
replay_cpu_bench --self-test prepares an indexed draw with depth, then a
draw without either in the same storage, and checks the second keeps
neither (fails without reset(), checked).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The frame's passes now record 16 draws each (three of four indexed),
into the colour and depth targets with two vertex streams, and the
per-kind table times a draw and an indexed draw on their own. The scene
has one graphics pipeline and a geometry arena behind buffer_at, as
VulkanContext provides them.
i7-14700K: a draw costs 487-500 ns (record 170-180 with 4 allocations,
prepare 213, emit 104-107 with 1 allocation), and the frame (37,888
commands) 548 ns per command, 20.8 ms per ExecuteCommandLists for the
layer alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
execute built a new std::vector<PreparedList> on every call, so every
command's detail::Prepared entry (1288 bytes on main now) was made in
fresh memory and freed again: replay_cpu_bench measures that at 274-292
ns per command on an i7-14700K, against 85 ns refilled in kept storage,
over half of the layer's whole CPU cost per command. The queue now keeps
the vector as a member (per queue, like its command buffers: one execute
at a time on a queue, as acquire() and submit() already assume) and
resizes it to the list count; prepare refills each list's entries in
place, where the per-entry vectors also keep their capacity.
replay_cpu_bench mirrors the change and reports both floors (entries in
kept storage and made fresh). Its frame goes from 425 to 194 ns per
command (a 21,504-command frame from 9.1 ms to 4.2 ms).
d3d12_vulkan_device_test executes {B, A}, then {B} alone, and checks
that only B ran the second time: with storage that only grows, a stale A
is replayed after B and the test fails (checked).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A benchmark of the D3D12 -> Vulkan replay's own CPU time: CommandList
recording, prepare and emit, with no-op Vulkan entry points that count
their calls and fake resource bindings, so no GPU, driver or game files
are involved. Bindings and image views are looked up the way
VulkanContext does (unordered_map, std::map view cache), and each
execution makes a new PreparedList, as VulkanQueue::execute does.
It reports, for every command kind on its own and for a frame mix
(barriers, whole-view and rectangle clears, buffer and texture copies,
a UAV clear, queries, predication), the median ns per command of each
phase, heap allocations per command and Vulkan calls per command, plus
the cost of just making and freeing the PreparedList entries.
--self-test (in ctest) checks that every kind and the frame record and
replay, and that the counts are the same on a second run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>