[enhancement] Switch helpers in darner-core, so every crate reads DARNER_* switches one way #398
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What you would like
AGENTS.md says to read switches only through
toggled!(on unless0) andasked_for!(on only at1) incrates/darner-gpu/src/switch.rs. Onmainf3840d73, about 300 reads outside darner-gpu go to the environment directly, with at least three meanings of "on" (counts are approximate):darner_gpu::asked_for!("DARNER_WHEEL_HOLD"),gameinput.rs:2750).What that causes, read from the code:
DARNER_STRICT_JOINSandDARNER_MESH_OUTPUT_STRICTare read with.is_some(), while the README documents them as1 = on. So=0turns them on, and because both are in the shader cache key, it also re-translates every shader.DARNER_SOFT_VIEWSis parsed two different ways insidexmem.rs(:3982and:4972).Proposal:
darner_core::switch), and re-export them from darner-gpu, so none of its call sites change. One thing to keep in mind: thediagnostics/abcfgs inside the macros are evaluated in the calling crate, soDARNER_ABswitching works only where that crate has those features (darner-shader, darner-loader and darner-core havediagnosticsbut noab).Is that the direction you want before anyone starts, or would you rather keep the direct reads?
Checked with AI assistance (Claude Code).
Are you working on a fix?
I'd like to, with some pointers