diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 7f0c9db43..aca648a78 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -15,7 +15,6 @@ use crate::{ pipeline, present, resource::{ self, BufferAccessError, BufferAccessResult, BufferMapOperation, CreateBufferError, - ParentDevice, }, validation::check_buffer_usage, Label, LabelHelpers as _, @@ -1125,10 +1124,6 @@ impl Global { Err(..) => break 'error binding_model::CreateBindGroupError::InvalidLayout, }; - if let Err(e) = bind_group_layout.same_device(&device) { - break 'error e.into(); - } - let bind_group = match device.create_bind_group(&bind_group_layout, desc, hub) { Ok(bind_group) => bind_group, Err(e) => break 'error e, diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index f7c2b522c..d44d98b96 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -2065,6 +2065,9 @@ impl Device { hub: &Hub, ) -> Result, binding_model::CreateBindGroupError> { use crate::binding_model::{BindingResource as Br, CreateBindGroupError as Error}; + + layout.same_device(self)?; + { // Check that the number of entries in the descriptor matches // the number of entries in the layout.