Skip to main content

Module dev_flags

Module dev_flags 

Source
Expand description

Process-wide flags shared between the engine loop (library) and the binary-only cn debug subsystem. Only the flags the library itself names live here; the world.jsonl / shader-stage “changed” flags and the decal / emitter spawn queue moved fully into the binary-only debug tree (crate::debug), since nothing in the library references them.

ENABLED “are we running under a dev-loop entry point?” Set once by main.rs’s Commands::Debug / Commands::Editor arms before world build; read by GraphicsSystem::init / AnimationSystem / the draw list builder to enable disk-first shader loading + the hot-reload source capture. cn run leaves it false so production keeps the static include_str!-baked path with no filesystem dependency. PENDING_ANIMATIONS “an Animation source changed.” Set by the cn debug watcher / WS reload-assets handler; consumed by the editor crate’s anim_reload::reload_clips_if_pending, which the debug drive calls each frame to re-import file-backed clips. The flag lives here (in the runtime crate) because it bridges the runtime AnimationSystem, which reads ENABLED, and the editor-driven hot-reload. VALIDATION “did the launch request graphics validation?” Set by the CLI --validation flag (cn run / cn debug). Tri-state: unset defers to the build profile (on for debug, off for release). resolve_validation settles the two, and GraphicsSystem::init enables the DirectX / Vulkan debug layers from the result. Metal’s validation layer cannot be toggled from a running process, so the CLI re-execs with the env var instead; this flag does not drive Metal. QUALITY_PRESET “did the launch force a master quality preset?” Set by the CLI --quality-preset flag. Outranks the persisted settings-menu choice at GraphicsSystem::init and is never written back, so a probe / CI run can force a preset (e.g. ultra, the only tier whose ceiling permits ray-traced reflections) without touching settings.bin. Unset leaves the persisted choice. RT_DYNAMIC “how should the ray-tracing acceleration structure track moving props?” Set by the CLI --rt-dynamic flag; travels to the backends through PostSettings::rt_dynamic. Unset resolves to Auto, the shipping dirty-gated rebuild. RT_SKINNED_GEOMETRY “may skinned meshes join the ray-tracing acceleration structure?” Set by the CLI --rt-skinned-geometry flag; travels to the backends through PostSettings::rt_skinned_geometry. Unset leaves them in, so clearing it isolates the skinned trace path. WORLD_JSONL_PATH the world.jsonl the dev host is running. Set by the editor’s cn debug / cn editor entry once the world path is resolved; read by GraphicsSystem::init (only under ENABLED) so the Prop-transform hot-reload watcher knows which file to subscribe to. world.jsonl discovery is authoring I/O that lives in concinnity-cook, which the runtime does not link, so the dev host resolves the path and hands it in rather than the engine looking it up. Left None for cn run and embedded preview.

A static is the pragmatic shape here: the flags are process-wide because the rendering backend is too (a single context per process owns the GPU), and plumbing them through the public App / run_interpreted signatures would touch far more code for the same observable behaviour.

Enums§

QualityPreset
Persisted master graphics-quality choice. Auto resolves from the detected GPU tier each launch; a named tier (Low..Ultra) is a fixed ceiling; Custom imposes no ceiling (the user’s per-row overrides drive). In GraphicsSettings a None (never persisted) means “never configured”: the first launch seeds Auto and saves once.
RtDynamicMode
How the scene acceleration structure is kept current when props move. Selected once at init from the launch’s --rt-dynamic request; Auto is the shipping behaviour and what an unset request resolves to.

Functions§

set_enabled
Mark this process as running under a dev-loop entry point. Call once before world build; the library only reads the flag.
set_pending_animations
Raise the “Animation source changed” flag. Called by the asset hot-reload watcher and the WS reload-assets handler; the library only reads it.
set_quality_preset
Record the CLI --quality-preset request. None leaves the persisted settings-menu choice in effect. The library only reads it.
set_rt_dynamic
Record the CLI --rt-dynamic request. None leaves the default Auto update mode in effect. The library only reads it.
set_rt_skinned_geometry
Record the CLI --rt-skinned-geometry request. None leaves skinned meshes in the acceleration structure. The library only reads it.
set_validation
Record the CLI --validation request. None leaves the build-profile default in effect; Some forces validation on or off. The library only reads it.
set_world_jsonl_path
Record the world.jsonl path the dev host resolved, so the hot-reload watcher can subscribe to it. Called by the editor’s cn debug / cn editor entry before world build; the library only reads it.
take_pending_animations
Swap the “Animation source changed” flag to false, returning whether it was set. The editor crate’s anim_reload::reload_clips_if_pending calls this; a true result kicks the per-clip re-import pass.