forked from 1b-agent/opencadstudio-upstream
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
This commit is contained in:
1 parent
7c818d15e9
commit
97a6322e2a
2 files changed
+3
-7
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user