Skip to content

Commit

Permalink
Must specify type of VisibleEntities when accessing
Browse files Browse the repository at this point in the history
[12582](bevyengine/bevy#12582) divided `VisibleEntities` into separate lists. So now we have to specify which kind of entity we want. I think we want the Mesh here, and I think we can get rid of the `.index` calls on Entity since Entity [already compares bits](https://docs.rs/bevy_ecs/0.14.0-rc.2/src/bevy_ecs/entity/mod.rs.html#173) for optimized codegen purposes. Waiting to do that until the other changes are in though so as to not change functionality until post-upgrade.
  • Loading branch information
ChristopherBiscardi committed Jun 7, 2024
1 parent ad615dc commit 4b14a61
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/render/material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use bevy::{
},
renderer::RenderDevice,
texture::{FallbackImage, GpuImage},
view::{ExtractedView, ViewUniforms, VisibleEntities},
view::{ExtractedView, ViewUniforms, VisibleEntities, WithMesh},
Extract, Render, RenderApp, RenderSet,
},
utils::{HashMap, HashSet},
Expand Down Expand Up @@ -421,8 +421,7 @@ pub fn queue_material_tilemap_meshes<M: MaterialTilemap>(

for (entity, chunk_id, transform, tilemap_id) in standard_tilemap_meshes.iter() {
if !visible_entities
.entities
.iter()
.iter::<WithMesh>()
.any(|&entity| entity.index() == tilemap_id.0.index())
{
continue;
Expand Down Expand Up @@ -539,8 +538,7 @@ pub fn bind_material_tilemap_meshes<M: MaterialTilemap>(

for (chunk_id, tilemap_id) in standard_tilemap_meshes.iter() {
if !visible_entities
.entities
.iter()
.iter::<WithMesh>()
.any(|&entity| entity.index() == tilemap_id.0.index())
{
continue;
Expand Down

0 comments on commit 4b14a61

Please sign in to comment.