mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
remove duplicate check, it's already present in Device.create_buffer
This commit is contained in:
parent
7b387007a8
commit
a971e7f7d4
@ -180,11 +180,6 @@ impl Global {
|
||||
trace.add(trace::Action::CreateBuffer(fid.id(), desc));
|
||||
}
|
||||
|
||||
if desc.usage.is_empty() {
|
||||
// Per spec, `usage` must not be zero.
|
||||
break 'error CreateBufferError::InvalidUsage(desc.usage);
|
||||
}
|
||||
|
||||
let buffer = match device.create_buffer(desc, false) {
|
||||
Ok(buffer) => buffer,
|
||||
Err(e) => {
|
||||
|
@ -580,8 +580,6 @@ impl<A: HalApi> Device<A> {
|
||||
self.require_downlevel_flags(wgt::DownlevelFlags::UNRESTRICTED_INDEX_BUFFER)?;
|
||||
}
|
||||
|
||||
let mut usage = conv::map_buffer_usage(desc.usage);
|
||||
|
||||
if desc.usage.is_empty() || desc.usage.contains_invalid_bits() {
|
||||
return Err(resource::CreateBufferError::InvalidUsage(desc.usage));
|
||||
}
|
||||
@ -600,6 +598,8 @@ impl<A: HalApi> Device<A> {
|
||||
}
|
||||
}
|
||||
|
||||
let mut usage = conv::map_buffer_usage(desc.usage);
|
||||
|
||||
if desc.mapped_at_creation {
|
||||
if desc.size % wgt::COPY_BUFFER_ALIGNMENT != 0 {
|
||||
return Err(resource::CreateBufferError::UnalignedSize);
|
||||
|
Loading…
Reference in New Issue
Block a user