mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Improve error message when image write without format used (#8294)
This commit is contained in:
parent
e73d0558f0
commit
ad15442b89
@ -107,6 +107,8 @@ pub enum Error {
|
||||
InvalidGlobalVar(crate::Expression),
|
||||
#[error("invalid image/sampler expression {0:?}")]
|
||||
InvalidImageExpression(crate::Expression),
|
||||
#[error("image write without format is not currently supported. See https://github.com/gfx-rs/wgpu/issues/6797")]
|
||||
InvalidImageWriteType,
|
||||
#[error("invalid image base type {0:?}")]
|
||||
InvalidImageBaseType(Handle<crate::Type>),
|
||||
#[error("invalid image {0:?}")]
|
||||
|
||||
@ -5635,7 +5635,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
|
||||
let is_depth = self.next()?;
|
||||
let is_array = self.next()? != 0;
|
||||
let is_msaa = self.next()? != 0;
|
||||
let _is_sampled = self.next()?;
|
||||
let is_sampled = self.next()?;
|
||||
let format = self.next()?;
|
||||
|
||||
let dim = map_image_dim(dim)?;
|
||||
@ -5670,6 +5670,8 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
|
||||
format: map_image_format(format)?,
|
||||
access: crate::StorageAccess::default(),
|
||||
}
|
||||
} else if is_sampled == 2 {
|
||||
return Err(Error::InvalidImageWriteType);
|
||||
} else {
|
||||
crate::ImageClass::Sampled {
|
||||
kind,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user