mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-22 11:42:57 -05:00
GpuContext::request() now applies InstanceDescriptor::with_env() (WGPU_BACKEND, WGPU_DX12_COMPILER, WGPU_VALIDATION, WGPU_DEBUG, ...), the same variables the desktop app honours via egui-wgpu, and requests PowerPreference::from_env(), defaulting to HighPerformance (an unknown WGPU_POWER_PREF logs a warning). WGPU_ADAPTER_NAME (CLI/headless only; the desktop ignores it) picks the first adapter whose name contains the trimmed value, case-insensitively. Empty or blank counts as unset. Only the name is matched (backend via WGPU_BACKEND). A non-matching name is an error that says so and lists each distinct adapter once as 'name (backend)', instead of wgpu::util::initialize_adapter_from_env's panic; no adapters at all gets its own message.