1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
use graphics_core::GpuContext; use std::sync::OnceLock; static SHARED_GPU: OnceLock<Option<GpuContext>> = OnceLock::new(); pub fn try_shared_gpu() -> Option<&'static GpuContext> { SHARED_GPU .get_or_init(|| { pollster::block_on(GpuContext::new_headless_for_platform( wgpu::PowerPreference::LowPower, )) .ok() }) .as_ref() } pub fn shared_gpu() -> &'static GpuContext { try_shared_gpu().expect("headless WGPU adapter required for graphics-core integration tests") } mod depth_peeling; mod pipelines; mod targets_readback;