mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 15:31:03 +01:00
Improve error messages for mismatched binding types (#593)
This commit is contained in:
1 parent
d937742da7
commit
72bc709bc0
1 file changed
+3
-3
@@ -1104,7 +1104,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
| binding_model::BindingType::SampledTexture
|
||||
| binding_model::BindingType::ReadonlyStorageTexture
|
||||
| binding_model::BindingType::WriteonlyStorageTexture => {
|
||||
panic!("Mismatched buffer binding for {:?}", decl)
|
||||
panic!("Mismatched buffer binding type for {:?}. Expected a type of UniformBuffer, StorageBuffer or ReadonlyStorageBuffer but found {:?}", decl, decl.ty)
|
||||
}
|
||||
};
|
||||
assert_eq!(
|
||||
@@ -1144,7 +1144,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
match decl.ty {
|
||||
binding_model::BindingType::Sampler
|
||||
| binding_model::BindingType::ComparisonSampler => {}
|
||||
_ => panic!("Wrong binding type for a sampler: {:?}", decl.ty),
|
||||
found => panic!("Mismatched sampler binding type in {:?}. Expected a type of Sampler or ComparisonSampler but found {:?}", decl.ty, found),
|
||||
}
|
||||
let sampler = used
|
||||
.samplers
|
||||
@@ -1162,7 +1162,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
| binding_model::BindingType::WriteonlyStorageTexture => {
|
||||
(wgt::TextureUsage::STORAGE, hal::image::Layout::General)
|
||||
}
|
||||
_ => panic!("Mismatched texture binding for {:?}", decl),
|
||||
found => panic!("Mismatched texture binding type in {:?}. Expected a type of SampledTexture, ReadonlyStorageTexture or WriteonlyStorageTexture but found {:?}", decl, found),
|
||||
};
|
||||
let view = used
|
||||
.views
|
||||
|
||||
Reference in new issue
Block a user