public void Dispose() { _vertexBuffer.Dispose(); _vertexShader.Dispose(); _pixelShader.Dispose(); _inputLayout.Dispose(); BackBufferTexture?.Dispose(); OffscreenTexture?.Dispose(); RenderTargetView.Dispose(); DepthStencilTexture?.Dispose(); DepthStencilView?.Dispose(); DeviceContext.ClearState(); DeviceContext.Flush(); DeviceContext.Dispose(); Device.Dispose(); SwapChain?.Dispose(); Factory.Dispose(); #if DEBUG if (DXGIGetDebugInterface1(out IDXGIDebug1? dxgiDebug).Success) { dxgiDebug !.ReportLiveObjects(DebugAll, ReportLiveObjectFlags.Summary | ReportLiveObjectFlags.IgnoreInternal); dxgiDebug !.Dispose(); } #endif }
public void Dispose() { RenderTargetView.Dispose(); BackBuffer.Dispose(); DeviceContext.ClearState(); DeviceContext.Flush(); DeviceContext.Dispose(); Device.Dispose(); SwapChain.Dispose(); Factory.Dispose(); if (DXGIGetDebugInterface1(out IDXGIDebug1 dxgiDebug).Success) { dxgiDebug.ReportLiveObjects(All, ReportLiveObjectFlags.Summary | ReportLiveObjectFlags.IgnoreInternal); dxgiDebug.Dispose(); } }
protected override void Destroy() { ((CommandQueueD3D11)_copyCommandQueue).Destroy(); ((CommandQueueD3D11)_computeCommandQueue).Destroy(); ((CommandQueueD3D11)_graphicsCommandQueue).Destroy(); var deviceDebug = D3D11Device.QueryInterfaceOrNull <ID3D11Debug>(); if (deviceDebug != null) { deviceDebug.ReportLiveDeviceObjects(ReportLiveDeviceObjectFlags.Summary); deviceDebug.Dispose(); } D3D11Device1?.Dispose(); D3D11Device.Dispose(); }
public void Dispose() { BackBufferTexture?.Dispose(); OffscreenTexture?.Dispose(); RenderTargetView.Dispose(); DeviceContext.ClearState(); DeviceContext.Flush(); DeviceContext.Dispose(); Device.Dispose(); SwapChain.Dispose(); Factory?.Dispose(); if (DXGIGetDebugInterface1(out IDXGIDebug1? dxgiDebug).Success) { dxgiDebug !.ReportLiveObjects(DebugAll, ReportLiveObjectFlags.Summary | ReportLiveObjectFlags.IgnoreInternal); dxgiDebug !.Dispose(); } }
public void Dispose() { _vertexBuffer.Dispose(); _vertexShader.Dispose(); _pixelShader.Dispose(); _inputLayout.Dispose(); BackBufferTexture?.Dispose(); OffscreenTexture?.Dispose(); RenderTargetView.Dispose(); DepthStencilTexture?.Dispose(); DepthStencilView?.Dispose(); DeviceContext.ClearState(); DeviceContext.Flush(); DeviceContext.Dispose(); SwapChain?.Dispose(); #if DEBUG uint refCount = Device.Release(); if (refCount > 0) { System.Diagnostics.Debug.WriteLine($"Direct3D11: There are {refCount} unreleased references left on the device"); ID3D11Debug?d3d11Debug = Device.QueryInterfaceOrNull <ID3D11Debug>(); if (d3d11Debug != null) { d3d11Debug.ReportLiveDeviceObjects(ReportLiveDeviceObjectFlags.Detail | ReportLiveDeviceObjectFlags.IgnoreInternal); d3d11Debug.Dispose(); } } #else Device.Dispose(); #endif Factory.Dispose(); #if DEBUG if (DXGIGetDebugInterface1(out IDXGIDebug1? dxgiDebug).Success) { dxgiDebug !.ReportLiveObjects(DebugAll, ReportLiveObjectFlags.Summary | ReportLiveObjectFlags.IgnoreInternal); dxgiDebug !.Dispose(); } #endif }