From 0c31b5a82428f7b2462956a70b1e8348d30da3c9 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Mon, 23 Jun 2025 15:57:12 +0100 Subject: [PATCH 1/2] force unclipped depth emu on webgpu --- crates/bevy_pbr/src/prepass/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 35182910a9cc8..c1e2b6af8cabb 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -346,7 +346,10 @@ impl FromWorld for PrepassPipeline { let depth_clip_control_supported = render_device .features() - .contains(WgpuFeatures::DEPTH_CLIP_CONTROL); + .contains(WgpuFeatures::DEPTH_CLIP_CONTROL) + // force unclipped depth emnulation on webgpu as unclipped depth support + // may be declared but is not actually supported + && cfg!(not(all(feature = "webgpu", target_arch = "wasm32"))); let internal = PrepassPipelineInternal { view_layout_motion_vectors, view_layout_no_motion_vectors, From b7525b6c033eeead07813d8fe61d0e1061a78ea3 Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:54:03 +0100 Subject: [PATCH 2/2] Update crates/bevy_pbr/src/prepass/mod.rs Co-authored-by: Joona Aalto --- crates/bevy_pbr/src/prepass/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index c1e2b6af8cabb..d6c811b62b23f 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -347,7 +347,7 @@ impl FromWorld for PrepassPipeline { let depth_clip_control_supported = render_device .features() .contains(WgpuFeatures::DEPTH_CLIP_CONTROL) - // force unclipped depth emnulation on webgpu as unclipped depth support + // force unclipped depth emulation on webgpu as unclipped depth support // may be declared but is not actually supported && cfg!(not(all(feature = "webgpu", target_arch = "wasm32"))); let internal = PrepassPipelineInternal {