From 8fc56c9a0fed4e407dd538845b5b04183f03241e Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Wed, 21 Jun 2023 14:44:49 -0700 Subject: [PATCH] Add PERF comment --- crates/bevy_pbr/src/prepass/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index cc5727405f0b4..d704c5a1c628d 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -385,6 +385,12 @@ where )); if key.mesh_key.contains(MeshPipelineKey::DEPTH_CLAMP_ORTHO) { shader_defs.push("DEPTH_CLAMP_ORTHO".into()); + // PERF: This line forces the "prepass fragment shader" to always run in + // common scenarios like "directional light calculation". Doing so resolves + // a pretty nasty depth clamping bug, but it also feels a bit excessive. + // We should try to find a way to resolve this without forcing the fragment + // shader to run. + // https://github.com/bevyengine/bevy/pull/8877 shader_defs.push("PREPASS_FRAGMENT".into()); }