fix(gpu): find target\shader-replace from target\release\larp.exe #586
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/gamingwithhomie--larp!586
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-586"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@eipastel on GitHub · 2026-12-06 03:21 UTC · original
eipastel:fix/shader-replace-build-folder→main· +40 −7 · 1 files · 1 commits · openFixes #585.
Related: #584 documents setting
LARP_SHADER_REPLACEtotarget\shader-replacefor source builds, which this PR makes unnecessary; whichever merges second, I'll update #584 to match.Root cause
folder()(crates/larp-gpu/src/shader_replace.rs) tried<exe folder>\shader-replaceand<exe folder>\..\..\shader-replace. Two levels up from the exe istargetonly forcargo build --target ...(target\<target>\<profile>\larp.exe). The documentedcargo build --release -p larpwritestarget\release\larp.exe, so two levels up is the repo root andtarget\shader-replace, wherebuild.rswrites the compiled replacements, was never tried:larp runstopped withno replacement shadersunlessLARP_SHADER_REPLACEwas set.Change
Also try
<exe folder>\..\shader-replace, between the two. The order is otherwise unchanged, so a distribution'sbin\shader-replacestill wins and--targetbuilds still find theirs. The candidate list moved intolooked_for, with a unit test for both build layouts; module and function docs updated.How it was tested
cargo test -p larp-gpu: 32 passed, 7 ignored (includes the newshader_replace::tests::looks_in_target_shader_replace_from_a_plain_cargo_build).cargo clippy -p larp-gpu: no warning in the changed lines (the crate has 47 existing warnings).cargo fmt:rustfmt --checkshows no diff in the changed lines. I did not runcargo fmton the crate: onmainit rewrites 107 files oflarp-gpu.cargo build --release -p larp, thentarget\release\larp.exe run "<game>" --execute --console series-swithLARP_SHADER_REPLACEunset, on Windows 11 build 26300 / RTX 5060: before,Error: no replacement shaders: none of these folders exists: ...\target\release\shader-replace, ...\shader-replace; after,shader replacements: folder read folder=...\target\shader-replace usable=85 with_structure_views=64 with_interface=5 refused=0. I ran it to the menu (60 s), not into the world.Larp\bin\larp.exe) or a--targetbuild in a real run (covered by the unit test only).Written with AI assistance (Claude Code).
@wagney on GitHub · 2026-12-06 03:39 UTC · original · reviewed
Reviewed \crates/larp-gpu/src/shader_replace.rs. Checking \t.parent()\ between the executable's own folder and ..\..\shader-replace\ cleanly covers \ arget\\larp.exe\ while preserving distribution and --target\ layouts, and \looks_in_target_shader_replace_from_a_plain_cargo_build\ verifies both paths.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.