> ## 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.

# SetResourceCompressionStateX (XBOX One 系列)

> 設定資源的壓縮狀態。

設定資源的壓縮狀態。

## 語法

```cpp theme={null}
void SetResourceCompressionStateX(  
         ID3D12Resource* pResource,  
         D3D12XBOX_COMPRESSION_STATE_FLAGS CompressionStateFlags,  
         D3D12_RESOURCE_STATES PreserveFlags  
)  
```

### 參數

*pResource*   \_Inout\_\
類型：[ID3D12Resource](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12resource/id3d12resource)\*

資源，以指向 **ID3D12Resource** 物件的指標表示。

*CompressionStateFlags*   \_In\_\
類型：[D3D12XBOX\_COMPRESSION\_STATE\_FLAGS](/zh-TW/reference/graphics/d3d12_x/enums/d3d12xbox_compression_state_flags)

指定壓縮狀態的旗標。

*PreserveFlags*   \_In\_\
類型：[D3D12\_RESOURCE\_STATES](/zh-TW/reference/graphics/d3d12_x/enums/d3d12_resource_states)

指定要保留之資源狀態的旗標。

### 傳回值

類型：void

## 需求

**標頭：** d3d12\_x.h

**程式庫：** d3d12\_x.lib

**支援的平台：** XBOX One 系列

## 另請參閱

[ID3D12GraphicsCommandList](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12graphicscommandlist/id3d12graphicscommandlist)


## Related topics

- [SetProtectedResourceSession](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist3/methods/id3d12graphicscommandlist3_setprotectedresourcesession_public.md)
- [SetComputeRootShaderResourceView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setcomputerootshaderresourceview_public.md)
- [SetGraphicsRootShaderResourceView](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setgraphicsrootshaderresourceview_public.md)
- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [SetPipelineState](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setpipelinestate_public.md)
