From f2c68d71c8e25a1b9ce35ab713a2960833c6115f Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Tue, 7 Nov 2023 12:54:48 -0800 Subject: [PATCH] Allow spec constant convert ops. (#2399) --- vulkano/src/shader/spirv/specialization.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vulkano/src/shader/spirv/specialization.rs b/vulkano/src/shader/spirv/specialization.rs index 4f990e26..f6fcd43d 100644 --- a/vulkano/src/shader/spirv/specialization.rs +++ b/vulkano/src/shader/spirv/specialization.rs @@ -341,8 +341,14 @@ fn evaluate_spec_constant_op( let constant_to_instruction = |constant_id: Id| -> SmallVec<[Instruction; 1]> { let constant = &constants[&constant_id]; - debug_assert_eq!(constant.type_id, result_type_id); - + if !matches!( + opcode, + SpecConstantInstruction::UConvert { .. } + | SpecConstantInstruction::SConvert { .. } + | SpecConstantInstruction::FConvert { .. } + ) { + debug_assert_eq!(constant.type_id, result_type_id); + } match constant.value { ConstantValue::Scalar(value) => smallvec![scalar_constant_to_instruction( result_type_id,