File tree Expand file tree Collapse file tree 4 files changed +15
-18
lines changed Expand file tree Collapse file tree 4 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -863,6 +863,9 @@ pub fn specialize_material_meshes<M: Material>(
863863 . or_default ( ) ;
864864
865865 for ( _, visible_entity) in visible_entities. iter :: < Mesh3d > ( ) {
866+ let Some ( material_asset_id) = render_material_instances. get ( visible_entity) else {
867+ continue ;
868+ } ;
866869 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
867870 let last_specialized_tick = view_specialized_material_pipeline_cache
868871 . get ( visible_entity)
@@ -874,9 +877,6 @@ pub fn specialize_material_meshes<M: Material>(
874877 if !needs_specialization {
875878 continue ;
876879 }
877- let Some ( material_asset_id) = render_material_instances. get ( visible_entity) else {
878- continue ;
879- } ;
880880 let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
881881 else {
882882 continue ;
Original file line number Diff line number Diff line change @@ -962,6 +962,9 @@ pub fn specialize_prepass_material_meshes<M>(
962962 . or_default ( ) ;
963963
964964 for ( _, visible_entity) in visible_entities. iter :: < Mesh3d > ( ) {
965+ let Some ( material_asset_id) = render_material_instances. get ( visible_entity) else {
966+ continue ;
967+ } ;
965968 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
966969 let last_specialized_tick = view_specialized_material_pipeline_cache
967970 . get ( visible_entity)
@@ -973,10 +976,6 @@ pub fn specialize_prepass_material_meshes<M>(
973976 if !needs_specialization {
974977 continue ;
975978 }
976-
977- let Some ( material_asset_id) = render_material_instances. get ( visible_entity) else {
978- continue ;
979- } ;
980979 let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
981980 else {
982981 continue ;
Original file line number Diff line number Diff line change @@ -1809,6 +1809,9 @@ pub fn specialize_shadows<M: Material>(
18091809 . or_default ( ) ;
18101810
18111811 for ( _, visible_entity) in visible_entities. iter ( ) . copied ( ) {
1812+ let Some ( material_asset_id) = render_material_instances. get ( & visible_entity) else {
1813+ continue ;
1814+ } ;
18121815 let entity_tick = entity_specialization_ticks. get ( & visible_entity) . unwrap ( ) ;
18131816 let last_specialized_tick = view_specialized_material_pipeline_cache
18141817 . get ( & visible_entity)
@@ -1820,7 +1823,9 @@ pub fn specialize_shadows<M: Material>(
18201823 if !needs_specialization {
18211824 continue ;
18221825 }
1823-
1826+ let Some ( material) = render_materials. get ( * material_asset_id) else {
1827+ continue ;
1828+ } ;
18241829 let Some ( mesh_instance) =
18251830 render_mesh_instances. render_mesh_queue_data ( visible_entity)
18261831 else {
@@ -1832,12 +1837,6 @@ pub fn specialize_shadows<M: Material>(
18321837 {
18331838 continue ;
18341839 }
1835- let Some ( material_asset_id) = render_material_instances. get ( & visible_entity) else {
1836- continue ;
1837- } ;
1838- let Some ( material) = render_materials. get ( * material_asset_id) else {
1839- continue ;
1840- } ;
18411840 let Some ( material_bind_group) =
18421841 material_bind_group_allocator. get ( material. binding . group )
18431842 else {
Original file line number Diff line number Diff line change @@ -698,6 +698,9 @@ pub fn specialize_material2d_meshes<M: Material2d>(
698698 . or_default ( ) ;
699699
700700 for ( _, visible_entity) in visible_entities. iter :: < Mesh2d > ( ) {
701+ let Some ( material_asset_id) = render_material_instances. get ( visible_entity) else {
702+ continue ;
703+ } ;
701704 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
702705 let last_specialized_tick = view_specialized_material_pipeline_cache
703706 . get ( visible_entity)
@@ -709,10 +712,6 @@ pub fn specialize_material2d_meshes<M: Material2d>(
709712 if !needs_specialization {
710713 continue ;
711714 }
712-
713- let Some ( material_asset_id) = render_material_instances. get ( visible_entity) else {
714- continue ;
715- } ;
716715 let Some ( mesh_instance) = render_mesh_instances. get_mut ( visible_entity) else {
717716 continue ;
718717 } ;
You can’t perform that action at this time.
0 commit comments