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

# ResourceBarrier (XBOX One 系列)

> 通知驅動程式需要同步處理對資源的多重存取，例如同步處理對相同紋理的讀取和寫入。

通知驅動程式需要同步處理對資源的多重存取。

## 語法

```cpp theme={null}
void ResourceBarrier(  
         UINT NumBarriers,  
         const D3D12_RESOURCE_BARRIER* pBarriers  
)  
```

### 參數

*NumBarriers*   \_In\_\
類型：UINT

已提交的屏障描述數目。

*pBarriers*   \_In\_reads\_(NumBarriers)\
類型：[D3D12\_RESOURCE\_BARRIER\*](https://msdn.microsoft.com/library/dn986740\(v=vs.85\).aspx)

指向包含資源屏障描述之 **D3D12\_RESOURCE\_BARRIER** 結構陣列的指標。

### 傳回值

類型：void

## 備註

此方法的一個使用範例是同步處理對相同紋理的讀取和寫入。如需使用方式的詳細資訊，請參閱標準 Direct3D 12 文件中的 [ID3D12GraphicsCommandList::ResourceBarrier](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-resourcebarrier)。

如需 Windows PC 與 Microsoft Game Development Kit (GDK) 之間差異的相關資訊，請參閱 [Windows PC 上的 Direct3D 12 與 Microsoft Game Development Kit (GDK) 之間的差異](https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/graphics/d3d12x/d3d12x-differences-from-pc)中的「資源屏障」一節。

## 需求

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

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

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

## 另請參閱

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


## Related topics

- [D3D12_RESOURCE_BARRIER](/zh-CN/reference/graphics/d3d12/structs/d3d12_resource_barrier_public.md)
- [D3D12_RESOURCE_BARRIER_TYPE](/zh-CN/reference/graphics/d3d12/enums/d3d12_resource_barrier_type_public.md)
- [D3D12_RESOURCE_ALIASING_BARRIER](/zh-CN/reference/graphics/d3d12/structs/d3d12_resource_aliasing_barrier_public.md)
- [D3D12_RESOURCE_TRANSITION_BARRIER](/zh-CN/reference/graphics/d3d12/structs/d3d12_resource_transition_barrier_public.md)
- [D3D12_RESOURCE_UAV_BARRIER](/zh-CN/reference/graphics/d3d12/structs/d3d12_resource_uav_barrier_public.md)
