XMLoadUDecN4_XR

Loads an XMUDECN4 into an XMVECTOR, using the Extended Range (XR) with Bias.

Syntax

XMVECTOR XM_CALLCONV XMLoadUDecN4_XR(
         const XMUDECN4 *pSource
)  

Parameters

pSource
Type: XMUDECN4 *

[in] Address of the XMUDECN4 structure to load.

Return value

Type: XMVECTOR XM_CALLCONV 

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

Remarks

Loads a 10:10:10:2 normalized GPU format using the Extended Range (XR) with Bias to match DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM.

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 details on this conversion, see XR_BIAS to Float Conversion Rules on MSDN.

Requirements

Header: Declared in directxpackedvector.h.