reset uniform count on each update (oops)

This commit is contained in:
Carter Anderson 2020-03-02 08:32:15 -08:00
parent ca563ea1b3
commit 22be0b3366
2 changed files with 10 additions and 9 deletions

View File

@ -27,14 +27,14 @@ fn setup(world: &mut World) {
translation: Translation::new(0.0, 0.0, 0.0), translation: Translation::new(0.0, 0.0, 0.0),
..Default::default() ..Default::default()
}) })
// .add_archetype(MeshEntity { .add_archetype(MeshEntity {
// mesh: cube_handle, mesh: cube_handle,
// material: StandardMaterial { material: StandardMaterial {
// albedo: Vec4::new(1.0, 0.0, 0.0, 1.0).into(), albedo: Vec4::new(1.0, 0.0, 0.0, 1.0).into(),
// }, },
// translation: Translation::new(2.0, 0.0, 0.0), translation: Translation::new(2.0, 0.0, 0.0),
// ..Default::default() ..Default::default()
// }) })
// light // light
.add_archetype(LightEntity { .add_archetype(LightEntity {
translation: Translation::new(4.0, -4.0, 5.0), translation: Translation::new(4.0, -4.0, 5.0),

View File

@ -44,11 +44,12 @@ where
// (2) if we create new buffers, the old bind groups will be invalid // (2) if we create new buffers, the old bind groups will be invalid
// reset all uniform buffer info counts // reset all uniform buffer info counts
for (_name, (resource, _count, entities)) in self.uniform_buffer_info_resources.iter() { for (_name, (resource, count, _entities)) in self.uniform_buffer_info_resources.iter_mut() {
renderer renderer
.get_dynamic_uniform_buffer_info_mut(resource.unwrap()) .get_dynamic_uniform_buffer_info_mut(resource.unwrap())
.unwrap() .unwrap()
.count = 0; .count = 0;
*count = 0;
} }
for (entity, (uniforms, _renderable)) in query.iter_entities(world) { for (entity, (uniforms, _renderable)) in query.iter_entities(world) {