Order of calling for ReportLiveDeviceObjects (SharpDX)

Started by
0 comments, last by AlexandreMutel 9 years, 9 months ago

I've seen tons of examples on the net about how to get a DebugDevice in SharpDX, and then how at the end, to call ReportLiveDeviceObjects( ). Yet every single example shows a stack of still-instantiated objects. The ID3D11Device always has at least 2 external refcounts on it, and the rest have internal refcounts, but no external refcounts... This seems unclean.

I'd like to know if there is *a* way to "clean up" the DebugDevice so that the DebugDevice knows that ALL of the D3D objects are gone and cleaned up. Kinda like a way to call DebugDevice.SetD3DDevice( null ), or DebugDevice.DisposeYourReferenceToD3D( ), and THEN call ReportLiveDeviceObjects( )! I want a clean log! I haven't seen one example where the log is clean.

I know enough to flush the context, and clear it's state, by the way. This still-having-entries log file is after doing all that.

Possible!?

Advertisement

The ID3D11Device always has at least 2 external refcounts on it, and the rest have internal refcounts, but no external refcounts... This seems unclean.

The external refcount on the device when using DebugDevice is normal, as it is the DebugDevice itself that is probably holding these references, so you can't really avoid them. If everything else has external refcount = 0, it can be considered clean.

When you run the device in debug mode (not using DebugDevice), the d3d11 runtime will output automatically a ReportLiveObject() if there is anything suspicious, but unlike DebugDevice, it is not holding anykind of refcounts on the main device, so if all objects are disposed correctly, you should not get any output. Note that the current auto output seems to be broken on on W8.1 (It doesn't print object type....etc.)

This topic is closed to new replies.

Advertisement