From a9964f442d5eac72be90e3810a68225e5da9e622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Fri, 5 Apr 2024 19:50:23 +0200 Subject: [PATCH] fix msaa shift with irradiance volumes in mesh pipeline key (#12845) # Objective - #12791 broke example `irradiance_volumes` - Fixes #12876 ``` wgpu error: Validation Error Caused by: In Device::create_render_pipeline note: label = `pbr_opaque_mesh_pipeline` Color state [0] is invalid Sample count 8 is not supported by format Rgba8UnormSrgb on this device. The WebGPU spec guarentees [1, 4] samples are supported by this format. With the TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES feature your device supports [1, 2, 4]. ``` ## Solution - Shift bits a bit more --- crates/bevy_pbr/src/render/mesh.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_pbr/src/render/mesh.rs b/crates/bevy_pbr/src/render/mesh.rs index 6ba0bf5528d71..8319b30b68a96 100644 --- a/crates/bevy_pbr/src/render/mesh.rs +++ b/crates/bevy_pbr/src/render/mesh.rs @@ -576,7 +576,7 @@ bitflags::bitflags! { impl MeshPipelineKey { const MSAA_MASK_BITS: u32 = 0b111; - const MSAA_SHIFT_BITS: u32 = Self::LAST_FLAG.bits().trailing_zeros(); + const MSAA_SHIFT_BITS: u32 = Self::LAST_FLAG.bits().trailing_zeros() + 1; const BLEND_MASK_BITS: u32 = 0b11; const BLEND_SHIFT_BITS: u32 = Self::MSAA_MASK_BITS.count_ones() + Self::MSAA_SHIFT_BITS;