Esempio n. 1
0
        public unsafe void Dispose()
        {
            CommandBufferPool.Dispose();
            _counters.Dispose();
            _window.Dispose();
            HelperShader.Dispose();
            _pipeline.Dispose();
            BufferManager.Dispose();
            DescriptorSetManager.Dispose();
            PipelineLayoutCache.Dispose();

            SurfaceApi.DestroySurface(_instance, _surface, null);

            MemoryAllocator.Dispose();

            if (_debugReportCallback.Handle != 0)
            {
                DebugReportApi.DestroyDebugReportCallback(_instance, _debugReportCallback, null);
            }

            foreach (var shader in Shaders)
            {
                shader.Dispose();
            }

            foreach (var texture in Textures)
            {
                texture.Release();
            }

            foreach (var sampler in Samplers)
            {
                sampler.Dispose();
            }

            Api.DestroyDevice(_device, null);

            // Last step destroy the instance
            Api.DestroyInstance(_instance, null);
        }
Esempio n. 2
0
 public void Dispose()
 {
     _pool?.Dispose();
     _flushBuffer?.Dispose();
 }