mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
[naga] Constrain textureLoad array index args to i32 or u32.
In `naga::valid::expression`, require that `Expression::ImageLoad::array_index` be either `i32` or `u32`, not just an integral type of any size.
This commit is contained in:
parent
7c5f705580
commit
5bc3c9da3c
@ -648,12 +648,8 @@ impl super::Validator {
|
||||
return Err(ExpressionError::InvalidImageArrayIndex);
|
||||
}
|
||||
if let Some(expr) = array_index {
|
||||
match resolver[expr] {
|
||||
Ti::Scalar(Sc {
|
||||
kind: Sk::Sint | Sk::Uint,
|
||||
width: _,
|
||||
}) => {}
|
||||
_ => return Err(ExpressionError::InvalidImageArrayIndexType(expr)),
|
||||
if !matches!(resolver[expr], Ti::Scalar(Sc::I32 | Sc::U32)) {
|
||||
return Err(ExpressionError::InvalidImageArrayIndexType(expr));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user