You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally this would support swizzling to return the same size vector but a long term goal would be to provide swizzling into a vector of a different size, smaller or larger.
The problem with SSE2 shuffles is the mask needs to be constant. The intrinsic itself is not a const function so I can't provide a method that will take a mask or at least I don't think that's possible. There are a couple of alternatives:
Generate shuffle methods for all possible permutations. This is what pathfinder does but that's 255 methods for swizzling a Vec4 to another Vec4, potentially more if swizzling to a different size is supported. My main concern with this approach is making sure it doesn't make a mess of the docs.
Use macros - the underlying __m128 is accessible so I think a macro solution would be possible. I would probably provide vec4_swizzle, vec3_swizzle, and vec2_swizzle so that the type is known and the number of lanes specified in the macro could be used to specify the output size.
The text was updated successfully, but these errors were encountered:
It would be good to support generic swizzles.
Ideally this would support swizzling to return the same size vector but a long term goal would be to provide swizzling into a vector of a different size, smaller or larger.
The problem with SSE2 shuffles is the mask needs to be constant. The intrinsic itself is not a
const
function so I can't provide a method that will take a mask or at least I don't think that's possible. There are a couple of alternatives:Vec4
to anotherVec4
, potentially more if swizzling to a different size is supported. My main concern with this approach is making sure it doesn't make a mess of the docs.__m128
is accessible so I think a macro solution would be possible. I would probably providevec4_swizzle
,vec3_swizzle
, andvec2_swizzle
so that the type is known and the number of lanes specified in the macro could be used to specify the output size.The text was updated successfully, but these errors were encountered: