public void Dispose() { WaitForGpu(); while (delayDestroy.Count > 0) { var p = delayDestroy.Dequeue(); p.pipelineState?.Dispose(); p.resource?.Dispose(); } foreach (var commandAllocator in commandAllocators) { commandAllocator.Dispose(); } if (screenResources != null) { foreach (var screenResource in screenResources) { screenResource.Dispose(); } } dxgiFactory?.Dispose(); commandQueue?.Dispose(); cbvsrvuavHeap?.Dispose(); dsvHeap?.Dispose(); rtvHeap?.Dispose(); swapChain?.Dispose(); fence?.Dispose(); device?.Dispose(); adapter?.Dispose(); }
protected override void PlatformDispose() { // Dispose staging buffers foreach (DeviceBuffer buffer in _availableStagingBuffers) { buffer.Dispose(); } _availableStagingBuffers.Clear(); _d3d11ResourceFactory.Dispose(); _mainSwapchain?.Dispose(); _immediateContext.Dispose(); ID3D11Debug deviceDebug = _device.QueryInterfaceOrNull <ID3D11Debug>(); _device.Dispose(); _dxgiAdapter.Dispose(); // Report live objects using DXGI if available (DXGIGetDebugInterface1 will fail on pre Windows 8 OS). if (VorticeDXGI.DXGIGetDebugInterface1(out IDXGIDebug1 dxgiDebug).Success) { deviceDebug?.Dispose(); dxgiDebug.ReportLiveObjects(VorticeDXGI.All, ReportLiveObjectFlags.Summary | ReportLiveObjectFlags.IgnoreInternal); dxgiDebug.Dispose(); }
protected override void PlatformDispose() { // Dispose staging buffers foreach (DeviceBuffer buffer in _availableStagingBuffers) { buffer.Dispose(); } _availableStagingBuffers.Clear(); _d3d11ResourceFactory.Dispose(); _mainSwapchain?.Dispose(); _immediateContext.Dispose(); ID3D11Debug deviceDebug = _device.QueryInterfaceOrNull <ID3D11Debug>(); _device.Dispose(); _dxgiAdapter?.Dispose(); // Need to enable native debugging to see live objects in VisualStudio console. if (deviceDebug != null) { deviceDebug.ReportLiveDeviceObjects(ReportLiveDeviceObjectFlags.Summary | ReportLiveDeviceObjectFlags.Detail | ReportLiveDeviceObjectFlags.IgnoreInternal); deviceDebug.Dispose(); } }
public void Dispose() { RenderTargetView.Dispose(); BackBuffer.Dispose(); DeviceContext.ClearState(); DeviceContext.Flush(); DeviceContext.Dispose(); Device.Dispose(); SwapChain.Dispose(); Adapter.Dispose(); Factory.Dispose(); if (DXGIGetDebugInterface1(out IDXGIDebug1 dxgiDebug).Success) { dxgiDebug.ReportLiveObjects(All, ReportLiveObjectFlags.Summary | ReportLiveObjectFlags.IgnoreInternal); dxgiDebug.Dispose(); } }
protected override void PlatformDispose() { _d3d11ResourceFactory.Dispose(); _mainSwapchain?.Dispose(); _immediateContext.Dispose(); IDXGIDebug deviceDebug = _device.QueryInterfaceOrNull <IDXGIDebug>(); _device.Dispose(); _dxgiAdapter?.Dispose(); if (deviceDebug != null) { deviceDebug.ReportLiveObjects(DXGI.All, ReportLiveObjectFlags.Summary); deviceDebug.ReportLiveObjects(DXGI.All, ReportLiveObjectFlags.Detail); deviceDebug.Dispose(); } }