Move assertions after the check for equal types.
`bitcast_glsl_op()` is sometimes called for `Boolean` types, e.g. for specialization constants. We don't want the assert to trip if this is going to be a no-op anyway.
This commit is contained in:
parent
0c0ceb9763
commit
ef0b1fc841
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user