Skip to content

Commit 59f815a

Browse files
jamienicoljimblandy
authored andcommitted
[naga] Have validation reject shaders containing binding arrays of external textures
For simplicity's sake our initial implementation of external textures will not support binding arrays of external textures. We should therefore reject any shaders which use them during validation. Their implementation will be tracked in #8027. naga/src/valid/type.rs JJ: JJ: Lines starting with "JJ:" (like this one) will be removed.
1 parent e1ccb66 commit 59f815a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

naga/src/valid/type.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ pub enum TypeError {
133133
InvalidDynamicArray(String, Handle<crate::Type>),
134134
#[error("The base handle {0:?} has to be a struct")]
135135
BindingArrayBaseTypeNotStruct(Handle<crate::Type>),
136+
#[error("Binding arrays of external textures are not yet supported")]
137+
BindingArrayBaseExternalTextures,
136138
#[error("Structure member[{index}] at {offset} overlaps the previous member")]
137139
MemberOverlap { index: u32, offset: u32 },
138140
#[error(
@@ -803,6 +805,17 @@ impl super::Validator {
803805
_ => return Err(TypeError::BindingArrayBaseTypeNotStruct(base)),
804806
};
805807
}
808+
if matches!(
809+
gctx.types[base].inner,
810+
crate::TypeInner::Image {
811+
class: crate::ImageClass::External,
812+
..
813+
}
814+
) {
815+
// Binding arrays of external textures are not yet supported.
816+
// https://github.com/gfx-rs/wgpu/issues/8027
817+
return Err(TypeError::BindingArrayBaseExternalTextures);
818+
}
806819

807820
if !base_info.flags.contains(TypeFlags::CREATION_RESOLVED) {
808821
return Err(TypeError::InvalidData(base));

0 commit comments

Comments
 (0)