Add after dependencies for all systems that use Mesh2dPipeline in RenderStartup.

This commit is contained in:
andriyDev 2025-07-14 00:32:35 -07:00
parent 306f0812b0
commit f9c67f4de7
4 changed files with 25 additions and 11 deletions

View File

@ -27,7 +27,9 @@ use bevy_render::{
Render, RenderApp, RenderSystems,
};
use bevy_render::{sync_world::MainEntity, RenderStartup};
use bevy_sprite::{Mesh2dPipeline, Mesh2dPipelineKey, SetMesh2dViewBindGroup};
use bevy_sprite::{
init_mesh_2d_pipeline, Mesh2dPipeline, Mesh2dPipelineKey, SetMesh2dViewBindGroup,
};
use bevy_utils::default;
use tracing::error;
@ -56,7 +58,9 @@ impl Plugin for LineGizmo2dPlugin {
)
.add_systems(
RenderStartup,
init_line_gizmo_pipelines.after(init_line_gizmo_uniform_bind_group_layout),
init_line_gizmo_pipelines
.after(init_line_gizmo_uniform_bind_group_layout)
.after(init_mesh_2d_pipeline),
)
.add_systems(
Render,

View File

@ -1,6 +1,7 @@
use crate::{
DrawMesh2d, Mesh2d, Mesh2dPipeline, Mesh2dPipelineKey, RenderMesh2dInstances,
SetMesh2dBindGroup, SetMesh2dViewBindGroup, ViewKeyCache, ViewSpecializationTicks,
init_mesh_2d_pipeline, DrawMesh2d, Mesh2d, Mesh2dPipeline, Mesh2dPipelineKey,
RenderMesh2dInstances, SetMesh2dBindGroup, SetMesh2dViewBindGroup, ViewKeyCache,
ViewSpecializationTicks,
};
use bevy_app::{App, Plugin, PostUpdate};
use bevy_asset::prelude::AssetChanged;
@ -286,7 +287,10 @@ where
.add_render_command::<Transparent2d, DrawMaterial2d<M>>()
.init_resource::<RenderMaterial2dInstances<M>>()
.init_resource::<SpecializedMeshPipelines<Material2dPipeline<M>>>()
.add_systems(RenderStartup, init_material_2d_pipeline::<M>)
.add_systems(
RenderStartup,
init_material_2d_pipeline::<M>.after(init_mesh_2d_pipeline),
)
.add_systems(
ExtractSchedule,
(

View File

@ -1,6 +1,6 @@
use crate::{
DrawMesh2d, Mesh2dPipeline, Mesh2dPipelineKey, RenderMesh2dInstances, SetMesh2dBindGroup,
SetMesh2dViewBindGroup, ViewKeyCache, ViewSpecializationTicks,
init_mesh_2d_pipeline, DrawMesh2d, Mesh2dPipeline, Mesh2dPipelineKey, RenderMesh2dInstances,
SetMesh2dBindGroup, SetMesh2dViewBindGroup, ViewKeyCache, ViewSpecializationTicks,
};
use bevy_app::{App, Plugin, PostUpdate, Startup, Update};
use bevy_asset::{
@ -129,7 +129,10 @@ impl Plugin for Wireframe2dPlugin {
Node2d::PostProcessing,
),
)
.add_systems(RenderStartup, init_wireframe_2d_pipeline)
.add_systems(
RenderStartup,
init_wireframe_2d_pipeline.after(init_mesh_2d_pipeline),
)
.add_systems(
ExtractSchedule,
(

View File

@ -30,8 +30,8 @@ use bevy::{
Extract, Render, RenderApp, RenderStartup, RenderSystems,
},
sprite::{
extract_mesh2d, DrawMesh2d, Material2dBindGroupId, Mesh2dPipeline, Mesh2dPipelineKey,
Mesh2dTransforms, MeshFlags, RenderMesh2dInstance, SetMesh2dBindGroup,
extract_mesh2d, init_mesh_2d_pipeline, DrawMesh2d, Material2dBindGroupId, Mesh2dPipeline,
Mesh2dPipelineKey, Mesh2dTransforms, MeshFlags, RenderMesh2dInstance, SetMesh2dBindGroup,
SetMesh2dViewBindGroup,
},
};
@ -309,7 +309,10 @@ impl Plugin for ColoredMesh2dPlugin {
.add_render_command::<Transparent2d, DrawColoredMesh2d>()
.init_resource::<SpecializedRenderPipelines<ColoredMesh2dPipeline>>()
.init_resource::<RenderColoredMesh2dInstances>()
.add_systems(RenderStartup, init_colored_mesh_2d_pipeline)
.add_systems(
RenderStartup,
init_colored_mesh_2d_pipeline.after(init_mesh_2d_pipeline),
)
.add_systems(
ExtractSchedule,
extract_colored_mesh2d.after(extract_mesh2d),