Merge miojo-recomp's experimental ray tracing into Longshot #2755

Closed
VegitoX3D wants to merge 6 commits from vegitox3d/raytracing into main AGit
First-time contributor

The scene as ray-tracing acceleration structures, and what traces against
it: the game's own occlusion pass traced against its geometry (ambient
occlusion), the sun's and the lamps' shadows traced into the game's shadow
mask, the game's ambient light by how much sky each place sees, and one
bounce of light off the surfaces in view.

miojo-recomp is a fork of Hookshot with this work; Longshot is Hookshot's
continuation, so the work is backported onto it rather than merged in one
piece: miojo's upstream was at v2.3.1 (2026-11-15) and this is built on
the nightly of 2026-11-28, two weeks newer. The RT sources come from
miojo's tip, which had already been adapted to that upstream.

What the port needed:

  • The Vulkan back end loads its shaders through builtin_spv (RX_VK_SHADER_DIR
    would not reach a compiled-in array used directly): the four RT shaders
    go through it now.
  • dlss_prep.comp grew the ambient occlusion's push constants, so its SPIR-V
    is regenerated (glslang 11:16.6.0, the version the shipped headers carry),
    the packed variant (r11f_g11f_b10f) with it: the packed one is built from
    the same source and would have kept the old block.
  • The rows moved into a module, gpu/vk/menu/raytracing.cpp, as the Insert
    menu's other rows are, with their keys in longshot_options.ini.
  • hookshot_options.ini is longshot_options.ini here, and the row is read
    through options_path(), as the other rows are.
  • The pipeline state the RT's passes bind is reset the way this back end
    resets it (bound().reset()).

The traced rows need Ray tracing on and a temporal upscaler (DLSS or DLAA)
running: without one there is no pass for them to happen in.

Co-Authored-By: Claude Opus 5.5 [email protected]

The scene as ray-tracing acceleration structures, and what traces against it: the game's own occlusion pass traced against its geometry (ambient occlusion), the sun's and the lamps' shadows traced into the game's shadow mask, the game's ambient light by how much sky each place sees, and one bounce of light off the surfaces in view. miojo-recomp is a fork of Hookshot with this work; Longshot is Hookshot's continuation, so the work is backported onto it rather than merged in one piece: miojo's upstream was at v2.3.1 (2026-11-15) and this is built on the nightly of 2026-11-28, two weeks newer. The RT sources come from miojo's tip, which had already been adapted to that upstream. What the port needed: - The Vulkan back end loads its shaders through builtin_spv (RX_VK_SHADER_DIR would not reach a compiled-in array used directly): the four RT shaders go through it now. - dlss_prep.comp grew the ambient occlusion's push constants, so its SPIR-V is regenerated (glslang 11:16.6.0, the version the shipped headers carry), the packed variant (r11f_g11f_b10f) with it: the packed one is built from the same source and would have kept the old block. - The rows moved into a module, gpu/vk/menu/raytracing.cpp, as the Insert menu's other rows are, with their keys in longshot_options.ini. - hookshot_options.ini is longshot_options.ini here, and the row is read through options_path(), as the other rows are. - The pipeline state the RT's passes bind is reset the way this back end resets it (bound().reset()). The traced rows need Ray tracing on and a temporal upscaler (DLSS or DLAA) running: without one there is no pass for them to happen in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge miojo-recomp's experimental ray tracing into Longshot
Some checks failed
PR description / Title and description (pull_request_target) Failing after 13s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
4a4c4eb686
The scene as ray-tracing acceleration structures, and what traces against
it: the game's own occlusion pass traced against its geometry (ambient
occlusion), the sun's and the lamps' shadows traced into the game's shadow
mask, the game's ambient light by how much sky each place sees, and one
bounce of light off the surfaces in view.

miojo-recomp is a fork of Hookshot with this work; Longshot is Hookshot's
continuation, so the work is backported onto it rather than merged in one
piece: miojo's upstream was at v2.3.1 (2026-11-15) and this is built on
the nightly of 2026-11-28, two weeks newer. The RT sources come from
miojo's tip, which had already been adapted to that upstream.

