Share via


XMStoreUDecN4_XR函式 (directxpackedvector.h)

將擴充範圍 XMUDECN4 儲存至 XMVECTOR。 此類型會使用擴充範圍 (XR) 儲存 10:10:10:10:2 標準化 GPU 格式,並將色彩偏差設定為符合DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM。

語法

void XM_CALLCONV XMStoreUDecN4_XR(
  [out] XMUDECN4  *pDestination,
  [in]  FXMVECTOR V
) noexcept;

參數

[out] pDestination

要儲存資料的位址。

[in] V

包含要儲存之資料的向量。

傳回值

無。

備註

下列虛擬程式碼示範函式的作業。

XMVECTOR N; 
static const XMVECTOR Scale = {510.0f, 510.0f, 510.0f, 3.0f};
static const XMVECTOR Bias = { 384.0f, 384.0f, 384.0f, 0.0f };
static const XMVECTOR C = { 1023.f, 1023.f, 1023.f, 3.f };

assert(pDestination);

N = XMVectorMultiplyAdd( V, Scale, Bias );
N = XMVectorClamp( V, XMVectorZero(), C );

pDestination->v = ((uint32_t)N.v[3] << 30) |
(((uint32_t)N.v[2] & 0x3FF) << 20) |
(((uint32_t)N.v[1] & 0x3FF) << 10) |
(((uint32_t)N.v[0] & 0x3FF));

如需延伸範圍 (XR) 與偏差轉換的詳細資訊,請參閱 XR_BIAS色彩通道轉換規則

平臺需求

Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012 搭配 Windows SDK for Windows 8。 支援 Win32 傳統型應用程式、Windows 市集應用程式和 Windows Phone 8 個應用程式。

需求

   
目標平台 Windows
標頭 directxpackedvector.h (包含 DirectXPackedVector.h)

另請參閱

DirectXMath 程式庫向量存放區函式

XMLoadUDecN4_XR