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

# Unmap

> 使資源中指定子資源的 CPU 指標失效。

使資源中指定子資源的 CPU 指標失效。

## 語法

```cpp theme={null}
void Unmap(
    UINT Subresource,
    const D3D12_RANGE  pWrittenRange
)
```

### 參數

*Subresource*\
類型：UINT

指定子資源的索引。

*pWrittenRange \[in, optional]*\
類型：const D3D12\_RANGE \*

指向 [D3D12\_RANGE](/zh-TW/reference/graphics/d3d12/structs/d3d12_range_public) 結構的指標，該結構描述要解除對應的記憶體範圍。

這表示 CPU 可能已修改的區域，且座標是相對於子資源。Null 指標表示 CPU 可能已修改整個子資源。傳遞 **End** 小於或等於 **Begin** 的範圍，以指定 CPU 未寫入任何資料，是有效的做法。

此參數僅供工具使用，與實際解除對應作業的正確性無關。

### 傳回值

類型：void

無。

## 備註

請參閱 [Map](/zh-TW/reference/graphics/d3d12/interfaces/id3d12resource/methods/id3d12resource_map_public) 方法中詳盡的＜備註＞和＜範例＞。

## 需求

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

## 另請參閱

[ID3D12Resource](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)

[Map](/zh-TW/reference/graphics/d3d12/interfaces/id3d12resource/methods/id3d12resource_map_public)

[子資源](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/subresources)


## Related topics

- [Map](/zh-TW/reference/graphics/d3d12/interfaces/id3d12resource/methods/id3d12resource_map_public.md)
- [D3D12_RANGE](/zh-TW/reference/graphics/d3d12/structs/d3d12_range_public.md)