What the port needed:
- The Vulkan back end loads its shaders through builtin_spv (RX_VK_SHADER_DIR
  would not reach a compiled-in array used directly): the four RT shaders
  go through it now.
- dlss_prep.comp grew the ambient occlusion's push constants, so its SPIR-V
  is regenerated (glslang 11:16.6.0, the version the shipped headers carry),
  the packed variant (r11f_g11f_b10f) with it: the packed one is built from
  the same source and would have kept the old block.
- The rows moved into a module, gpu/vk/menu/raytracing.cpp, as the Insert
  menu's other rows are, with their keys in longshot_options.ini.
- hookshot_options.ini is longshot_options.ini here, and the row is read
  through options_path(), as the other rows are.
- The pipeline state the RT's passes bind is reset the way this back end
  resets it (bound().reset()).

The traced rows need Ray tracing on and a temporal upscaler (DLSS or DLAA)
running: without one there is no pass for them to happen in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #727 WIP: feat(vk): ray-traced ambient occlusion, sun shadows, global illumination and reflections — Open ray-tracing implementation of substantially the same effects; likely overlapping/conflicting renderer work.
  • PR #1151 WIP: feat(vk): ray tracing: lights from glowing materials, guide buffers and alpha in the rays without micromaps (on #727) — Open extension to #727’s ray-tracing work, shares implementation area and depends on it.
Possibly related, for context: - PR #727 WIP: feat(vk): ray-traced ambient occlusion, sun shadows, global illumination and reflections — Open ray-tracing implementation of substantially the same effects; likely overlapping/conflicting renderer work. - PR #1151 WIP: feat(vk): ray tracing: lights from glowing materials, guide buffers and alpha in the rays without micromaps (on #727) — Open extension to #727’s ray-tracing work, shares implementation area and depends on it.
Owner

Hi, thanks for the contribution. Do you have a source/license for this code?

Hi, thanks for the contribution. Do you have a source/license for this code?
The renderer headers were included inside namespace mkwvk, so their own
namespace mkwvk nested inside it: the module's calls to rt_on and
temporal_wanted were not found. The menu's checks compile every module
with a stand-in header, so they did not see it; the build did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The RT reads twenty-odd environment names (RX_VK_RT, its radii and its
why-switches, and the tests around it). They were not in the table, so the
renderer said each was "not a switch of this build": a name the code
reads and the table does not know is what that warning is for, and it
named the RT's own switches as strangers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dlss_prep.comp grew the ambient occlusion's terms (ao, proj), so its push
block is 104 bytes, not the 84 the passes declared. The LDR pass already
asked for 104; the HDR one, the linear one (the scene before the bloom)
and the packed one (the frame generation's inputs) still asked for 84, and
the frame generation's own struct had no room for the two terms.

The barrier before the ray tracing's pass is the full one again: it reads
the scene's colour and depth and writes over the picture, and the narrower
barrier left those writes unordered against the scene's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
feat(scripts): run-rt.ps1, the built game with the ray tracing
Some checks failed
PR description / Title and description (pull_request_target) Failing after 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
197e55122b
Launches build-windows\game with the RT's rows set in the profile's
settings.ini (the Ray tracing row is read as the device is made, so it
takes a restart), and the switches for the RT's own views: -Debug 1 for
the rays' picture in place of the scene, -AoDebug 1 for the ambient
occlusion alone. -Shots takes a screenshot every 60 presents, into a
folder named for the rows, so two runs can be compared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): the ray tracing's builds counted as other work
Some checks failed
PR description / Title and description (pull_request_target) Failing after 8s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
ce144ea392
The acceleration structure builds record into the command buffer through the
renderer's own loaded pointer, not through vk_work.h's macros, so the
recorder and the barrier logic did not see them: the hand-written
note_work() said what it counts is a draw pass's, which it is not, and the
two checks that hold the renderer to its own rules did not know the call.

note_other_work() is what a library's recording into the command buffer
takes (the next full_barrier is not left out), and the two checks know the
build now, as they know DLSS's, FSR 4's and XeSS's own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The new effects silently fail on devices with smaller push-constant limits. The change also needs fixes for unsafe buffer handling and unmentioned diagnostic file writes before its visual and performance costs can be assessed.

Adds experimental ray-traced lighting and screen-space ambient occlusion to the graphics menu. It adds substantial per-draw and per-frame renderer work, a Windows run script, diagnostic switches, and new shaders; no comparative gameplay measurements are supplied.

Blocking (2): must change before merging.

  1. L1 gpu/vk/vk_rt.cpp:1672: The bounce-light and local-light passes are silently disabled when the device exposes fewer than 240 bytes of push constants. (more on the line) Do: Move the larger constants into a buffer or otherwise fit the supported device limit, and make unsupported effects unavailable with a clear explanation.
  2. L2 gpu/vk/vk_rt.cpp:498: The vertex staging allocation does not include a position attribute that extends beyond the stride. (more on the line) Do: Validate the attribute range against the stride or allocate and read the full checked span, with overflow-safe arithmetic.

Should fix (3): not blocking, but worth doing before merging.

  • L3 gpu/vk/vk_draw.cpp:8765: The existing DLSS trace now writes guest uniform and storage buffers to files, an operation the pull request does not disclose. (more on the line) Do: Remove the buffer dumps from the ordinary trace, or make an explicitly documented diagnostic opt-in with a bounded destination and retention policy.
  • L4 gpu/vk/vk_rt.cpp:978: The frame marker is published before the two light-buffer addresses, without a coherent snapshot between threads. (more on the line) Do: Publish the addresses and frame together under the existing mutex, or use a properly synchronized snapshot with the frame published last.
  • L5: The pull request does not provide the required template sections, testing results, risks, checklist, or a Conventional Commit title. When: A maintainer cannot tell which hardware ran this head, what remains to test, or what the author checked before merging; the current title also becomes a nonconforming squash commit. Do: Complete the repository template for this head and give the pull request a Conventional Commit title.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L6: The feature's visual result and its cost with ray tracing on and off have not been demonstrated. When: The change adds scene capture, acceleration-structure builds and tracing, and changes the shared temporal preparation path, but provides no gameplay results or comparable frame-time and memory numbers. Do: Run the base and this head on the same scenes and settings with repeated interleaved runs; report FPS, 1% lows, frame times, RAM and VRAM with effects off and on, alongside screenshots of each effect. (@fix does its part first: Avoid collecting and building the ray-tracing scene when no traced effect can run.)
  • L7: The changed shared renderer paths and the new ray-query passes have no reported supported-platform coverage. When: The depth lifetime change runs for temporal and frame-generation inputs even with RT off, while RT adds device features and synchronization whose behavior can differ by driver. Do: Test gameplay and transitions on affected Tier 1 Windows and Linux NVIDIA and AMD systems and Steam Deck, including temporal upscaling and frame generation with RT off and supported RT effects on. (@fix does its part first: Keep the depth lifetime change separate from the RT feature so its platform coverage can be assessed independently.)

@fix can do L1, L2, L3, L4, L5, L6 and L7.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • What exact upstream revision and license or permission cover the imported code and any required notices?

Checks: Failing on this head, which is behind its base, where it passes: PR description / Title and description (pull_request_target). @rebase (or @fix) brings it up to date and runs it again; not held against it. Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven: no in-game result, screenshots, or before-and-after frame-time, FPS, RAM, or VRAM measurements are supplied for this head.

Other systems: The temporal preparation shader and depth lifetime checks also affect DLSS, DLAA, FSR 4, XeSS and frame-generation inputs with ray tracing off. The new passes depend on Vulkan ray-query features, push-constant limits, GPU synchronization and the lifetime of scene textures; no Windows, Linux, AMD, NVIDIA or Steam Deck runs are reported.

