mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Validate that BufferDescriptor::usage is not zero (#3928)
* Validate that BufferDescriptor::usage is not zero. * Add a changelog entry.
This commit is contained in:
parent
fe9aa681fe
commit
7198d60f68
@ -69,6 +69,7 @@ Bottom level categories:
|
||||
- Flesh out docs. for `AdapterInfo::{device,vendor}` by @ErichDonGubler in [#3763](https://github.com/gfx-rs/wgpu/pull/3763).
|
||||
- Spell out which sizes are in bytes. By @jimblandy in [#3773](https://github.com/gfx-rs/wgpu/pull/3773).
|
||||
- On Web, types don't implement `Send` or `Sync` anymore. By @daxpedda in [#3691](https://github.com/gfx-rs/wgpu/pull/3691)
|
||||
- Validate that `descriptor.usage` is not empty in `create_buffer` by @nical in [https://github.com/gfx-rs/wgpu/pull/#3928](3928)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
@ -145,6 +145,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
Ok(device) => device,
|
||||
Err(_) => break DeviceError::Invalid.into(),
|
||||
};
|
||||
|
||||
if desc.usage.is_empty() {
|
||||
// Per spec, `usage` must not be zero.
|
||||
break resource::CreateBufferError::InvalidUsage(desc.usage);
|
||||
}
|
||||
|
||||
#[cfg(feature = "trace")]
|
||||
if let Some(ref trace) = device.trace {
|
||||
let mut desc = desc.clone();
|
||||
|
Loading…
Reference in New Issue
Block a user