Beispiel #1
0
        protected override void Destroy()
        {
            WaitIdle();

            _shuttingDown = true;
            _frameFence.Dispose();
            GraphicsQueue.Dispose();

            // Clear DescriptorHeap Pools.
            lock (_heapAllocationLock)
            {
                foreach (var heap in _descriptorHeapPool)
                {
                    heap.Dispose();
                }

                _descriptorHeapPool.Clear();
            }

            if (Validation)
            {
                var debugDevice = D3D12Device.QueryInterfaceOrNull <ID3D12DebugDevice>();
                if (debugDevice != null)
                {
                    debugDevice.ReportLiveDeviceObjects(ReportLiveDeviceObjectFlags.Detail);
                    debugDevice.Dispose();
                }
            }

            D3D12Device.Dispose();
        }
Beispiel #2
0
 public void Dispose()
 {
     _d3d11DeviceContext?.Dispose();
     _d3d11Device?.Dispose();
     _d3d12Device?.Dispose();
     _dxgiFactory.Dispose();
 }