From 97a6322e2aade1e23f8ee74188f71902469899cb Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Tue, 18 Aug 2026 22:35:39 +0300 Subject: [PATCH] fix(web): use compatibility renderer Chromium can advertise WebGPU limits that its shader path does not reliably support. Keep web builds on the packed/texture pipelines.\n\nRefs #788 --- src/scene/pipeline/device_capabilities.rs | 4 +--- src/scene/pipeline/mod.rs | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/scene/pipeline/device_capabilities.rs b/src/scene/pipeline/device_capabilities.rs index c87cc6113..3f41b0964 100644 --- a/src/scene/pipeline/device_capabilities.rs +++ b/src/scene/pipeline/device_capabilities.rs @@ -2,9 +2,7 @@ use iced::wgpu; /// Renderer-relevant limits of the selected GPU device. /// -/// Capabilities, not the compilation target, choose the renderer tier. Browser -/// WebGPU and native Vulkan/Metal/DX12 can therefore share storage-backed -/// pipelines, while WebGL2 and weak native adapters use compatibility paths. +/// Native devices select by limits; browser builds use compatibility paths. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct DeviceCapabilities { pub max_storage_buffers_per_shader_stage: u32, diff --git a/src/scene/pipeline/mod.rs b/src/scene/pipeline/mod.rs index c8ab2030c..c1c3dba10 100644 --- a/src/scene/pipeline/mod.rs +++ b/src/scene/pipeline/mod.rs @@ -560,14 +560,12 @@ impl Pipeline { ); // ── Wire pipeline ────────────────────────────────────────────────── - // Select once from actual device limits. Any device whose compositor - // exposes the required storage limits uses the storage renderer; all - // other devices use the packed/texture compatibility renderer. + // Browser shader support can lag behind advertised WebGPU limits. let device_caps = DeviceCapabilities::detect(device); #[cfg(not(target_arch = "wasm32"))] let force_compat_renderer = crate::cli::gui_config().compat_renderer; #[cfg(target_arch = "wasm32")] - let force_compat_renderer = false; + let force_compat_renderer = true; let wire_mode = wire_gpu::WirePipelineMode::select(device_caps, force_compat_renderer); let wire_const_bgl = wire_mode