diff --git a/crates/bevy_pbr/src/material.rs b/crates/bevy_pbr/src/material.rs index c1618917ab..32cc445d42 100644 --- a/crates/bevy_pbr/src/material.rs +++ b/crates/bevy_pbr/src/material.rs @@ -314,9 +314,10 @@ where Render, ( specialize_material_meshes:: - .in_set(RenderSet::PrepareAssets) + .in_set(RenderSet::PrepareMeshes) .after(prepare_assets::>) - .after(prepare_assets::), + .after(prepare_assets::) + .after(collect_meshes_for_gpu_building), queue_material_meshes:: .in_set(RenderSet::QueueMeshes) .after(prepare_assets::>), @@ -339,7 +340,7 @@ where ( check_views_lights_need_specialization.in_set(RenderSet::PrepareAssets), specialize_shadows:: - .in_set(RenderSet::PrepareAssets) + .in_set(RenderSet::PrepareMeshes) .after(prepare_assets::>), queue_shadows:: .in_set(RenderSet::QueueMeshes) diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 337234480d..d1cb99e502 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -2,12 +2,12 @@ mod prepass_bindings; use crate::{ alpha_mode_pipeline_key, binding_arrays_are_usable, buffer_layout, - material_bind_groups::MaterialBindGroupAllocator, queue_material_meshes, - setup_morph_and_skinning_defs, skin, DrawMesh, EntitySpecializationTicks, Material, - MaterialPipeline, MaterialPipelineKey, MeshLayouts, MeshPipeline, MeshPipelineKey, - OpaqueRendererMethod, PreparedMaterial, RenderLightmaps, RenderMaterialInstances, - RenderMeshInstanceFlags, RenderMeshInstances, RenderPhaseType, SetMaterialBindGroup, - SetMeshBindGroup, ShadowView, StandardMaterial, + collect_meshes_for_gpu_building, material_bind_groups::MaterialBindGroupAllocator, + queue_material_meshes, setup_morph_and_skinning_defs, skin, DrawMesh, + EntitySpecializationTicks, Material, MaterialPipeline, MaterialPipelineKey, MeshLayouts, + MeshPipeline, MeshPipelineKey, OpaqueRendererMethod, PreparedMaterial, RenderLightmaps, + RenderMaterialInstances, RenderMeshInstanceFlags, RenderMeshInstances, RenderPhaseType, + SetMaterialBindGroup, SetMeshBindGroup, ShadowView, StandardMaterial, }; use bevy_app::{App, Plugin, PreUpdate}; use bevy_render::{ @@ -61,7 +61,7 @@ use bevy_ecs::system::SystemChangeTick; use bevy_platform_support::collections::HashMap; use bevy_render::sync_world::{MainEntity, MainEntityHashMap}; use bevy_render::view::RenderVisibleEntities; -use bevy_render::RenderSet::PrepareAssets; +use bevy_render::RenderSet::{PrepareAssets, PrepareResources}; use core::{hash::Hash, marker::PhantomData}; pub const PREPASS_SHADER_HANDLE: Handle = @@ -190,7 +190,7 @@ where .add_systems(ExtractSchedule, extract_camera_previous_view_data) .add_systems( Render, - prepare_previous_view_uniforms.in_set(RenderSet::PrepareResources), + prepare_previous_view_uniforms.in_set(PrepareResources), ); } @@ -207,9 +207,10 @@ where ( check_prepass_views_need_specialization.in_set(PrepareAssets), specialize_prepass_material_meshes:: - .in_set(PrepareAssets) + .in_set(RenderSet::PrepareMeshes) .after(prepare_assets::>) - .after(prepare_assets::), + .after(prepare_assets::) + .after(collect_meshes_for_gpu_building), queue_prepass_material_meshes:: .in_set(RenderSet::QueueMeshes) .after(prepare_assets::>) diff --git a/crates/bevy_sprite/src/mesh2d/material.rs b/crates/bevy_sprite/src/mesh2d/material.rs index 4b5935ca5b..7593b3d85e 100644 --- a/crates/bevy_sprite/src/mesh2d/material.rs +++ b/crates/bevy_sprite/src/mesh2d/material.rs @@ -287,7 +287,7 @@ where Render, ( specialize_material2d_meshes:: - .in_set(RenderSet::PrepareAssets) + .in_set(RenderSet::PrepareMeshes) .after(prepare_assets::>) .after(prepare_assets::), queue_material2d_meshes::