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

> Invalidates the CPU pointer to the specified subresource in the resource.

Invalidates the CPU pointer to the specified subresource in the resource.

## Syntax

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

### Parameters

*Subresource*\
Type: UINT

Specifies the index of the subresource.

*pWrittenRange \[in, optional]*\
Type: const D3D12\_RANGE \*

A pointer to a [D3D12\_RANGE](/reference/graphics/d3d12/structs/d3d12_range_public) structure that describes the range of memory to unmap.

This indicates the region the CPU might have modified, and the coordinates are subresource-relative. A null pointer indicates the entire subresource might have been modified by the CPU. It is valid to specify the CPU didn't write any data by passing a range where **End** is less than or equal to **Begin**.

This parameter is only used by tooling, and not for correctness of the actual unmap operation.

### Return value

Type: void

None.

## Remarks

Refer to the extensive Remarks and Examples for the [Map](/reference/graphics/d3d12/interfaces/id3d12resource/methods/id3d12resource_map_public) method.

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[ID3D12Resource](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)

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

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


## Related topics

- [Map](/reference/graphics/d3d12/interfaces/id3d12resource/methods/id3d12resource_map_public.md)
- [D3D12_RANGE](/reference/graphics/d3d12/structs/d3d12_range_public.md)
- [XMemMapPhysicalPagesScatter](/reference/system/xmem/functions/xmemmapphysicalpagesscatter.md)
- [Working with the Microsoft GDK Game OS memory manager](/build/console-features/memory/system-memory-working.md)
