# Bvec3 in Metal?

**URL:** <https://forums.kodeco.com/t/bvec3-in-metal/74431>\
**Category:** Metal by Tutorials\
**Created:** [June 21, 2019, 12:25am UTC](https://forums.kodeco.com/t/bvec3-in-metal/74431 "2019-06-21T00:25:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markusm](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/markusm/32/81494_2.png) [@markusm](https://forums.kodeco.com/u/markusm)\
**Post date:** [June 21, 2019, 12:25am UTC](https://forums.kodeco.com/t/bvec3-in-metal/74431/1 "2019-06-21T00:25:53Z")

</div>

Hi,

I am trying to port this shader to Metal: [Shader - Shadertoy BETA](https://www.shadertoy.com/view/wdBXRW)

I am having problems with this part:

```
    // winding number from http://geomalgorithms.com/a03-_inclusion.html
    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!

Markus

---

<div class="post-metadata">

**Author:** ![mhorga](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mhorga/32/109017_2.png) [@mhorga](https://forums.kodeco.com/u/mhorga)\
**Post date:** [June 21, 2019, 12:44am UTC](https://forums.kodeco.com/t/bvec3-in-metal/74431/2 "2019-06-21T00:44:45Z")

</div>

that is a 3-component boolean vector. read more [here](http://www.shaderific.com/glsl-types). 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.
