From c1d038a250ddcf761a9f7eba9d517a1a5e414cbd Mon Sep 17 00:00:00 2001 From: White-Green <43771790+White-Green@users.noreply.github.com> Date: Mon, 28 Feb 2022 00:10:25 +0900 Subject: [PATCH 1/2] add OpUndef to global instruction --- vulkano/src/shader/spirv.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vulkano/src/shader/spirv.rs b/vulkano/src/shader/spirv.rs index cefcd25ddb..66649d51e4 100644 --- a/vulkano/src/shader/spirv.rs +++ b/vulkano/src/shader/spirv.rs @@ -229,7 +229,8 @@ impl Spirv { | Instruction::SpecConstantFalse { .. } | Instruction::SpecConstant { .. } | Instruction::SpecConstantComposite { .. } - | Instruction::SpecConstantOp { .. } => set_range(&mut range_global, index)?, + | Instruction::SpecConstantOp { .. } + | Instruction::Undef { .. } => set_range(&mut range_global, index)?, Instruction::Variable { storage_class, .. } if *storage_class != StorageClass::Function => { From 5aa51c9069745e9bb9ccee79f01ce386aa69a9bb Mon Sep 17 00:00:00 2001 From: White-Green <43771790+White-Green@users.noreply.github.com> Date: Mon, 28 Feb 2022 00:58:57 +0900 Subject: [PATCH 2/2] allow OpUndef in function body --- vulkano/src/shader/spirv.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vulkano/src/shader/spirv.rs b/vulkano/src/shader/spirv.rs index 66649d51e4..f14a676830 100644 --- a/vulkano/src/shader/spirv.rs +++ b/vulkano/src/shader/spirv.rs @@ -229,8 +229,8 @@ impl Spirv { | Instruction::SpecConstantFalse { .. } | Instruction::SpecConstant { .. } | Instruction::SpecConstantComposite { .. } - | Instruction::SpecConstantOp { .. } - | Instruction::Undef { .. } => set_range(&mut range_global, index)?, + | Instruction::SpecConstantOp { .. } => set_range(&mut range_global, index)?, + Instruction::Undef { .. } if !in_function => set_range(&mut range_global, index)?, Instruction::Variable { storage_class, .. } if *storage_class != StorageClass::Function => {