properly update bind group ids when setting dynamic bindings. (#560)

This commit is contained in:
Carter Anderson 2020-09-23 13:20:14 -07:00 committed by GitHub
parent 028a22b129
commit a768bae33b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,6 +152,7 @@ impl PipelineDescriptor {
if !dynamic_bindings.is_empty() {
// set binding uniforms to dynamic if render resource bindings use dynamic
for bind_group in layout.bind_groups.iter_mut() {
let mut binding_changed = false;
for binding in bind_group.bindings.iter_mut() {
let current = DynamicBinding {
bind_group: bind_group.index,
@ -164,9 +165,14 @@ impl PipelineDescriptor {
} = binding.bind_type
{
*dynamic = true;
binding_changed = true;
}
}
}
if binding_changed {
bind_group.update_id();
}
}
}