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

# PIXSetMarker function reference

> PIXSetMarker function reference

# PIXSetMarker function reference

特定のユーザー定義イベントが発生したときに、PIX System Timing Capture ウィンドウの GPU タイムラインへマーカーを挿入します。

## Syntax

```cpp theme={null}
void PIXSetMarker(  
         void* context,  
         UINT64 color,  
         PCSTR formatString,  
         ...  
)  
```

### Parameters

*context*   \
型: void\*

イベントのコンテキスト。1ID3D12GraphicsCommandList\*` 、`ID3D12CommandQueue\*`、および`ID3D12XboxDmaCommandList\*\` (XBOX のみ) を受け付けます。

*color*   \
型: UINT64

このイベントが PIX ウィンドウで発生したときにタイミング チャートで使用される色。

色を指定するには [PIX\_COLOR](/reference/tools/pix3/functions/pix_color) を使用し、カラー インデックスを指定するには [PIX\_COLOR\_INDEX](/reference/tools/pix3/functions/pix_color_index) を使用します。また、生の DWORD を渡すこともできますが、この形式は ARGB であり、アルファ チャネルの値は 0xff である必要があります。

*formatString*   \_In\_\
型: PCSTR

イベントを説明するために使用する名前。この文字列は、**sprintf** の書式指定に似た省略可能な文字列書式プレースホルダーを 0 個以上指定できます。

型: ...

*formatString* にプレースホルダーが使用されている場合、それに対応する個数 (最大 16 個) のパラメーターを、プレースホルダーと一致する型で指定する必要があります。

### Return value

型: void

## Remarks

`PIXSetMarker` 関数は、実行時に文字列を書式化するのではなく、書式文字列と書式パラメーターを保存します。書式化は、PIX でキャプチャ ファイルを読み取るときに行われます。パフォーマンスを最大化するには、`PIXSetMarker` で 16 バイト境界に整列された文字列 (推奨)、または 8 バイト境界に整列された文字列を使用します。%p 書式指定子を使用して char\* または wchar\_t\* をポインターとして出力するには、`PIXSetMarker` に渡すときにポインターを void\*、整数型へのポインター、または浮動小数点型へのポインターにキャストしてください。`PIXSetMarker` の呼び出しには、レコード データを保存するために少なくとも 512 バイトの領域が確保されることが保証されます。

イベントは持続時間がないものとして表示され、**PIX System Timing Capture** ウィンドウでは 1 本の線 (1 本の垂直バー) で表現されます。

この関数は、GPU タイムラインでイベントをマークするために使用されます。CPU タイムラインでイベントをマークするには、[PIXSetMarker 関数の 1 番目のオーバーロード](/reference/tools/pix3/functions/pixsetmarker) または [PIXSetMarker 関数の 2 番目のオーバーロード](/reference/tools/pix3/functions/pixsetmarker_2) を呼び出してください。

`PIXSetMarker` の呼び出しはどこにでも配置でき、[PIXBeginEvent](/reference/tools/pix3/functions/pixbeginevent) の呼び出しに続いて行う必要はありません。

## Requirements

**ヘッダー:** pix3.h

**ライブラリ:** pixevt.lib

**サポートされているプラットフォーム:** XBOX One ファミリー本体および XBOX Series 本体

## See also

[PIXSetMarker](/reference/tools/pix3/functions/pixsetmarker)\
[PIXSetMarker\_2](/reference/tools/pix3/functions/pixsetmarker_2)\
[PIXSetMarker\_4](/reference/tools/pix3/functions/pixsetmarker_4)\
[PIX3](/reference/tools/pix3/pix3_members)\
[PIX (NDA topic)](/tools/tools-console/pix/pix)


## Related topics

- [PIXSetMarker](/ja-jp/reference/tools/pix3/functions/pixsetmarker-overloads.md)
- [PIXSetMarker reference](/ja-jp/reference/tools/pix3/functions/pixsetmarker_2.md)
- [PIXSetMarker overview](/ja-jp/reference/tools/pix3/functions/pixsetmarker_4.md)
- [PIXSetMarker 関数](/ja-jp/reference/tools/pix3/functions/pixsetmarker.md)
- [PIXSetRetailMarker function](/ja-jp/reference/tools/pix3/functions/pixsetretailmarker.md)
