mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Minor error reporting fixes (#607)
This commit is contained in:
parent
b8f8dd78fd
commit
09d3623885
@ -434,7 +434,7 @@ fn checked_u32_as_u16(value: u32) -> u16 {
|
||||
value as u16
|
||||
}
|
||||
|
||||
fn is_power_or_two(val: u32) -> bool {
|
||||
fn is_power_of_two(val: u32) -> bool {
|
||||
val != 0 && (val & (val - 1)) == 0
|
||||
}
|
||||
|
||||
@ -457,7 +457,7 @@ pub fn map_texture_dimension_size(
|
||||
}
|
||||
D2 => {
|
||||
assert!(
|
||||
sample_size <= 32 && is_power_or_two(sample_size),
|
||||
sample_size <= 32 && is_power_of_two(sample_size),
|
||||
"Invalid sample_count of {}",
|
||||
sample_size
|
||||
);
|
||||
|
@ -1105,7 +1105,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
| binding_model::BindingType::SampledTexture
|
||||
| binding_model::BindingType::ReadonlyStorageTexture
|
||||
| binding_model::BindingType::WriteonlyStorageTexture => {
|
||||
panic!("Mismatched buffer binding type for {:?}. Expected a type of UniformBuffer, StorageBuffer or ReadonlyStorageBuffer but found {:?}", decl, decl.ty)
|
||||
panic!("Mismatched buffer binding type for {:?}. Expected a type of UniformBuffer, StorageBuffer or ReadonlyStorageBuffer", decl)
|
||||
}
|
||||
};
|
||||
assert_eq!(
|
||||
@ -1145,7 +1145,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
match decl.ty {
|
||||
binding_model::BindingType::Sampler
|
||||
| binding_model::BindingType::ComparisonSampler => {}
|
||||
found => panic!("Mismatched sampler binding type in {:?}. Expected a type of Sampler or ComparisonSampler but found {:?}", decl.ty, found),
|
||||
_ => panic!("Mismatched sampler binding type in {:?}. Expected a type of Sampler or ComparisonSampler", decl.ty),
|
||||
}
|
||||
let sampler = used
|
||||
.samplers
|
||||
@ -1170,7 +1170,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
resource::TextureUse::STORAGE_STORE,
|
||||
hal::image::Layout::General,
|
||||
),
|
||||
found => panic!("Mismatched texture binding type in {:?}. Expected a type of SampledTexture, ReadonlyStorageTexture or WriteonlyStorageTexture but found {:?}", decl, found),
|
||||
_ => panic!("Mismatched texture binding type in {:?}. Expected a type of SampledTexture, ReadonlyStorageTexture or WriteonlyStorageTexture", decl),
|
||||
};
|
||||
let view = used
|
||||
.views
|
||||
|
Loading…
Reference in New Issue
Block a user