ID3D11UserDefinedAnnotationX Interface

The ID3D11UserDefinedAnnotationX interface enables an application to describe conceptual sections and markers within the application’s code flow. An appropriately enabled tool can display these sections and markers visually along the tool’s Microsoft Direct3D time line, while the tool debugs the application. These visual notes allow users of such a tool to navigate to parts of the time line that are of interest, or to understand what set of Microsoft Direct3D calls are produced by certain sections of the application’s code.

Syntax

interface ID3D11UserDefinedAnnotationX : public ID3D11DeviceContextX  

Remarks

The methods of ID3D11UserDefinedAnnotationX have no effect when the calling application is not running under a Microsoft Direct3D-specific profiling tool.

The ID3D11UserDefinedAnnotationX interface is published by Microsoft Direct3D 11 device contexts. Therefore, ID3D11UserDefinedAnnotationX has the same threading rules as the ID3D11DeviceContext interface, or any other context interface. For more information about Microsoft Direct3D threading, see MultiThreading. To retrieve the ID3D11UserDefinedAnnotationX interface for the context, call the QueryInterface method for the context (for example, ID3D11DeviceContext::QueryInterface). In this call, you must pass the identifier of ID3D11UserDefinedAnnotationX.

The ID3D11UserDefinedAnnotationX interface is the Microsoft Direct3D 10 and later equivalent of the Direct3D 9 PIX functions (D3DPERF_* functions).

Note

Setting the D3D11_CREATE_DEVICE_PREVENT_ALTERING_LAYER_SETTINGS_FROM_REGISTRY flag in your app (this flag is supported for Windows only, not Xbox One) replaces calling D3DPerf_SetOptions(1). But, to prevent Microsoft Direct3D debugging tools from hooking your app, your app can also call ID3D11UserDefinedAnnotationX::GetStatus to determine whether it is running under a Microsoft Direct3D debugging tool and then exit accordingly.

You must call the BeginEvent and EndEvent methods in pairs; pairs of calls to these methods can nest within pairs of calls to these methods at a higher level in the application’s call stack. In other words, a “Draw World” section can entirely contain another section named “Draw Trees,” which can in turn entirely contain a section called “Draw Oaks.” You can only associate an EndEvent method with the most recent BeginEvent method, that is, pairs cannot overlap. You cannot call an EndEvent for any BeginEvent that preceded the most recent BeginEvent. In fact, the runtime interprets the first EndEvent as ending the second BeginEvent.

Requirements

Header: Declared in d3d11_x.h.

Library: Use d3d11_x.lib.

See also

Reference

ID3DUserDefinedAnnotation

ID3D11UserDefinedAnnotationX Members