GameTechDev / SPIRV-Cross

An experimental ISPC backend for SPIRV-Cross
Apache License 2.0
60 stars 7 forks source link

Unable to cast uint from bool expression #2

Closed emoon closed 6 years ago

emoon commented 6 years ago

When having an expression like this

uint t = dot(v, v) > 0;

ISPC will complain about Unable to find any matching overload for call to function "int_cast"

This can be fixed by adding this to the generated ispc header file

static SPIRV_INLINE varying int int_cast(varying bool& a) { return (varying int) a; }
jonckennedy commented 6 years ago

good catch. I shall add bools to the autogen cast functions.

Thanks