Commit Graph

4597 Commits

Author SHA1 Message Date
aeec1ddc6f Merge pull request #1850 from cheltyi/fix/gamedata-empty-typed-objects
gamedata_reader: preserve empty polymorphic objects (GAMEDATA-EMPTY-TYPED-OBJECTS)
2026-11-25 18:28:59 +01:00
fe1553456f Merge pull request #808 from whoalin1/shader-structured-pc-unwrap
cfg_structure / rdna2spirv: unwrap tautological %pc guards in structured CFGs (ms_wave_info_s3 AMD crash, SHADER-STRUCTURED-PC-UNWRAP)
2026-11-25 17:46:31 +01:00
daf31b820b replay: copies between depth formats that differ go through transfer scratch (RT-DEPTH-FORMAT-COPY-STAGED)
A CopyTextureRegion of the depth plane from a D32_SFLOAT_S8_UINT image into a
D32_SFLOAT one was replayed as vkCmdCopyImage. Vulkan requires depth/stencil
formats to match exactly (VUID-vkCmdCopyImage-srcImage-01548), and the NVIDIA
driver (RTX 4070 Laptop, 621.40) wrote past the end of the D32 image: the
world-start WRITE_INVALID device loss, with the fault at the first byte after a
2560x1440 D32_SFLOAT image (VK_EXT_device_address_binding_report) and this VUID
reported by the validation layer just before the loss.

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:48:26 +01:00
c3b58ef03d Merge pull request #1732 from kawaii-shakal/arena-rebar-cap
d3d12: keep a Resizable BAR arena in VRAM when the driver excludes it from a very large buffer (RT-ARENA-REBAR-FIT)
2026-11-25 15:38:52 +01:00
24a29f8b4e Merge pull request #1827 from DadaCap/title-staged-no-host-copy
d3d12: title images use the staged upload on a device without host image copies (RT-TITLE-STAGED-NO-HOST-COPY)
2026-11-25 15:37:56 +01:00
71a769d7d8 Merge pull request #1691 from OreoFR/rt-slot57-depth-raster
d3d12_xs: depth, stencil and raster state for slot 57 native pipelines from state blob A (RT-SLOT57-DEPTH-RASTER)
2026-11-25 14:55:52 +01:00
77baf90627 Merge pull request #1703 from OreoFR/rt-dual-source-blend
d3d12: dual-source blending reads SV_Target1 at Location 0, Index 1 (RT-DUAL-SOURCE-BLEND)
2026-11-25 14:46:46 +01:00
5e95fa2f46 Merge pull request #1671 from OreoFR/rt-slot57-blend-state
d3d12_xs: blend state for slot 57 native pipelines from state blob A (RT-SLOT57-BLEND-STATE)
2026-11-25 14:28:49 +01:00
384abe5b06 Merge pull request #1843 from aslan2142/rt-input-script-no-sdl3
RT-INPUT-SCRIPT-NO-SDL3: scripted input in builds without SDL3
2026-11-25 14:15:49 +01:00
6e85823da4 gamedata_reader: preserve empty polymorphic objects 2026-11-25 16:05:38 +03:00
ea6d535ff5 d3d12: title images use the staged upload on a device without host image copies (RT-TITLE-STAGED-NO-HOST-COPY)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:40:50 +01:00
c68f494160 RT-INPUT-SCRIPT-NO-SDL3: serve LEONIDA_INPUT_SCRIPT without SDL3
A build without SDL3 answered GameInputCreate with no devices and E_NOTIMPL
for every other slot, so the title waited at its first "press A" prompt
forever: no CI artifact or offline build could get past it.

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

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:39:13 -05:00
597cf76623 TOOLS-WINE-GAME-RUN: scripts/run_game_wine.sh, one bounded game run under Wine
The launcher runs gta6rt.exe --run once under Wine on Linux, headless on a
private kwin_wayland --virtual --xwayland session (Xvfb has no DRI3, so RADV
cannot present there) or on the current display with --visible. Sound is off
(Wine's audio drivers disabled, Pulse/PipeWire/ALSA pointed at nothing,
LEONIDA_AUDIO=silent for the runtime's silent output endpoint), --device pins
the Vulkan device through MESA_VK_DEVICE_SELECT, and a hard time limit, a lock
and full teardown bound the run. Every path comes from arguments or the
environment.

tools/game_run_summary.py prints counts only: run time, end, exceptions by
code, D3D12 calls by outcome, presents, the top failing calls and the [rt]
lines by category with numbers masked. It never prints a log line.

Tests need no game, Wine or GPU: the script against stubs, the summary on
synthetic run folders. docs/linux_proton.md describes the script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 07:30:48 -05:00
b19b00e88a Merge branch 'rt-slot57-blend-state' into rt-dual-source-blend
# Conflicts:
#	docs/fspx.md
2026-11-25 13:01:26 +01:00
7a769396d9 Merge branch 'rt-slot57-blend-state' into rt-slot57-depth-raster
# Conflicts:
#	runtime/CMakeLists.txt
2026-11-25 13:01:25 +01:00
668d65b4b9 d3d12_xs: slot 57 retries only a pipeline that blends a B4G4R4A4 stand-in (RT-SLOT57-BLEND-STATE review)
adrianmjim's review: the blend fallback ran on any E_NOTIMPL, which also stands for
refusals unrelated to blending (stream_unsupported, mesh limits, FullyCovered, and
#1703's dual-source refusal). Such a pipeline was retried with blending off, logged as
a blend refusal, and, if the retry succeeded, drew without the blend the title asked for.

Now only a pipeline with a blended B4G4R4A4 target is retried, with blending off on
those targets alone (without_stand_in_blend, its own header), and the line is printed
only when that retry succeeds. The "every target" step is gone: no real boot used it
(RTX 4070 Laptop and kawaii-shakal's RTX 5070 Ti only ever logged the B4G4R4A4 step).
native_pso_fallback_test covers the decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 13:00:57 +01:00
f005d7ab22 Adapt #622 to #1723: the slot 71-74 rows say who writes and who waits
#622's rows had slots 73 and 74 as no-ops and the GPU-label path as the
only writer of 71 and 72. Under #1723 the list values record all four
for the lists they track (waits included), and LEONIDA_GPU_LABELS=1
writes 71/72 only for the others. The command-object table, the value
write paragraph, §5.5 of the console ABI notes and the README row now
say so, and name the arena and xmem fallbacks (src/value_write_sink.h).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:43:20 -05:00
f3bfc039b2 Merge #1723 (post-story runtime) into #622 (list value writes)
Conflicts:
- runtime/README.md: #1723's LEONIDA_GPU_LABELS row (opt-in, only for
  lists the list values do not track). The rows #622 changed are
  brought in line with #1723 in the commits after this merge.
- runtime/shims/d3d12_vulkan_device.cpp: both sides. #622 tracks the
  arena for the label path; #1723 resets the arena's block tree under
  its lock and starts the arena after the null region.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:24:18 -05:00
d0b0b453f1 Merge main into integration/post-story-runtime (#1723), with #1558
runtime/test/xs_proxy_mock_test.cpp: main added check_depth_provider_refusal()
next to check_placed_resource_x() (#1558); this branch added the list-values
checks, which must run last because they start and stop the list-values
threads. Both kept, the list-values checks still last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:21:12 -05:00
59c54c1eb0 d3d12_xs: list slots 71/72 have one writer, the list values, when they track the list
Found by the comparison agent, not by a failing test. #1723's console
list slot path still handed slots 71 and 72 to main's GPU-label hook
(record_gpu_label, LEONIDA_GPU_LABELS) when its own list values track
the list (track_values, on by default with LEONIDA_LIST_VALUES). The
--first-run-ui profile sets LEONIDA_GPU_LABELS=1 (runtime/src/main.cpp).
With both on, two threads stored to one title address, one from a
Vulkan command buffer's completion and query, the other from the part's
fence and a D3D12 timestamp query. A late label could rewind a rising
counter or split a begin/end pair. The suite did not catch it:
xbox_gpu_label_completion submits its real list straight to the queue,
so only the label path landed there.

The list values are the right owner. They land slots 71 to 74 in
queue order behind the gates, and they also do the waits the labels
cannot do. Now:
- The label hook runs only for a list the list values do not track
  (LEONIDA_LIST_VALUES=0, bundles). Each handoff is counted in
  ListValueStats::labels_handed.
- The --first-run-ui profile no longer sets LEONIDA_GPU_LABELS.
  runtime/README.md and docs/first_run_ui.md say so.
- xbox_gpu_label_completion runs its label section with the list values
  off, as it always measured the label path alone, and checks that all
  five writes went there. A new section turns both on and records one
  write32 and one write64 on a tracked list, submitted through the queue
  proxy. Each lands exactly once: writes_landed == 2, labels_handed == 0,
  and the values are in memory. With the old condition this section
  fails at line 136 (labels_handed was 2), on llvmpipe and the iGPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 06:16:46 -05:00
a607b779c4 d3d12: check heap eligibility when sizing the ReBAR arena
AI-assisted by Codex.
2026-11-25 10:53:03 +00:00
bcaa13dad3 Merge pull request #1558 from ubiquitarianism/claude/d16s8-uav-nvidia-fallback
Merging.

**Why merged**
- Fixes the NVIDIA startup stop that #939 introduced. Slot 133 asks for a D16S8 (format 118) depth texture with unordered access. On NVIDIA, `pc_format()` maps it to D24S8 and the depth provider refuses UAV on that, so the boot died early. With this PR the refusal is logged once and the texture is made without UAV, i.e. the pre-#939 stand-in.
- Independent real-boot confirmations past the stop, each against the same build without the PR stopping there:
  - RTX 4070 SUPER, Windows 11;
  - RTX 5060 Ti, Windows 10 (Snooozs);
  - RTX 3070 Ti, Wine 11.22 (djrolfes);
  - RTX 3080 Ti, Wine 11.17 (slauko: 603 s, no exception);
  - RTX 3090, Proton (azsekazvamdimitar).
  - On AMD (adrianmjim, RX 7900 XT) the native path is untouched and the related tests pass, including a GPU without D24S8 that falls back to D32S8.
- Re-tested here merged onto 3de22a190 (after #1547) on an RTX 4070 SUPER, and the merge onto the current main (57ba40bd6, which only adds #1493's translator change) is also clean:
  - fresh RelWithDebInfo build;
  - full ctest 410/411, where the only failure is `d3d12_depth_resolve`, the known NVIDIA MFAA sample-position case fixed by #1505;
  - the PR's 16 related tests pass, also with `LEONIDA_VK_VALIDATION=1`;
  - the consistency set is the same as main.

**Why it's good**
- It's a narrow fallback, used only when the provider refuses. Consoles and GPUs that accept the format keep the native path.
- It comes with tests for the refused and accepted cases.
- It unblocks every NVIDIA tester at the same spot.

**Known and separate:** the slot 133 stand-in leaks about 60 Vulkan objects at device teardown under validation. That leak predates this PR and is reported in #1608. Full D16S8 UAV semantics on NVIDIA remain a follow-up.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-25 05:38:42 -05:00
be6301be99 Merge commit 'refs/tmp/main' into HEAD 2026-11-25 05:12:31 -05:00
f0e776adfb docs: STENCILTESTVAL and depth-bias counts for RT-SLOT57-DEPTH-RASTER (review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 11:08:31 +01:00
57ba40bd6d Merge pull request #1493 from ubiquitarianism/claude/valu-literal-sext
Merging.

**Why merged**
- Fixes a real translator bug: the 32-bit literal of signed 64-bit `v_cmp(x)_*_i64` (and the other signed 64-bit VALU forms this PR covers) was zero-extended instead of sign-extended, so comparisons against negative literals gave wrong results.
- Independent checks:
  - approved by tiguan26;
  - KEEP from ytsodacan's review;
  - independent hardware verification by ecox982745 on an RTX 4090: the parent gave 444 wrong results out of 2,016 lane outputs, this head gives 0, and the unsigned controls are unchanged.
- Re-tested here merged onto current main (3de22a190) on an RTX 4070 SUPER:
  - the merge is clean;
  - `tests/semantic` VALU/VCMP files plus the PR's new test: 1,483 passed, 21,175 subtests passed, 0 failed;
  - the full semantic suite on 604ddff0b: 6,287 tests, 0 failed (main: 6,279);
  - the PR's new test fails 5 of 8 against main's translator, as a control;
  - the consistency set is the same as main, whose only failure is the pre-existing `test_runtime_paths` workflow check.

**Why it's good**
- The change is small and scoped: `valu_imm_i64`/`src64_i64` are applied only to the signed 64-bit forms, and the unsigned paths are untouched.
- It comes with a regression test pinned to the exact encodings.
- Wrong signed compares silently steer branches and masks in translated shaders, so this removes a class of hard-to-trace wrong results.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-25 05:01:35 -05:00
96bbe55ce8 d3d12: keep a Resizable BAR arena in VRAM when the driver excludes it from a very large buffer (RT-ARENA-REBAR-FIT)
On an RTX 5070 Ti (NVIDIA 617.42) a 4,090 MiB arena-shaped buffer may use
the DEVICE_LOCAL | HOST_VISIBLE type and a 4,092 MiB one may not, so
LEONIDA_ARENA_MB=4096 (4,095 MiB, the workaround from #1537) placed the
whole arena in system memory: 4 GiB more host commit, and every
default-heap buffer read over PCIe.

With Resizable BAR, create_arena now tries 16 MiB smaller sizes, by at
most an eighth, and keeps the largest whose buffer may still use that type
(device_local_arena_bytes in arena_size.h). The cap is logged like the
other device caps. Without Resizable BAR nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 15:01:30 +05:00
ba626820ec Integrate post-story-load memory, queue and Vulkan runtime changes
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>
2026-11-25 03:44:43 -06:00
3de22a1904 Merge pull request #1547 from TheGeogeo/perf/pipeline-compile-workers
d3d12: compile a submission's pipelines on worker threads (RT-PIPELINE-COMPILE-WORKERS)
2026-11-25 10:24:30 +01:00
2b567edca9 Merge pull request #754 from MoonEyes/docs/related-6stars-dup
docs: one meetox80/6stars entry in related projects (DOC-RELATED-6STARS-DUP)
2026-11-25 10:02:52 +01:00
8b771908c3 Merge main into feat/gdk-lifecycle-window-hook (#769)
scripts/build_runtime.ps1 conflicted in the $files list of the build
without CMake: main added shims\silent_audio.cpp there (#1598) after this
branch had merged main, and this branch adds shims\lifecycle.cpp. Both
entries are kept, lifecycle.cpp where this branch had it. The branch's
other change in that file (user32.lib on the link line) merged cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:41:48 -05:00
d763845349 d3d12: dual-source blending reads SV_Target1 at Location 0, Index 1 (RT-DUAL-SOURCE-BLEND)
A PSO whose blend state uses a SRC1 factor gets its fragment module's Location 1
colour output moved to Location 0 with Index 1, as Vulkan takes the second
source. Slot 57 native PSOs now map the SRC1 factors of state blob A.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:37:42 +01:00
69ddea6803 docs: state blob A's depth, stencil and raster registers (RT-SLOT57-DEPTH-RASTER)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:19:16 +01:00
81f33de1cd docs: the stand-in-target fallback of RT-SLOT57-BLEND-STATE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:19:00 +01:00
4e7b764dbc d3d12_xs: integer render targets keep blending off in slot 57 native PSOs (RT-SLOT57-BLEND-STATE)
A library pipeline enables MAX on an R8_UINT target; the colour block bypasses
blending there, and D3D12 refuses the PSO.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 09:02:38 +01:00
2f44380590 docs: state blob A's colour-target registers, measured over the library (RT-SLOT57-BLEND-STATE)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 08:41:48 +01:00
018145b338 runtime: serve the spatial stream on the silent output endpoint
The title activates ISpatialAudioClient on the render device, not IAudioClient (the first
game run with the silent endpoint logged that IID and stopped as before). The silent device
now answers ISpatialAudioClient and ISpatialAudioClient2: a 7.1 static bed, no dynamic
objects, mono 48 kHz float objects, 480 frames a pass. Its ISpatialAudioObjectRenderStream
signals the stream's event every 10 ms while it runs, and its objects write into a
scratch buffer. The periodic event thread is shared with IAudioClient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:20:54 -05:00
9b74691f74 docs: the console's value-write slots 71 to 74
The four rows of the measured console list slots, with the slot numbers the retail title's trace gives and the attribution of the call shapes and the write model.
2026-11-25 13:17:09 +08:00
d4ce33ed42 runtime: serve a silent output endpoint when the host has none
The title creates its MMDeviceEnumerator through CoCreateInstance. On a host with no
render endpoint, GetDefaultAudioEndpoint(eRender) is 0x80070490, the title's audio device
start leaves its own output-device lock held, the audio engine never mixes, and the boot
stops on an int3 about 47 s in. A console always has an output.

com_shim's CoCreateInstance now hands that class to shims/silent_audio.cpp. A host
enumerator with a default render endpoint is returned unchanged. Otherwise (no endpoint,
no enumerator, or LEONIDA_AUDIO=silent) render questions get an in-process endpoint:
IMMDevice with a read-only property store, IAudioClient/2/3 at 48 kHz float 7.1, and
IAudioRenderClient, IAudioClock, ISimpleAudioVolume and IAudioStreamVolume. A clock drains
the padding in real time and an event-driven stream's event is signalled every 10 ms.
Every sample is discarded; no host audio device is opened. Capture keeps the host's
answer. One [rt] line names the reason when the silent device is first served.

silent_audio_test covers stand-in hosts with and without an endpoint, no host, a render
stream over a few periods, and the CoCreateInstance hook with LEONIDA_AUDIO=silent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:05:32 -05:00
3cf0a41bc5 d3d12_xs: make a D16S8 depth texture without UAV when the depth provider refuses it
Since #939, slots 76 and 133 hand a depth-stencil texture with unordered access
to the depth provider. On a GPU with D24S8 attachments (every NVIDIA card) the
Vulkan layer's pc_format() makes D16_UNORM_S8_UINT (format 118) as
D24_UNORM_S8_UINT, and Resource::enable_depth_stencil_uav accepts only
R16_TYPELESS, 118 and R32G8X24_TYPELESS, so it answers E_INVALIDARG. Slot 133
passed that on for a 1280x720 format 118 texture with ALLOW_DEPTH_STENCIL |
ALLOW_UNORDERED_ACCESS (all-ones layout), and the boot stopped on an int3.

When the provider refuses (E_INVALIDARG or E_NOTIMPL from the provider call
itself), slot 76 now makes the committed texture without unordered access and
slot 133 goes on to its stand-in (the title-placed texture, else the committed
one), as both did before the provider. The first refusal per slot is logged.
Any other failure is passed on as before: the provider out of memory, the
backing's own CreateCommittedResource, a refused placement or description.
The refused backing is released and no placement range is registered.

On a real boot (Windows 11, RTX 4070 SUPER, driver 621.24), on 0bc810504 with
an earlier form of this change that fell back on any failure of the depth path
(the only one that occurred was the provider's): the fallback fires once
(slot 133, format 118, hr=0x80070057), no int3, 6,187 PresentX ok and 0
failed, 69/69 captures non-black, and the boot reaches the first-run pages.
Without it, 3 of 3 boots stopped on the int3 after 182-362 PresentX.

Tests:
- xs_proxy_mock: a mock provider refusing a format 118 texture (E_INVALIDARG,
  E_NOTIMPL) through slots 76 and 133 gets S_OK and the stand-in, with the
  refused backing released; E_OUTOFMEMORY from the provider, a failing backing
  and a refused placement are passed on with no stand-in.
- xbox_d16s8_refused_uav (Vulkan, LEONIDA_CONSOLE_D16S8=d24): slots 76 and 133
  return a depth-stencil texture without unordered access.
Both fail without the change (slot 76 and slot 133 each checked on its own).

Follow-up: teach enable_depth_stencil_uav the D24S8-made form of format 118,
so these textures keep their UAVs on NVIDIA too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SR1Fv7eQNgZjM6miWPKjHf
2026-11-24 23:34:00 -05:00
f9792cc56d Merge remote-tracking branch 'ubiq/main' into feat/gdk-lifecycle-window-hook
# Conflicts:
#	scripts/build_runtime.ps1
2026-11-25 00:58:58 -03:00
d16eb1ff0a d3d12: give a depth placement inside another one's PC extent its own image
The slot-133 depth/UAV registry recorded each placement's extent as the PC
allocation size and refused, with E_NOTIMPL, any placement that started
inside another live range. On RADV the PC size of a large D16 target is
above the block the title placed it in, so the title's next block starts
inside the previous range: its first depth target was refused, no trace
line showed it, and the title stopped on its own assert and crash reporter
about 30 s into the boot (Game Init, frame 0) on an RDNA2 iGPU.

Overlapping placements at different addresses never shared a backing, so
between two opaque layouts the inner one now gets an image of its own, as
D3D12 leaves an alias's contents undefined until it is reinitialized. A
non-opaque layout is still refused there, and the same-address rules are
unchanged. A refused depth placement is now logged.

d3d12_depth_stencil_uav_test places a texture one alignment step inside
another one: refused for the tiled Xbox layout, its own backing for the
opaque one, and the outer placement still finds its shared backing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:52:55 -05:00
3e1c49e1bd d3d12: compile a submission's pipelines on worker threads (RT-PIPELINE-COMPILE-WORKERS)
prepare() leaves the pipelines that are not built yet to PipelineCompiles, once per pipeline and variant. VulkanQueue::execute_now compiles them together on the device's workers with the resource lock held, places them in the prepared commands and then writes the command buffer, so every draw and dispatch has its own pipeline. A refused compile gives the result prepare() alone would have given. LEONIDA_PIPELINE_THREADS=0 keeps the path of before. Graphics pipelines of 1 MiB of SPIR-V or more and compute pipelines over 128 KiB compile one after another, and LEONIDA_ASYNC_PIPELINES keeps its own worker.
2026-11-25 04:46:33 +01:00
bfef489cb6 Merge pull request #1232 from iFeyz/feat/direct-heap-graphics
d3d12: graphics draws supply the directly indexed heaps after their root arguments (RT-DIRECT-HEAP-GRAPHICS)
2026-11-25 04:26:54 +01:00
98efc22ca3 Merge pull request #1064 from Moriz82/split/rt-direct-heap-compute
d3d12: supply directly indexed heaps to compute dispatches (RT-DIRECT-HEAP-COMPUTE)
2026-11-25 04:25:38 +01:00
275cb01456 Merge main into carry/old-9921-ms-compressed-exports (after #1197)
- tools/rdna2spirv.py, mesh_export: #1197's misc-vector return for pos1
  (Layer/ViewportIndex) comes first, then this pull request's compressed
  components; both kept.
- docs/design.md, "Mesh shaders" row: main's row (with #1197's sentence)
  plus this pull request's compressed-export sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:14:11 -05:00
3ee0037fd3 Merge main into RT-DIRECT-HEAP-GRAPHICS (#1232)
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>
2026-11-24 22:13:02 -05:00
e950f8582f docs: contract row for mesh-shader Layer and ViewportIndex
Add the rule this pull request introduces to the "Mesh shaders" row of
docs/design.md: Layer and ViewportIndex from the pos1 misc vector become
per-primitive members of %ms_cull, each lane writing the primitive with
its own index. That is exact when the value is the same for all vertices
of a primitive; whether the hardware takes the provoking vertex's value
instead is not measured. None of the 1,906 mesh shaders of the
maintainer's corpus that export pos1 writes either output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:10:50 -05:00
5115f08879 Merge main into RT-DIRECT-HEAP-COMPUTE (#1064)
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>
2026-11-24 22:09:38 -05:00
b07b9ecb09 Merge pull request #974 from iFeyz/feat/d3d448-graphics-root-layout
D3D-448-GRAPHICS: graphics root arguments in the console layout, mesh shaders through a window
2026-11-25 04:00:46 +01:00
50740a1bc5 Merge main into carry/old-9921-ms-compressed-exports
The "Mesh shaders" row of docs/design.md changed on main (#802); the
compressed-export sentence is added to main's version of the row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 21:55:03 -05:00