Bvec3 in Metal?


I am trying to port this shader to Metal: Shader - Shadertoy BETA

I am having problems with this part:

    // winding number from
    bvec3 cond = bvec3( p.y>=v[i].y, p.y<v[j].y, e.x*w.y>e.y*w.x );
    if( all(cond) || all(not(cond)) ) s*=-1.0;  

What is the bvec3 counterpart in Metal ? I cannot find any documentation on the all() statement in the Metal spec.

Thanks for any help!


that is a 3-component boolean vector. read more here. you can define any custom type in MSL like this for example: struct bvec3 { bool one; bool two; bool three; }; and then you can create a new instance of this type like this: bvec3 tripleBool; and assign boolean values to any of its members like this: tripleBool.two = true;. I hope this helps.