Düzenle

Aracılığıyla paylaş


ID3DUserDefinedAnnotation::SetMarker method (d3d11_1.h)

Marks a single point of execution in code.

Syntax

void SetMarker(
  [in] LPCWSTR Name
);

Parameters

[in] Name

A NULL-terminated UNICODE string that contains the name of the marker. The name is not relevant to the operating system. You can choose a name that is meaningful when the calling application is running under the Direct3D profiling tool. A NULL pointer produces undefined results.

Return value

None

Remarks

A user can visualize the marker when the calling application is running under an enabled Direct3D profiling tool such as Microsoft Visual Studio Ultimate 2012.

SetMarker has no effect if the calling application is not running under an enabled Direct3D profiling tool.

Examples

The following code shows how to use SetMarker. It also uses the CComPtr smart pointer type.


CComPtr< ID3D11DeviceContext > pID3D11DeviceContext;

HRESULT hrCreateDevice = (*pfnD3D11CreateDevice)( 
        0,
        D3D_DRIVER_TYPE_NULL,
        0,
        0,
        NULL,
        0,
        D3D11_SDK_VERSION,
        NULL,
        0,
        & pID3D11DeviceContext );
VERIFY_SUCCEEDED(hrCreateDevice);

CComPtr<ID3DUserDefinedAnnotation> pPerf;
HRESULT hr = pID3D11DeviceContext->QueryInterface( __uuidof(pPerf), reinterpret_cast<void**>(&pPerf) );
if ( FAILED( hr ) ) 
    return;
pPerf->SetMarker( L”Occlusion test failed- not drawing sun flare” );

          

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d3d11_1.h
Library D3D11.lib

See also

ID3DUserDefinedAnnotation