Switches: Adds RX_VK_RT, default off unless the saved row enables it; RX_VK_AO_DEBUG, RX_VK_DUMP_PROG, RX_VK_NO_AMBIENT, RX_VK_POKE, RX_VK_RT_AO_CONST, RX_VK_RT_AO_POST, RX_VK_RT_AO_WHY, RX_VK_RT_DEBUG, RX_VK_RT_FLIP, RX_VK_RT_LIGHT_LOG, RX_VK_RT_NO_MATERIALS and RX_VK_RT_WHY default off or unset. RX_VK_RT_AMBIENT_FAR defaults to 40, RX_VK_RT_BUILD_MS to 1, RX_VK_RT_LIGHT_K and RX_VK_RT_SUN_K to 1, RX_VK_RT_MODELS to 2048, RX_VK_RT_RADIUS to 1.5, RX_VK_RT_RAYS to 4, RX_VK_RT_REACH to 12 and RX_VK_RT_SKIN to 0.12. The table has entries, but no measurements justify the tuning defaults. The six new menu rows default to zero.

Reviewed: ce144ea392 against 22d0d20098: Read the repository rules, PR template and standards, commit messages, menu module, RT interface and shader sources, and the principal renderer changes and surrounding call paths. Skimmed the large RT implementation, generated SPIR-V headers, lockfile and changed tests; the full changed renderer files and all generated words were not read in full. No review checklist file was present at the requested path.; nothing run (a code review).

Checked and fine:

  • The new menu rows are in a module and their saved keys were added to the frozen key list.
  • The changed commits record AI assistance with co-author trailers.
  • The acceleration-structure build calls notify the recorder and barrier accounting.
  • The renderer API structure was not changed, so this diff does not require an API version bump.

