D3DPERF_BeginEvent

Marks the beginning of a user-defined event. PIX can use this event to trigger an action.

int D3DPERF_BeginEvent(
  D3DCOLOR col,
  LPCWSTR wszName
);

Parameters

col
Event color. This is the color to display the event in the event view.
wszName
Event name.

Return Values

The zero-based level of the hierarchy that this event is starting in. If an error occurs, the return value will be negative.

Remarks

User-defined events group together other events in a way that is meaningful to the target program so they can be better represented in performance profiling tools. For example, a "Draw Spaceship" event might bracket a number of Direct3D calls that handle drawing a spaceship in a game. Events can be nested.

Each D3DPERF_BeginEvent call should have a matching D3DPERF_EndEvent call. Instantaneous events (which do not bracket other events) should be labeled using D3DPERF_SetMarker rather than using D3DPERF_BeginEvent and D3DPERF_EndEvent.

Requirements

Header: Declared in D3d9.h.

See Also

PIX