Click or drag to resize
AB4D logo

DXDiagnosticsReportLiveDeviceObjectsOnDispose Property

Gets or sets a static Boolean that specifies if ReportLiveDeviceObjects method is called when the DirectX device is disposed. This method reports all live (not disposed) DirectX objects to the Visual Studio Output window. CreateDebugDirectXDevice must be set to true and DirectX debug layer must be enabled for this property to work. See remarks for more info.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.1.9105.2048 (1.0.0.0)
Syntax
C#
public static bool ReportLiveDeviceObjectsOnDispose { get; set; }

Property Value

Boolean
Remarks

ReportLiveDeviceObjectsOnDispose gets or sets a static Boolean that specifies if ReportLiveDeviceObjects method is called when the DirectX device is disposed.

CreateDebugDirectXDevice must be set to true for this property to work (ReportLiveDeviceObjects method is available only when a debug DirectX device is created; this also required DirectX debug layer to be enabled).

This method reports all live (not disposed) DirectX objects to the Visual Studio Output window.

To see if there are any undisposed objects, you need to check if the "Refcount" number is bigger than 0. This means that there are still some outer references to that object. If "IntRef" is bigger than zero, than this is not a problem because this shows internal references that will be automatically disposed. To show this report, there still need to be some outer references live for ID3D11Device (usually 6) and ID3D11Context (usually 1). So if you see some references there, this is not a problem because those references will be released when the DXDevice is disposed.

The following shows a sample report output (note that the last line shows one live reference to the DirectionalLightShader_perObjectNoWVPConstantsBuffer):

C#
D3D11 WARNING: Live ID3D11Device at 0x0C5CED14, Refcount: 6 [ STATE_CREATION WARNING #441: LIVE_DEVICE]
D3D11 WARNING:     Live ID3D11Context at 0x0C5CFC40, Refcount: 1, IntRef: 1 [STATE_CREATION WARNING #2097226: LIVE_CONTEXT]
D3D11 WARNING:     Live ID3DDeviceContextState at 0x0C6BF6F8, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #3145742: LIVE_DEVICECONTEXTSTATE]
D3D11 WARNING:     Live ID3D11BlendState at 0x0C6C5674, Name: Opaque, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #435: LIVE_BLENDSTATE]
D3D11 WARNING:     Live ID3D11DepthStencilState at 0x0C6C608C, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #436: LIVE_DEPTHSTENCILSTATE]
D3D11 WARNING:     Live ID3D11RasterizerState at 0x0C6C6824, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #437: LIVE_RASTERIZERSTATE]
D3D11 WARNING:     Live ID3D11Sampler at 0x0C6C63DC, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #434: LIVE_SAMPLER]
D3D11 WARNING:     Live ID3D11Query at 0x0C5BDA64, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #438: LIVE_QUERY]
D3D11 WARNING:     Live ID3D11DepthStencilState at 0x0C6C5EE4, Name: DepthReadWrite, Refcount: 0, IntRef: 0 [STATE_CREATION WARNING #436: LIVE_DEPTHSTENCILSTATE]
D3D11 WARNING:     Live ID3D11RasterizerState at 0x0E4A9764, Name: CullClockwise, Refcount: 0, IntRef: 0 [STATE_CREATION WARNING #437: LIVE_RASTERIZERSTATE]
D3D11 WARNING:     Live ID3D11Texture2D at 0x0C6CABEC, Name: MSAABackBuffer, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #425: LIVE_TEXTURE2D]
D3D11 WARNING:     Live ID3D11RenderTargetView at 0x0C6CAF04, Name: MSAABackBufferRenderTargetView, Refcount: 0, IntRef: 0 [STATE_CREATION WARNING #428: LIVE_RENDERTARGETVIEW]
D3D11 WARNING:     Live ID3D11Texture2D at 0x0E4C2F2C, Refcount: 0, IntRef: 1 [STATE_CREATION WARNING #425: LIVE_TEXTURE2D]
D3D11 WARNING:     Live ID3D11DepthStencilView at 0x0C6A5544, Name: DepthStencilView, Refcount: 0, IntRef: 0 [STATE_CREATION WARNING #429: LIVE_DEPTHSTENCILVIEW]
D3D11 WARNING:     Live ID3D11Buffer at 0x0C3C0FCC, Name: DirectionalLightShader_perFrameCameraConstantsBuffer, Refcount: 0, IntRef: 0 [STATE_CREATION WARNING #423: LIVE_BUFFER]
D3D11 WARNING:     Live ID3D11Buffer at 0x0E70AB0C, Name: DirectionalLightShader_perFrameDirectionalLightsConstantsBuffer, Refcount: 0, IntRef: 0 [STATE_CREATION WARNING #423: LIVE_BUFFER]
D3D11 WARNING:     Live ID3D11Buffer at 0x0E7111AC, Name: DirectionalLightShader_perObjectNoWVPConstantsBuffer, Refcount: 1, IntRef: 0 [STATE_CREATION WARNING #423: LIVE_BUFFER]
See Also