Translator: specialize writes a LocalSize mode's sizes through get_mut

clippy's indexing_slicing, which crates/metal2vulkan/src/spirv denies outside
tests, refused the slice that 15ebc7346c wrote the composite's values through
(check job m3-max-72869, clippy plain and --cfg m2v_gpu). The sizes now go
through get_mut, which a mode of six words always passes, and a miss is a
refusal by name.
This commit is contained in:
Anees Iqbal committed 2026-11-23 20:59:02 -08:00
1 parent 6458c28545
commit 1318c483b8
1 file changed
+6 -1
+6 -1
View File
@@ -218,7 +218,12 @@ pub fn specialize(words: &[u32], values: &[(u32, u64)]) -> Result<Vec<u32>, Erro
};
match modes.as_slice() {
// The composite takes precedence over the mode, which takes its values.
[mode] => out[mode + 3..mode + 6].copy_from_slice(&[*x, *y, *z]),
[mode] => {
let Some(sizes) = out.get_mut(mode + 3..mode + 6) else {
return Err(malformed("a LocalSize mode past the module's end"));
};
sizes.copy_from_slice(&[*x, *y, *z]);
}
[] => {
let mode = [
(6 << 16) | Op::ExecutionMode as u32,