mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Improve read-write and read-only texture storage error message (#2745)
* Improve read-write and read-only texture storage error message * Update wgpu-core/src/binding_model.rs Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
This commit is contained in:
parent
091e9b1788
commit
f0c7fe3a8e
@ -24,6 +24,8 @@ use thiserror::Error;
|
||||
pub enum BindGroupLayoutEntryError {
|
||||
#[error("cube dimension is not expected for texture storage")]
|
||||
StorageTextureCube,
|
||||
#[error("Read-write and read-only storage textures are not allowed by webgpu, they require the native only feature TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES")]
|
||||
StorageTextureReadWrite,
|
||||
#[error("arrays of bindings unsupported for this type of binding")]
|
||||
ArrayUnsupported,
|
||||
#[error(transparent)]
|
||||
|
@ -1380,6 +1380,20 @@ impl<A: HalApi> Device<A> {
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
match access {
|
||||
wgt::StorageTextureAccess::ReadOnly
|
||||
| wgt::StorageTextureAccess::ReadWrite
|
||||
if !self.features.contains(
|
||||
wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES,
|
||||
) =>
|
||||
{
|
||||
return Err(binding_model::CreateBindGroupLayoutError::Entry {
|
||||
binding: entry.binding,
|
||||
error: binding_model::BindGroupLayoutEntryError::StorageTextureReadWrite,
|
||||
});
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
(
|
||||
Some(
|
||||
wgt::Features::TEXTURE_BINDING_ARRAY
|
||||
|
Loading…
Reference in New Issue
Block a user