From f595fb8b7710cef4f4662b8a551e16bbdb9c87b2 Mon Sep 17 00:00:00 2001 From: Anders Arnholm Date: Wed, 8 Jan 2025 14:46:21 +0100 Subject: [PATCH] Apply fix for macOS crash in multiple_worlds example By doing the same fix as in commit fba3520 in multiple_worlds.rs, we avoid the issue with a crash for bevy 0.15 on macOS. --- examples/multiple_worlds.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/multiple_worlds.rs b/examples/multiple_worlds.rs index 41b4a00..483c85d 100644 --- a/examples/multiple_worlds.rs +++ b/examples/multiple_worlds.rs @@ -6,7 +6,7 @@ use bevy::{ render::{ mesh::MeshVertexBufferLayoutRef, render_resource::{ - AsBindGroup, RenderPipelineDescriptor, ShaderRef, SpecializedMeshPipelineError, + AsBindGroup, RenderPipelineDescriptor, ShaderDefVal, ShaderRef, SpecializedMeshPipelineError, }, }, utils::HashMap, @@ -189,6 +189,14 @@ impl Material for CustomVoxelMaterial { layout: &MeshVertexBufferLayoutRef, _key: MaterialPipelineKey, ) -> Result<(), SpecializedMeshPipelineError> { + if descriptor + .vertex + .shader_defs + .contains(&ShaderDefVal::Bool("PREPASS_PIPELINE".into(), true)) + { + return Ok(()); + } + // Use `vertex_layout()` from `bevy_voxel_world` to get the correct vertex layout let vertex_layout = layout.0.get_layout(&vertex_layout())?; descriptor.vertex.buffers = vec![vertex_layout];