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

# ID3D12GraphicsCommandList::BeginEvent

> 不应直接调用。使用 PIX 事件运行时将事件插入命令列表。(ID3D12GraphicsCommandList.BeginEvent)

不应直接调用。使用
[PIX 事件运行时](https://devblogs.microsoft.com/pix/winpixeventruntime/)将事件插入命令列表。

## 语法

```cpp theme={null}
void BeginEvent(
    UINT Metadata,
    const void  pData,
    UINT Size
)
```

### 参数

*Metadata*\
类型：UINT

内部。

*pData \[in, optional]*\
类型：const void \*

内部。

*Size*\
类型：UINT

内部。

### 返回值

类型：void

无。

## 备注

这是 PIX 事件运行时内部使用的一种支持方法。不应直接调用它。

要在 D3D12 命令列表中的当前位置标记检测区域的开始，请使用 **PIXBeginEvent** 函数或 **PIXScopedEvent** 宏。它们由 [WinPixEventRuntime](https://devblogs.microsoft.com/pix/winpixeventruntime/) NuGet 包提供。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h\
**库：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支持的平台**：XBOX Series 主机和 XBOX One 系列

## 另请参阅

[ID3D12GraphicsCommandList](/reference/graphics/d3d12_xs/interfaces/ID3D12GraphicsCommandList/id3d12graphicscommandlist_xs)


## Related topics

- [PIXBeginEvent 参考](/zh-CN/reference/tools/pix3/functions/pixbeginevent_3.md)
- [PIXBeginEvent 概览](/zh-CN/reference/tools/pix3/functions/pixbeginevent_4.md)
- [PIXBeginRetailEvent](/zh-CN/reference/tools/pix3/functions/pixbeginretailevent_2.md)
- [PIXBeginRetailEvent 函数](/zh-CN/reference/tools/pix3/functions/pixbeginretailevent.md)
- [BeginQuery](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_beginquery_public.md)
