Clear bind groups on each frame

This commit is contained in:
Carter Anderson 2020-05-18 14:42:15 -07:00
parent 29ad64f1d8
commit e65fe0e736
4 changed files with 10 additions and 0 deletions

View file

@ -134,4 +134,6 @@ impl RenderResourceContext for HeadlessRenderResourceContext {
.unwrap()
.remove(&(handle, index));
}
fn clear_bind_groups(&self) {
}
}

View file

@ -86,6 +86,7 @@ pub trait RenderResourceContext: Downcast + Send + Sync + 'static {
self.create_bind_group(bind_group, render_resource_assignments);
}
}
fn clear_bind_groups(&self);
}
impl dyn RenderResourceContext {

View file

@ -568,4 +568,8 @@ impl RenderResourceContext for WgpuRenderResourceContext {
}
None
}
fn clear_bind_groups(&self) {
self.resources.bind_groups.write().unwrap().clear();
}
}

View file

@ -129,5 +129,8 @@ impl WgpuRenderer {
render_resource_context
.context
.drop_all_swap_chain_textures();
render_resource_context
.context
.clear_bind_groups();
}
}