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

# D3D12_RESOURCE_TRANSITION_BARRIER

> 描述子資源在不同用途之間的轉換。

描述子資源在不同用途之間的轉換。

## 語法

```cpp theme={null}
typedef struct D3D12_RESOURCE_TRANSITION_BARRIER
{
    ID3D12Resource  pResource;
    UINT Subresource;
    D3D12_RESOURCE_STATES StateBefore;
    D3D12_RESOURCE_STATES StateAfter;
} D3D12_RESOURCE_TRANSITION_BARRIER
```

### 成員

*pResource*\
類型：ID3D12Resource \*

指向 [ID3D12Resource](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs) 物件的指標，代表轉換中使用的資源。

*Subresource*\
類型：UINT

轉換的子資源索引。
使用 **D3D12\_RESOURCE\_BARRIER\_ALL\_SUBRESOURCES** 旗標 ( 0xffffffff ) 可同時轉換資源中的所有子資源。

*StateBefore*\
類型：D3D12\_RESOURCE\_STATES

子資源的 "轉換前" 用途，為 [D3D12\_RESOURCE\_STATES](/zh-TW/reference/graphics/d3d12_x/enums/d3d12_resource_states) 列舉常數的位元 OR 運算組合。

*StateAfter*\
類型：D3D12\_RESOURCE\_STATES

子資源的 "轉換後" 用途，為 [D3D12\_RESOURCE\_STATES](/zh-TW/reference/graphics/d3d12_x/enums/d3d12_resource_states) 列舉常數的位元 OR 運算組合。

## 備註

此結構由
[D3D12\_RESOURCE\_BARRIER](/zh-TW/reference/graphics/d3d12/structs/d3d12_resource_barrier_public) 結構的 **Transition** 成員使用。

## 需求

**標頭:** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫:** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**: XBOX Series 主機與 XBOX One 系列

## 另請參閱

[核心結構](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)

[在 Direct3D 12 中使用資源屏障同步處理資源狀態](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/using-resource-barriers-to-synchronize-resource-states-in-direct3d-12)


## Related topics

- [D3D12_RESOURCE_BARRIER](/zh-TW/reference/graphics/d3d12/structs/d3d12_resource_barrier_public.md)
- [D3D12_RESOURCE_BARRIER_TYPE](/zh-TW/reference/graphics/d3d12/enums/d3d12_resource_barrier_type_public.md)
- [D3D12_RESOURCE_ALIASING_BARRIER](/zh-TW/reference/graphics/d3d12/structs/d3d12_resource_aliasing_barrier_public.md)
- [D3D12_RESOURCE_UAV_BARRIER](/zh-TW/reference/graphics/d3d12/structs/d3d12_resource_uav_barrier_public.md)
- [D3D12_TEXTURE_BARRIER (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/structs/d3d12_texture_barrier_public.md)
