> ## 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](/reference/graphics/d3d12/structs/d3d12_range_public) 结构的指针，该结构描述要取消映射的内存范围。

这表示 CPU 可能已修改的区域，坐标相对于子资源。空指针表示 CPU 可能已修改了整个子资源。通过传递 **End** 小于或等于 **Begin** 的范围来指定 CPU 未写入任何数据是有效的。

此参数仅供工具使用，与实际取消映射操作的正确性无关。

### 返回值

类型：void

无。

## 备注

请参阅 [Map](/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](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)

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

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


## Related topics

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