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

Inserts a marker into the GPU timeline in the PIX System Timing Capture window, when a particular user-defined event occurs.

## Syntax

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

### Parameters

*context*   \
Type: void\*

Context for the event, accepts 1ID3D12GraphicsCommandList\*`,`ID3D12CommandQueue\*`and`ID3D12XboxDmaCommandList\*\` (XBOX only).

*color*   \
Type: UINT64

The color that will be used in the timing chart when this event occurs in PIX windows.

Use [PIX\_COLOR](/reference/tools/pix3/functions/pix_color) to specify a color, use [PIX\_COLOR\_INDEX](/reference/tools/pix3/functions/pix_color_index) to specify a color index, or pass in a raw DWORD noting that the format is ARGB and the alpha channel value must be 0xff.

*formatString*   \_In\_\
Type: PCSTR

The name to use to describe the event. The string may specify zero or more optional string format placeholders, very similar to **sprintf** formatting.

Type: ...

If placeholders are used in *formatString*, there must be a corresponding number of parameters (up to a maximum of 16) whose types match the placeholders.

### Return value

Type: void

## Remarks

The `PIXSetMarker` function saves format string and format parameters instead of formatting the string at runtime. Formatting is then done when reading capture file in PIX. Use 16-byte aligned strings (preferable) or 8-byte aligned strings with `PIXSetMarker` to get the best performance. To print a char\* or wchar\_t\* as a pointer using %p format specifier, cast pointer to void\* or a pointer to an integral or a floating point type when passing it to `PIXSetMarker`. Any call to `PIXSetMarker` has guaranteed at least 512 bytes of space to save the record data.

The event will be shown as having no duration, and will be represented by a single line (a single vertical bar) in the **PIX System Timing Capture** window.

This function is used to mark events in the GPU timeline. To mark events in the CPU timeline, call the [first overload of the PIXSetMarker function](/reference/tools/pix3/functions/pixsetmarker) or the [second overload of the PIXSetMarker function](/reference/tools/pix3/functions/pixsetmarker_2).

Calls to `PIXSetMarker` can occur anywhere, and do not have to follow a call to [PIXBeginEvent](/reference/tools/pix3/functions/pixbeginevent).

## Requirements

**Header:** pix3.h

**Library:** pixevt.lib

**Supported platforms:** XBOX One family consoles and XBOX Series consoles

## 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](/reference/tools/pix3/functions/pixsetmarker-overloads.md)
- [PIXSetMarker function](/reference/tools/pix3/functions/pixsetmarker.md)
- [PIXSetMarker reference](/reference/tools/pix3/functions/pixsetmarker_2.md)
- [PIXSetMarker overview](/reference/tools/pix3/functions/pixsetmarker_4.md)
- [PIXSetRetailMarker function](/reference/tools/pix3/functions/pixsetretailmarker.md)
