A 4D vector with x-,y-, and z- components represented as 10 bit unsigned integer values, and the w-component as a 2 bit unsigned integer value.
If you are programming in C++, you can use the constructors and operator methods of this structure.
Note See DirectXMath Library Type Equivalences for information about equivalent D3DDECLTYPE, D3DFORMAT, and DXGI_FORMAT objects.
struct XMUDEC4
The fields in the XMUDEC4 structure are declared as follows:
struct XMUDEC4
{
union
{
struct
{
uint32_t x : 10; // Unsigned integer value in the range [0, 1023]
// describing the x-coordinate of the vector.
uint32_t y : 10; // Unsigned integer value in the range [0, 1023]
// describing the y-coordinate of the vector.
uint32_t z : 10; // Unsigned integer value in the range [0, 1023]
// describing the z-coordinate of the vector.
uint32_t w : 2; // Unsigned integer value in the range [0, 3]
// describing the w-coordinate of the vector.
};
uint32_t v; // Unsigned 32-bit integer representing the 4D vector.
};
XMUDEC4 can be loaded into instances of XMVECTOR by using XMLoadUDec4.
Instances of XMVECTOR can be stored into an instance of XMUDEC4 with XMStoreUDec4.
Namespace: Use DirectX::PackedVector
Header: Declared in directxpackedvector.h.