File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1011,6 +1011,10 @@ pub fn specialize_material_meshes<M: Material>(
10111011 let Ok ( material_asset_id) = material_instance. asset_id . try_typed :: < M > ( ) else {
10121012 continue ;
10131013 } ;
1014+ let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
1015+ else {
1016+ continue ;
1017+ } ;
10141018 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
10151019 let last_specialized_tick = view_specialized_material_pipeline_cache
10161020 . get ( visible_entity)
@@ -1022,10 +1026,6 @@ pub fn specialize_material_meshes<M: Material>(
10221026 if !needs_specialization {
10231027 continue ;
10241028 }
1025- let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
1026- else {
1027- continue ;
1028- } ;
10291029 let Some ( mesh) = render_meshes. get ( mesh_instance. mesh_asset_id ) else {
10301030 continue ;
10311031 } ;
Original file line number Diff line number Diff line change @@ -945,6 +945,10 @@ pub fn specialize_prepass_material_meshes<M>(
945945 let Ok ( material_asset_id) = material_instance. asset_id . try_typed :: < M > ( ) else {
946946 continue ;
947947 } ;
948+ let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
949+ else {
950+ continue ;
951+ } ;
948952 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
949953 let last_specialized_tick = view_specialized_material_pipeline_cache
950954 . get ( visible_entity)
@@ -956,10 +960,6 @@ pub fn specialize_prepass_material_meshes<M>(
956960 if !needs_specialization {
957961 continue ;
958962 }
959- let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
960- else {
961- continue ;
962- } ;
963963 let Some ( material) = render_materials. get ( material_asset_id) else {
964964 continue ;
965965 } ;
Original file line number Diff line number Diff line change @@ -1817,6 +1817,11 @@ pub fn specialize_shadows<M: Material>(
18171817 let Ok ( material_asset_id) = material_instances. asset_id . try_typed :: < M > ( ) else {
18181818 continue ;
18191819 } ;
1820+ let Some ( mesh_instance) =
1821+ render_mesh_instances. render_mesh_queue_data ( visible_entity)
1822+ else {
1823+ continue ;
1824+ } ;
18201825 let entity_tick = entity_specialization_ticks. get ( & visible_entity) . unwrap ( ) ;
18211826 let last_specialized_tick = view_specialized_material_pipeline_cache
18221827 . get ( & visible_entity)
@@ -1831,11 +1836,6 @@ pub fn specialize_shadows<M: Material>(
18311836 let Some ( material) = render_materials. get ( material_asset_id) else {
18321837 continue ;
18331838 } ;
1834- let Some ( mesh_instance) =
1835- render_mesh_instances. render_mesh_queue_data ( visible_entity)
1836- else {
1837- continue ;
1838- } ;
18391839 if !mesh_instance
18401840 . flags
18411841 . contains ( RenderMeshInstanceFlags :: SHADOW_CASTER )
Original file line number Diff line number Diff line change @@ -780,6 +780,10 @@ pub fn specialize_wireframes(
780780 if !render_wireframe_instances. contains_key ( visible_entity) {
781781 continue ;
782782 } ;
783+ let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
784+ else {
785+ continue ;
786+ } ;
783787 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
784788 let last_specialized_tick = view_specialized_material_pipeline_cache
785789 . get ( visible_entity)
@@ -791,10 +795,6 @@ pub fn specialize_wireframes(
791795 if !needs_specialization {
792796 continue ;
793797 }
794- let Some ( mesh_instance) = render_mesh_instances. render_mesh_queue_data ( * visible_entity)
795- else {
796- continue ;
797- } ;
798798 let Some ( mesh) = render_meshes. get ( mesh_instance. mesh_asset_id ) else {
799799 continue ;
800800 } ;
Original file line number Diff line number Diff line change @@ -722,6 +722,9 @@ pub fn specialize_material2d_meshes<M: Material2d>(
722722 let Some ( material_asset_id) = render_material_instances. get ( visible_entity) else {
723723 continue ;
724724 } ;
725+ let Some ( mesh_instance) = render_mesh_instances. get_mut ( visible_entity) else {
726+ continue ;
727+ } ;
725728 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
726729 let last_specialized_tick = view_specialized_material_pipeline_cache
727730 . get ( visible_entity)
@@ -733,9 +736,6 @@ pub fn specialize_material2d_meshes<M: Material2d>(
733736 if !needs_specialization {
734737 continue ;
735738 }
736- let Some ( mesh_instance) = render_mesh_instances. get_mut ( visible_entity) else {
737- continue ;
738- } ;
739739 let Some ( material_2d) = render_materials. get ( * material_asset_id) else {
740740 continue ;
741741 } ;
Original file line number Diff line number Diff line change @@ -771,6 +771,9 @@ pub fn specialize_wireframes(
771771 if !render_wireframe_instances. contains_key ( visible_entity) {
772772 continue ;
773773 } ;
774+ let Some ( mesh_instance) = render_mesh_instances. get ( visible_entity) else {
775+ continue ;
776+ } ;
774777 let entity_tick = entity_specialization_ticks. get ( visible_entity) . unwrap ( ) ;
775778 let last_specialized_tick = view_specialized_material_pipeline_cache
776779 . get ( visible_entity)
@@ -782,9 +785,6 @@ pub fn specialize_wireframes(
782785 if !needs_specialization {
783786 continue ;
784787 }
785- let Some ( mesh_instance) = render_mesh_instances. get ( visible_entity) else {
786- continue ;
787- } ;
788788 let Some ( mesh) = render_meshes. get ( mesh_instance. mesh_asset_id ) else {
789789 continue ;
790790 } ;
You can’t perform that action at this time.
0 commit comments