mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
move BGL same device check inside create_bind_group
This commit is contained in:
parent
c01a1335aa
commit
14e750205a
@ -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,
|
||||
|
@ -2065,6 +2065,9 @@ impl<A: HalApi> Device<A> {
|
||||
hub: &Hub<A>,
|
||||
) -> Result<BindGroup<A>, 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.
|
||||
|
Loading…
Reference in New Issue
Block a user