> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGDecodeDCC (XBOX Series 主機)

> 解碼 (解壓縮) 經過差異色彩壓縮的表面。

解碼 (解壓縮) 經過差異色彩壓縮的表面。

## 語法

```cpp theme={null}
HRESULT XGDecodeDCC(  
         UINT32 DataSizeBlocks,  
         const void* pSourceData,  
         const void* pSourceKeys,  
         void* pDestData,  
         XG_FORMAT Format,  
         XG_SWIZZLE_MODE SwizzleMode,  
         XG_RESOURCE_DIMENSION Dimension,  
         const XG_DCC_OPTIONS* pDccOptions  
)  
```

### 參數

*DataSizeBlocks*   \_In\_\
類型：UINT32

*pSourceData* 中壓縮色彩資料的 256 位元組區塊數目。

*pSourceData*   \_In\_reads\_bytes\_(DataSizeBlocks*XG\_DCC\_BLOCK\_SIZE\_BYTES)\
類型：void*

包含經過差異色彩壓縮之色彩值的緩衝區位址。緩衝區的大小為 256 位元組乘以 *DataSizeBlocks*。

*pSourceKeys*   \_In\_reads\_bytes\_(DataSizeBlocks)\
類型：void\*

包含 DCC 索引鍵值的緩衝區位址，每個壓縮區塊一個位元組。緩衝區的大小為 *DataSizeBlocks*。

*pDestData*   \_Out\_writes\_bytes\_(DataSizeBlocks*XG\_DCC\_BLOCK\_SIZE\_BYTES)\
類型：void*

將儲存已解碼 (已解壓縮) 色彩資料的緩衝區位址。緩衝區的大小應與 *pSourceData* 中指定的緩衝區相同：256 位元組乘以 *DataSizeBlocks*。

*Format*   \_In\_\
類型：[XG\_FORMAT](/zh-TW/reference/graphics/xg__NR/enums/xg_format)

已解壓縮色彩資料的色彩格式。

*SwizzleMode*   \_In\_\
類型：[XG\_SWIZZLE\_MODE](/zh-TW/reference/graphics/xg_xs/enums/xg_swizzle_mode)

已解壓縮色彩資料的 Swizzle 模式。

*Dimension*   \_In\_\
類型：[XG\_RESOURCE\_DIMENSION](/zh-TW/reference/graphics/xg__NR/enums/xg_resource_dimension)

壓縮來源資料的資源維度。

*pDccOptions*   \_In\_\
類型：[XG\_DCC\_OPTIONS\*](/zh-TW/reference/graphics/xg__NR/structs/xg_dcc_options)

指定已解壓縮色彩資料的 DCC 編碼選項。

### 傳回值

類型：HRESULT

如果成功，則傳回 S\_OK；否則傳回錯誤碼。如需錯誤碼清單，請參閱 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues)。

## 備註

**XGDecodeDCC** 是軟體 DCC 解碼器的實作，適合用於工具或離線解壓縮。它不是高效能實作，不適合也不打算在執行階段期間使用。

## 需求

**標頭：** xg\_xs.h

**程式庫：** xg\_xs.lib\
**支援的平台**：XBOX Series 主機

## 另請參閱

[xg\_xs](/zh-TW/reference/graphics/xg_xs/xg_xs_members)


## Related topics

- [Barrier (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist7/methods/id3d12graphicscommandlist7_barrier_public.md)
- [DispatchRays (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist4/methods/id3d12graphicscommandlist4_dispatchrays_public.md)
- [RemoveDevice (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device5/methods/id3d12device5_removedevice_public.md)
- [CreateHeap1 (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createheap1_public.md)
- [D3D_NAME (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12_xs/enums/d3d_name.md)
