Expand description
The device backends. The proprietary, hardware-facing renderers - Metal
(macOS), DirectX 12 (Windows), Vulkan (Windows/Linux) - plus the shared native
Win32 window/input layer. Exactly one backend compiles per build (resolved by
build.rs into a single backend_* cfg). Depends on concinnity-core, whose
render module holds the RenderBackend/SceneControl trait seam these
implement plus the render-prep feeding it; owns no gameplay, ECS-runtime,
audio, or physics. The client drives these through a
Box<dyn RenderBackend> obtained from init_backend, never naming a concrete
context type.
Modules§
- precompile
- Export-time compilation of the engine’s built-in shaders. The DirectX and
Vulkan backends declare their compile set as static data (each backend’s
builtins.rs); this module iterates those declarations and makes sure every
enumerable variant’s artifact exists in a bundle’s shader-cache/ directory.
Compilation is pure CPU (FXC / DXC / shaderc need no GPU device), so this
runs inside
cn exportwith no window, no adapter, and no child process. Renderer init compiles through the same declarations and the same cache keys, so a shipped bundle’s first launch reuses every artifact written here; anything not enumerable (a world-authored SdfVolume fragment, an unusual runtime parameter) still compiles at init exactly as before.
Functions§
- init_
backend - Route the assembled
BackendInitto the backend selected at compile time. Construction inputs are documented onBackendInititself. - probe_
gpu_ profile - Probe a cheap throwaway device handle to classify the GPU, so the auto-config quality ceiling can influence the render targets / effect pipelines the backend sizes at init. Each backend creates only the cheap handle it needs and classifies it: Metal the default-device handle, DirectX the DXGI adapter (no device / swapchain), Vulkan a surface-free instance (destroyed immediately).