diff --git a/wgpu-native/src/device.rs b/wgpu-native/src/device.rs index 7ae0e152b..204b66e87 100644 --- a/wgpu-native/src/device.rs +++ b/wgpu-native/src/device.rs @@ -949,6 +949,7 @@ pub fn device_create_bind_group( .unwrap(); let alignment = match decl.ty { binding_model::BindingType::UniformBuffer => device.limits.min_uniform_buffer_offset_alignment, + binding_model::BindingType::StorageBuffer => device.limits.min_storage_buffer_offset_alignment, _ => panic!("Mismatched buffer binding for {:?}", decl), }; assert_eq!(bb.offset as hal::buffer::Offset % alignment, 0, @@ -957,10 +958,12 @@ pub fn device_create_bind_group( hal::pso::Descriptor::Buffer(&buffer.raw, range) } binding_model::BindingResource::Sampler(id) => { + assert_eq!(decl.ty, binding_model::BindingType::Sampler); let sampler = &sampler_guard[id]; hal::pso::Descriptor::Sampler(&sampler.raw) } binding_model::BindingResource::TextureView(id) => { + assert_eq!(decl.ty, binding_model::BindingType::SampledTexture); let view = &texture_view_guard[id]; used.views.query(id, &view.life_guard.ref_count, DummyUsage); used.textures