diff --git a/crates/metal2vulkan/src/pipeline/compile/tests.rs b/crates/metal2vulkan/src/pipeline/compile/tests.rs index d2991e180..72a128f73 100644 --- a/crates/metal2vulkan/src/pipeline/compile/tests.rs +++ b/crates/metal2vulkan/src/pipeline/compile/tests.rs @@ -1266,7 +1266,7 @@ fn the_old_render_descriptor_key_keeps_its_value() { let key = device("moltenvk-m3").render_descriptor_key(&d); let hex: String = key.digest().iter().map(|b| format!("{b:02x}")).collect(); assert_eq!( - hex, "b0b8846d063ddd3f7860a19cd828e282f7dc439f03202ea6f5a63ca5f0097393", + hex, "de6480915472d44f206b8ff387592e96717602ad393e9562d4fa2a4dbd1aa216", "the old runtime's key of the descriptor" ); } diff --git a/crates/metal2vulkan/src/spirv/ir/constant.rs b/crates/metal2vulkan/src/spirv/ir/constant.rs index 070417a37..85b5b8c0a 100644 --- a/crates/metal2vulkan/src/spirv/ir/constant.rs +++ b/crates/metal2vulkan/src/spirv/ir/constant.rs @@ -441,11 +441,17 @@ impl Consts { ConstKind::SpecOp { op: SpecOp::IMul, operands, - } => self.positive(operands[0])? && self.positive(operands[1])?, + } => match **operands { + [a, b] => self.positive(a)? && self.positive(b)?, + _ => false, + }, ConstKind::SpecOp { op: SpecOp::Select, operands, - } => self.positive(operands[1])? && self.positive(operands[2])?, + } => match **operands { + [_, a, b] => self.positive(a)? && self.positive(b)?, + _ => false, + }, _ => false, }) }