Skip to content

Commit ad15442

Browse files
authored
Improve error message when image write without format used (#8294)
1 parent e73d055 commit ad15442

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

naga/src/front/spv/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ pub enum Error {
107107
InvalidGlobalVar(crate::Expression),
108108
#[error("invalid image/sampler expression {0:?}")]
109109
InvalidImageExpression(crate::Expression),
110+
#[error("image write without format is not currently supported. See https://github.com/gfx-rs/wgpu/issues/6797")]
111+
InvalidImageWriteType,
110112
#[error("invalid image base type {0:?}")]
111113
InvalidImageBaseType(Handle<crate::Type>),
112114
#[error("invalid image {0:?}")]

naga/src/front/spv/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5635,7 +5635,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
56355635
let is_depth = self.next()?;
56365636
let is_array = self.next()? != 0;
56375637
let is_msaa = self.next()? != 0;
5638-
let _is_sampled = self.next()?;
5638+
let is_sampled = self.next()?;
56395639
let format = self.next()?;
56405640

56415641
let dim = map_image_dim(dim)?;
@@ -5670,6 +5670,8 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
56705670
format: map_image_format(format)?,
56715671
access: crate::StorageAccess::default(),
56725672
}
5673+
} else if is_sampled == 2 {
5674+
return Err(Error::InvalidImageWriteType);
56735675
} else {
56745676
crate::ImageClass::Sampled {
56755677
kind,

0 commit comments

Comments
 (0)