diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index 8d10b992..a8855987 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -5254,12 +5254,12 @@ case OpGroupNonUniform##op: \ string CompilerGLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in_type) { - assert(out_type.basetype != SPIRType::Boolean); - assert(in_type.basetype != SPIRType::Boolean); - if (out_type.basetype == in_type.basetype) return ""; + assert(out_type.basetype != SPIRType::Boolean); + assert(in_type.basetype != SPIRType::Boolean); + bool integral_cast = type_is_integral(out_type) && type_is_integral(in_type); bool same_size_cast = out_type.width == in_type.width; diff --git a/spirv_msl.cpp b/spirv_msl.cpp index 5f2cc4f0..0e1e733d 100644 --- a/spirv_msl.cpp +++ b/spirv_msl.cpp @@ -5467,12 +5467,12 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id) string CompilerMSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in_type) { - assert(out_type.basetype != SPIRType::Boolean); - assert(in_type.basetype != SPIRType::Boolean); - if (out_type.basetype == in_type.basetype) return ""; + assert(out_type.basetype != SPIRType::Boolean); + assert(in_type.basetype != SPIRType::Boolean); + bool integral_cast = type_is_integral(out_type) && type_is_integral(in_type); bool same_size_cast = out_type.width == in_type.width;