Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fix for macOS crash in multiple_worlds example #49

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion examples/multiple_worlds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bevy::{
render::{
mesh::MeshVertexBufferLayoutRef,
render_resource::{
AsBindGroup, RenderPipelineDescriptor, ShaderRef, SpecializedMeshPipelineError,
AsBindGroup, RenderPipelineDescriptor, ShaderDefVal, ShaderRef, SpecializedMeshPipelineError,
},
},
utils::HashMap,
Expand Down Expand Up @@ -189,6 +189,14 @@ impl Material for CustomVoxelMaterial {
layout: &MeshVertexBufferLayoutRef,
_key: MaterialPipelineKey<Self>,
) -> 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];
Expand Down
Loading