Testing: No commands that build, execute project code, or run tests were used. The supplied CI checks are still running; the description check is reported as affected by the branch being behind its base.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The new effects silently fail on devices with smaller push-constant limits. The change also needs fixes for unsafe buffer handling and unmentioned diagnostic file writes before its visual and performance costs can be assessed. Adds experimental ray-traced lighting and screen-space ambient occlusion to the graphics menu. It adds substantial per-draw and per-frame renderer work, a Windows run script, diagnostic switches, and new shaders; no comparative gameplay measurements are supplied. **Blocking (2)**: must change before merging. 1. **L1** `gpu/vk/vk_rt.cpp:1672`: The bounce-light and local-light passes are silently disabled when the device exposes fewer than 240 bytes of push constants. (more on the line) **Do:** Move the larger constants into a buffer or otherwise fit the supported device limit, and make unsupported effects unavailable with a clear explanation. 2. **L2** `gpu/vk/vk_rt.cpp:498`: The vertex staging allocation does not include a position attribute that extends beyond the stride. (more on the line) **Do:** Validate the attribute range against the stride or allocate and read the full checked span, with overflow-safe arithmetic. **Should fix (3)**: not blocking, but worth doing before merging. - **L3** `gpu/vk/vk_draw.cpp:8765`: The existing DLSS trace now writes guest uniform and storage buffers to files, an operation the pull request does not disclose. (more on the line) **Do:** Remove the buffer dumps from the ordinary trace, or make an explicitly documented diagnostic opt-in with a bounded destination and retention policy. - **L4** `gpu/vk/vk_rt.cpp:978`: The frame marker is published before the two light-buffer addresses, without a coherent snapshot between threads. (more on the line) **Do:** Publish the addresses and frame together under the existing mutex, or use a properly synchronized snapshot with the frame published last. - **L5**: The pull request does not provide the required template sections, testing results, risks, checklist, or a Conventional Commit title. *When:* A maintainer cannot tell which hardware ran this head, what remains to test, or what the author checked before merging; the current title also becomes a nonconforming squash commit. **Do:** Complete the repository template for this head and give the pull request a Conventional Commit title. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L6**: The feature's visual result and its cost with ray tracing on and off have not been demonstrated. *When:* The change adds scene capture, acceleration-structure builds and tracing, and changes the shared temporal preparation path, but provides no gameplay results or comparable frame-time and memory numbers. **Do:** Run the base and this head on the same scenes and settings with repeated interleaved runs; report FPS, 1% lows, frame times, RAM and VRAM with effects off and on, alongside screenshots of each effect. *(`@fix` does its part first: Avoid collecting and building the ray-tracing scene when no traced effect can run.)* - **L7**: The changed shared renderer paths and the new ray-query passes have no reported supported-platform coverage. *When:* The depth lifetime change runs for temporal and frame-generation inputs even with RT off, while RT adds device features and synchronization whose behavior can differ by driver. **Do:** Test gameplay and transitions on affected Tier 1 Windows and Linux NVIDIA and AMD systems and Steam Deck, including temporal upscaling and frame generation with RT off and supported RT effects on. *(`@fix` does its part first: Keep the depth lifetime change separate from the RT feature so its platform coverage can be assessed independently.)* `@fix` can do L1, L2, L3, L4, L5, L6 and L7. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - What exact upstream revision and license or permission cover the imported code and any required notices? **Checks:** Failing on this head, which is behind its base, where it passes: `PR description / Title and description (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: no in-game result, screenshots, or before-and-after frame-time, FPS, RAM, or VRAM measurements are supplied for this head. **Other systems:** The temporal preparation shader and depth lifetime checks also affect DLSS, DLAA, FSR 4, XeSS and frame-generation inputs with ray tracing off. The new passes depend on Vulkan ray-query features, push-constant limits, GPU synchronization and the lifetime of scene textures; no Windows, Linux, AMD, NVIDIA or Steam Deck runs are reported. **Switches:** Adds RX_VK_RT, default off unless the saved row enables it; RX_VK_AO_DEBUG, RX_VK_DUMP_PROG, RX_VK_NO_AMBIENT, RX_VK_POKE, RX_VK_RT_AO_CONST, RX_VK_RT_AO_POST, RX_VK_RT_AO_WHY, RX_VK_RT_DEBUG, RX_VK_RT_FLIP, RX_VK_RT_LIGHT_LOG, RX_VK_RT_NO_MATERIALS and RX_VK_RT_WHY default off or unset. RX_VK_RT_AMBIENT_FAR defaults to 40, RX_VK_RT_BUILD_MS to 1, RX_VK_RT_LIGHT_K and RX_VK_RT_SUN_K to 1, RX_VK_RT_MODELS to 2048, RX_VK_RT_RADIUS to 1.5, RX_VK_RT_RAYS to 4, RX_VK_RT_REACH to 12 and RX_VK_RT_SKIN to 0.12. The table has entries, but no measurements justify the tuning defaults. The six new menu rows default to zero. **Reviewed:** ce144ea392f7 against 22d0d20098d6: Read the repository rules, PR template and standards, commit messages, menu module, RT interface and shader sources, and the principal renderer changes and surrounding call paths. Skimmed the large RT implementation, generated SPIR-V headers, lockfile and changed tests; the full changed renderer files and all generated words were not read in full. No review checklist file was present at the requested path.; nothing run (a code review). **Checked and fine:** - The new menu rows are in a module and their saved keys were added to the frozen key list. - The changed commits record AI assistance with co-author trailers. - The acceleration-structure build calls notify the recorder and barrier accounting. - The renderer API structure was not changed, so this diff does not require an API version bump. **Testing:** No commands that build, execute project code, or run tests were used. The supplied CI checks are still running; the description check is reported as affected by the branch being behind its base. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -8721,0 +8762,4 @@
const uint64_t size = s.ubo[1][u].size;
std::vector<uint8_t> all((size_t)size);
if (size < 512 || size > (1u << 20) || !memory_read_as_submitted(s.ubo[1][u].addr, all.data(), all.size())) continue;
char name[64];
Member

L3 (should fix): The existing DLSS trace now writes guest uniform and storage buffers to files, an operation the pull request does not disclose.

When: With RX_VK_DLSS_TRACE enabled, a matching draw writes ubo and ssbo binary files in the working directory even when RX_VK_DUMP_PROG is unset. These contain submitted game data, and repeated traced frames create more files.

Do: Remove the buffer dumps from the ordinary trace, or make an explicitly documented diagnostic opt-in with a bounded destination and retention policy.

