mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
buffer size mismatch: more detail in error message (#5858)
* buffer size mismatch: more detail in error message * wrong buffer size: change name of fields
This commit is contained in:
parent
9d12a0a122
commit
c9a2d972ad
@ -147,8 +147,11 @@ pub enum BindingError {
|
||||
binding: naga::AddressSpace,
|
||||
shader: naga::AddressSpace,
|
||||
},
|
||||
#[error("Buffer structure size {0}, added to one element of an unbound array, if it's the last field, ended up greater than the given `min_binding_size`")]
|
||||
WrongBufferSize(wgt::BufferSize),
|
||||
#[error("Buffer structure size {buffer_size}, added to one element of an unbound array, if it's the last field, ended up greater than the given `min_binding_size`, which is {min_binding_size}")]
|
||||
WrongBufferSize {
|
||||
buffer_size: wgt::BufferSize,
|
||||
min_binding_size: wgt::BufferSize,
|
||||
},
|
||||
#[error("View dimension {dim:?} (is array: {is_array}) doesn't match the binding {binding:?}")]
|
||||
WrongTextureViewDimension {
|
||||
dim: naga::ImageDimension,
|
||||
@ -385,7 +388,10 @@ impl Resource {
|
||||
};
|
||||
match min_size {
|
||||
Some(non_zero) if non_zero < size => {
|
||||
return Err(BindingError::WrongBufferSize(size))
|
||||
return Err(BindingError::WrongBufferSize {
|
||||
buffer_size: size,
|
||||
min_binding_size: non_zero,
|
||||
})
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user