mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
[naga] Ensure validation rejects invalid sample operations of ImageClass::External images. (#8121)
textureSampleBaseClampToEdge() is valid when called on a `texture_external` texture, but all other sample operations are invalid. Previously validation was succeeding for these operations on an external texture in cases where the same operation on a `texture_2d<f32>` would be allowed. We must therefore explicitly check for ImageClass::External and disallow invalid sample operations.
This commit is contained in:
1 parent
875250348c
commit
9aaed2c0cc
1 file changed
+5
@@ -590,6 +590,11 @@ impl super::Validator {
|
||||
}
|
||||
}
|
||||
|
||||
// External textures can only be sampled using clamp_to_edge.
|
||||
if matches!(class, crate::ImageClass::External) && !clamp_to_edge {
|
||||
return Err(ExpressionError::InvalidImageClass(class));
|
||||
}
|
||||
|
||||
// check level properties
|
||||
match level {
|
||||
crate::SampleLevel::Auto => ShaderStages::FRAGMENT,
|
||||
|
||||
Reference in new issue
Block a user