**L3** (should fix): The existing DLSS trace now writes guest uniform and storage buffers to files, an operation the pull request does not disclose. *When:* With RX_VK_DLSS_TRACE enabled, a matching draw writes ubo and ssbo binary files in the working directory even when RX_VK_DUMP_PROG is unset. These contain submitted game data, and repeated traced frames create more files. **Do:** Remove the buffer dumps from the ordinary trace, or make an explicitly documented diagnostic opt-in with a bounded destination and retention policy.
@ -0,0 +495,4 @@
lo = 0;
} else {
if (lo < 0 || nv > 4000000 || (uint64_t)hi * d.stride + d.pos + psz > d.vsize) return false;
raw.resize((size_t)(nv * d.stride));
Member

L2 (blocking): The vertex staging allocation does not include a position attribute that extends beyond the stride.

When: For an indexed draw whose position offset plus its size exceeds the stride, the vsize check can pass because the bound vertex buffer includes the trailing bytes, but raw is allocated as nv * stride. The subsequent read and conversion access beyond that allocation for the final vertex.

Do: Validate the attribute range against the stride or allocate and read the full checked span, with overflow-safe arithmetic.

**L2** (blocking): The vertex staging allocation does not include a position attribute that extends beyond the stride. *When:* For an indexed draw whose position offset plus its size exceeds the stride, the vsize check can pass because the bound vertex buffer includes the trailing bytes, but raw is allocated as nv * stride. The subsequent read and conversion access beyond that allocation for the final vertex. **Do:** Validate the attribute range against the stride or allocate and read the full checked span, with overflow-safe arithmetic.
@ -0,0 +975,4 @@
void rt_note_local_lights(uint64_t lights, uint64_t frame_buffer) {
Rt& r = rt();
const uint64_t now = texture_frame_no();
Member

L4 (should fix): The frame marker is published before the two light-buffer addresses, without a coherent snapshot between threads.

When: If rt_frame observes the new local_frame after the exchange but before both address stores, it can read the previous frame's addresses, or one old and one new address, as the current light table and frame buffer.

Do: Publish the addresses and frame together under the existing mutex, or use a properly synchronized snapshot with the frame published last.

**L4** (should fix): The frame marker is published before the two light-buffer addresses, without a coherent snapshot between threads. *When:* If rt_frame observes the new local_frame after the exchange but before both address stores, it can read the previous frame's addresses, or one old and one new address, as the current light table and frame buffer. **Do:** Publish the addresses and frame together under the existing mutex, or use a properly synchronized snapshot with the frame published last.
@ -0,0 +1669,4 @@
float ao, radius, seed;
int32_t rays;
float gi, reach, skin;
float lights;
Member

L1 (blocking): The bounce-light and local-light passes are silently disabled when the device exposes fewer than 240 bytes of push constants.

When: On a ray-query-capable device with a 128-byte push-constant limit, the menu permits Bounce light and Light shadows, but rt_frame returns before either pass is dispatched.

Do: Move the larger constants into a buffer or otherwise fit the supported device limit, and make unsupported effects unavailable with a clear explanation.

**L1** (blocking): The bounce-light and local-light passes are silently disabled when the device exposes fewer than 240 bytes of push constants. *When:* On a ray-query-capable device with a 128-byte push-constant limit, the menu permits Bounce light and Light shadows, but rt_frame returns before either pass is dispatched. **Do:** Move the larger constants into a buffer or otherwise fit the supported device limit, and make unsupported effects unavailable with a clear explanation.
Member

Closing as carried by #2966 (HumanBean), which takes this PR's ray tracing (its lamp shadows included) onto current main through the mod API. If something here is not in #2966, a PR on top of it is welcome, with the licence question from 11-28 answered.

🤖 Generated with Claude Code

Closing as carried by #2966 (HumanBean), which takes this PR's ray tracing (its lamp shadows included) onto current main through the mod API. If something here is not in #2966, a PR on top of it is welcome, with the licence question from 11-28 answered. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
klimovich008 closed this pull request 2026-12-04 20:52:56 +00:00
Some checks failed
PR description / Title and description (pull_request_target) Failing after 8s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2755
No description provided.