XMLoadUDecN4_XR method

Loads an extended range XMUDECN4 into an XMVECTOR. This type loads a 10:10:10:2 normalized GPU format using the Extended Range (XR) with the color bias set to match DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM.

Syntax


XMVECTOR XMLoadUDecN4_XR(
  [inconst XMUDECN4 *pSource
);

Parameters

pSource [in]

Address of the XMUDECN4 structure to load.

Return value

Returns an XMVECTOR loaded with the data from the pSource parameter.

Remarks

The following pseudocode demonstrates the operation of the function.


XMVECTOR vectorOut;

int32_t Element;

Element = pSource->v & 0x3FF;
vectorOut.x = (float)(Element - 0x180) / 510.f;
Element = (pSource->v >> 10) & 0x3FF;
vectorOut.y = (float)(Element - 0x180) / 510.f;
Element = (pSource->v >> 20) & 0x3FF;
vectorOut.z = (float)(Element - 0x180) / 510.f;
vectorOut.w = (float)(pSource->v >> 30) / 3.f;

return vectorOut;

For more details on the Extended Range (XR) with Bias conversion, see XR_BIAS Color Channel Conversion Rules.

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

Namespace

DirectX::PackedVector

Header

DirectXPackedVector.h

See also

DirectXMath Library Vector Load Functions
XMStoreUDecN4_XR

 

 

Show: