mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Fix MeshletMesh material system ordering (#14016)
# Objective - Fixes #13811 (probably, I lost my test code...) ## Solution - Turns out that Queue and PrepareAssets are _not_ ordered. We should probably either rethink our system sets (again), or improve the documentation here. For reference, I've included the current ordering below. - The `prepare_meshlet_meshes_X` systems need to run after `prepare_assets::<PreparedMaterial<M>>`, and have also been moved to QueueMeshes. ```rust schedule.configure_sets( ( ExtractCommands, ManageViews, Queue, PhaseSort, Prepare, Render, Cleanup, ) .chain(), ); schedule.configure_sets((ExtractCommands, PrepareAssets, Prepare).chain()); schedule.configure_sets(QueueMeshes.in_set(Queue).after(prepare_assets::<GpuMesh>)); schedule.configure_sets( (PrepareResources, PrepareResourcesFlush, PrepareBindGroups) .chain() .in_set(Prepare), ); ``` ## Testing - Ambiguity checker to make sure I don't have ambiguous system ordering
This commit is contained in:
parent
52e5ad5da7
commit
d8b45ca136
2 changed files with 14 additions and 7 deletions
|
@ -282,12 +282,18 @@ where
|
|||
#[cfg(feature = "meshlet")]
|
||||
render_app.add_systems(
|
||||
Render,
|
||||
(
|
||||
prepare_material_meshlet_meshes_main_opaque_pass::<M>,
|
||||
queue_material_meshlet_meshes::<M>,
|
||||
)
|
||||
.chain()
|
||||
.in_set(RenderSet::Queue)
|
||||
queue_material_meshlet_meshes::<M>
|
||||
.in_set(RenderSet::QueueMeshes)
|
||||
.run_if(resource_exists::<MeshletGpuScene>),
|
||||
);
|
||||
|
||||
#[cfg(feature = "meshlet")]
|
||||
render_app.add_systems(
|
||||
Render,
|
||||
prepare_material_meshlet_meshes_main_opaque_pass::<M>
|
||||
.in_set(RenderSet::QueueMeshes)
|
||||
.after(prepare_assets::<PreparedMaterial<M>>)
|
||||
.before(queue_material_meshlet_meshes::<M>)
|
||||
.run_if(resource_exists::<MeshletGpuScene>),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -184,7 +184,8 @@ where
|
|||
render_app.add_systems(
|
||||
Render,
|
||||
prepare_material_meshlet_meshes_prepass::<M>
|
||||
.in_set(RenderSet::Queue)
|
||||
.in_set(RenderSet::QueueMeshes)
|
||||
.after(prepare_assets::<PreparedMaterial<M>>)
|
||||
.before(queue_material_meshlet_meshes::<M>)
|
||||
.run_if(resource_exists::<MeshletGpuScene>),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue