- One gate for both halves: supported() also asks for shader model 6.6, and the translator is
told inline ray tracing runs (set_host_inline_rt) only once the DXR manager is made.
- AABB geometries take stride 0 (packed 24-byte boxes) and multiples of 8 of 24 or more, as
DXR does; others are refused.
- A TLAS of instances by pointer (ARRAY_OF_POINTERS) is not built: the remap reads 64-byte
instances in a row.
- Structure copies other than clone and compact are not done (said once).
- A TLAS clone points the heap slots that view the destination at the shared structure.
- The points not fixed here are listed in fork-ray-tracing.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rq_op: 187 is CandidateWorldToObject3x4 and 188 CommittedObjectToWorld3x4 (they were
swapped; checked against dxc 10.0.26100). the_ray_query_opcodes_are_dxils pins all 35.
- Hardware ray tracing runs only where it can: hwrt::active() (asked for, and a DXR 1.1
manager made) gates the HLE module, the left-out passes, the copy-back rule and the counters;
the translator lifts loops only when the host says it runs inline ray tracing
(set_host_inline_rt, in host_settings and so in the shader cache's key). Elsewhere the title
keeps its own XboxBvhBuilder.dll and the software walk.
- No env write: builder_allowed() is LEONIDA_BVH_BUILDER=1 and not hwrt::active().
- dxr.rs removed (nothing bound its wrappers); TLAS views are kept out of the list views only
with the path on; the off16 diagnostics and the xmem log lines are gone.
- as_sizes split out of alloc_or_reuse_as, with a test; the known gaps are in
fork-ray-tracing.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In place of -RayTracing (the title's structure builder and software traversal as translated
shaders): the title's XboxBvhBuilder calls become host DXR 1.1 bottom and top levels, and the
traversal loops of its trace programs become inline ray queries.
Ported from trustno1-coder/VIctory-NVIDIA (its #3706; from Leslie-d-a/VIctory-NVIDIA-HWRT 61e389e0
and 5f55bca8, original by dakisback2 ecc49d5b and 72f8316a), GPL-3.0, and fitted to this tree:
- leonida-shader: emit/rayquery.rs wired into lower.rs (the plan, the handles, TLAS root SRVs
t230..t241, the analyses that leave the lifted loops out). A program in the paired form is not
lifted. With LEONIDA_HW_RT=1 the node test of a loop left unlifted misses every node
(emit/intersect.rs bvh_miss): the console structures are never written then.
- leonida-gpu: hwrt.rs (and dxr.rs for its records); list::external with a LEONIDA_THIN op for the
structure work at its place in a title list; the TLAS views in the descriptor heaps;
Deferred::held; the ray queries in the shader cache's entries; counters in the frame log.
- leonida-hle: modules/xboxbvh.rs replaces the exports of the title's XboxBvhBuilder.dll when on.
- With it on the light stand-in stands aside and the passes left out without structures run.
Shader writes are not all copied back as VIctory-NVIDIA does (LEONIDA_HW_RT_COPY_BACK=1 asks for
it): here that stretched and flickered textures and cost 30 to 45 ms a frame.
- F1: HARDWARE RAY TRACING (TRIAL); play scripts: -HardwareRT (frame generation left off with it,
as with -RayTracing); launcher: a checkbox. Docs: fork-ray-tracing.md, README.md, switches.md.
One PC (RTX 4070 12 GB, driver 621.40, Series X profile, no frame generation): 22 to 25 frames a
second against 6 with -RayTracing; the run ended after six minutes with the card's memory full.
Co-authored-by: dakisback2 <90546900+dakisback2@users.noreply.github.com>
Co-authored-by: Leslie-d-a <70692092+Leslie-d-a@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Since 2026-11-27 07:27 every run logged "no stand-in for the indirect light:
missing depth SRV role=Resolve" and never ran the resolve's stand-in: the view
the resolve binds where its depth was (table offset 464) is the stencil plane,
so rooms lit by bounced light (Jason's house, every interior away from its
windows and lamps) kept the title's ray-less output, walls and ceilings black.
Now, where that view is a stencil plane, the depth plane of the same texture
that the same dispatch reads elsewhere is taken (after TaynanGT's 292adb5a8 in
Fayberr/Victory-United, GPL-3.0); the log names where it was found.
LEONIDA_AMBIENT_FLOOR=<level> holds the estimate at least at a warm fill,
shaded in creases (DoubleGhosty/cool_fox 98c3333, VICTORY_AMBIENT_FLOOR,
GPL-3.0-or-later); the estimate follows only the light visible surfaces send
out directly. Unset or 0: no floor. The estimate's NaN guard comes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What it is about: the stand-in's passes that need the scene's depth take
the view at table offset 464 of the title's resolve
(`CS_ScreenProbes_TemporalResolve_*`). The fork read off the resolve its
prison scene runs (`..._ReflectiveCaustics`, 34fb51b8a0312e82, which one
run here had made too) that the view at 464 is the stencil plane (the
program reads its second channel) and that its depth is the view at 688
(tested against 0 for the sky). There the passes then took every point for
1,000 m away. Here the view must be a depth plane since f0606a744: if the
title's view names the stencil plane as such (plane 1, or a stencil
format), the stand-in is not put in at all for such a resolve, and the log
says "no stand-in for the indirect light: missing depth SRV" once; if it
does not, the passes read it as the fork's did. Which of the two it is has
not been looked at in a run.
What changes: with LEONIDA_AMBIENT_TRUE_DEPTH=1 the resolve's depth is
looked for at 688 first: a depth-plane view there of a single-sample 2D
texture of the image's size is used (and said in the log once); any other
resolve keeps 464 as before. Unset: nothing changes. Off by default: read
off one program by the fork and not measured here, and the fork keeps it
off while it is tried (the creases' shade starts to act with it).
docs/fork-ray-tracing.md lists the switch.
Source: edsuuu/VI-BR-PORT 783b2e1 (edsuuu; VICTORY_AMBIENT_TRUE_DEPTH),
GPL-3.0, that part of the commit only, ported by hand. Not ported: its
ambient key, the stencil's "inside a room" bit and the gain's log line
(this tree's stand-in is the estimate, not their constant).
Tests: cargo check --profile diag -p leonida --features diagnostics,mimalloc.
Not run in the game. AI-assisted.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What changed:
- victory/ is now d3d12/;
- its crates are leonida-* (leonida_* code paths);
- the program is leonida.exe;
- settings are LEONIDA_*, and the older VICTORY_* names still work through apps/leonida/src/leonida.rs;
- the config file is leonida.toml;
- log names and user-facing text say Leonida.
What did not change: lines that credit upstream projects or people, URLs, copyright notices and the
GPL-3.0 LICENSE. d3d12/README.md opens with a Leonida section that says the runtime grew from
Marvisak/VIctory through trustno1-coder/VIctory-NVIDIA. The rest of that README is labelled as
trustno1-coder's.
The launchers (scripts/play-d3d12.ps1, scripts/play-linux.sh), docs/linux.md and
scripts/sync_victory.py (prefix d3d12) follow the move. Future upstream merges will need a
mapping from upstream's names onto these.
Builds with `cargo build --profile diag -p leonida --features diagnostics`. The settings alias
tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>