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

> 描述丢弃资源操作的详细信息。

描述丢弃资源操作的详细信息。

## 语法

```cpp theme={null}
typedef struct D3D12_DISCARD_REGION
{
    UINT NumRects;
    const D3D12_RECT  pRects;
    UINT FirstSubresource;
    UINT NumSubresources;
} D3D12_DISCARD_REGION
```

### 成员

*NumRects*\
类型:UINT

**pRects** 成员指定的数组中矩形的数量。

*pRects*\
类型:const D3D12\_RECT \*

**D3D12\_RECT** 结构的数组,表示要丢弃的资源中的矩形。
如果为 **NULL**,则 [DiscardResource](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_discardresource_public) 会丢弃整个资源。

*FirstSubresource*\
类型:UINT

要丢弃的资源中第一个子资源的索引。

*NumSubresources*\
类型:UINT

要丢弃的资源中子资源的数量。

## 备注

此结构由 [ID3D12GraphicsCommandList::DiscardResource](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_discardresource_public) 方法使用。

如果在此结构中提供了矩形,则该资源必须包含 2D 子资源,并且所有指定的子资源具有相同的维度。

## 要求

**头文件:** 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)


## Related topics

- [D3D12_MIP_REGION](/zh-CN/reference/graphics/d3d12/structs/d3d12_mip_region_public.md)
- [D3D12_TILE_REGION_SIZE](/zh-CN/reference/graphics/d3d12/structs/d3d12_tile_region_size_public.md)
- [D3D12_BOX](/zh-CN/reference/graphics/d3d12/structs/d3d12_box_public.md)
- [D3D12_RESOLVE_MODE](/zh-CN/reference/graphics/d3d12/enums/d3d12_resolve_mode_public.md)
- [D3D12_RESOURCE_DESC1](/zh-CN/reference/graphics/d3d12/structs/d3d12_resource_desc1_public.md)
