Is there a way to call SetPrivateData on a ID3DUserDefinedAnnotation?

372 views Asked by At

I'm trying to name every COM object instantiated by DXGI or D3D11 in my application so they can be viewed nicely in debuggers.

I'm stuck on the ID3DUserDefinedAnnotation interface, queried from the ID3D11DeviceContext. I cannot find an interface exposing SetPrivateData for this object.

What's the way to set the debugger name of this object?

1

There are 1 answers

3
Ross Ridge On

QueryInterface only returns interfaces to the same object as the one being queried. That means in order to set the debugger name of the object referred to by an ID3DUserDefinedAnnotation interface, you need to use ID3D11DeviceContext::SetPrivateData. If necessary, you can use ID3DUserDefinedAnnotation::QueryInterface to obtain an ID3D11DeviceContext interface to the object.