Permutes the components of two vectors to create a new vector.
| Name | Description |
|---|---|
| XMVectorPermute (XMVECTOR, XMVECTOR) | Permutes the components of two vectors to create a new vector. |
| XMVectorPermute (XMVECTOR, XMVECTOR, uint32_t, uint32_t, uint32_t, uint32_t) | Permutes the components of two vectors to create a new vector. |
If all 4 indices reference only a single vector (i.e. they are all in the range 0-3 or all in the range 4-7), use XMVectorSwizzle instead for better performance.
The XM_PERMUTE_ constants are provided to use as input values for PermuteX,PermuteY,PermuteZ, and PermuteW.
For constant PermuteX/Y/Z/W parameters, it is much more efficient to use the template form of XMVectorPermute:
template<uint32_t PermuteX, uint32_t PermuteY, uint32_t PermuteZ, uint32_t PermuteW>
XMVECTOR XMVectorPermute(FXMVECTOR V1, FXMVECTOR V2)
Example: XMVectorPermute<XM_PERMUTE_0Z, XM_PERMUTE_1X, XM_PERMUTE_0W, XM_PERMUTE_1Y>( V1, V2 );
Note
This version of
XMVectorPermuteis new for DirectXMath. The XNAMath v2.x library made use ofXMVectorPermuteControl, a controlXMVECTORinstead of 4 indicies forXMVectorPermute, and used different values for the XM_PERMUTE_x constants.