gwiazdorrr / CxxSwizzle

Modern C++ swizzling header-only library
MIT License
186 stars 7 forks source link

Passing swizzles as inout/out arguments doesn't compile. #4

Closed gwiazdorrr closed 2 years ago

gwiazdorrr commented 9 years ago
void foo(inout vec2 v) {}

vec3 position = vec3(0.0);
foo(position.yz); // error

Swizzles (aka proxies) are convertible to vectors, which are returned by value. In the above example, the resulting rvalue can't be converted to a reference (inout).

gwiazdorrr commented 2 years ago

Solved.