Exemple #1
0
        public void Dispose()
        {
            if (!disposed)
            {
                //Wait for all rendering to stop before we start disposing of resources
                logicalDevice.WaitIdle();

                //Dispose of the synchronization objects
                imageAvailableSemaphore.Dispose();
                renderFinishedSemaphore.Dispose();
                waitFences.DisposeAll();

                //Dispose of the scene resources
                scene?.Dispose();

                //Dispose of the swapchain
                swapchainTextures.DisposeAll();
                swapchain.Dispose();

                //Dispose of command-pool (will automatically also dispose of the commandbuffers that
                //where recreated from it)
                commandPool.Dispose();

                //Dispose the Vulkan device and dispose of the os window
                logicalDevice.Dispose();
                nativeWindow.Dispose();
                disposed = true;
            }
        }
Exemple #2
0
        private void TearDown()
        {
            device.WaitIdle();

            renderFinishedSemaphore.Dispose();
            renderFinishedSemaphore = null;

            imageAvailableSemaphore.Dispose();
            imageAvailableSemaphore = null;

            vertexBufferMemory.Free();
            vertexBufferMemory = null;

            vertexBuffer.Dispose();
            vertexBuffer = null;

            commandPool.Dispose();
            commandPool = null;

            foreach (var frameBuffer in frameBuffers)
            {
                frameBuffer.Dispose();
            }
            frameBuffers = null;

            fragShader.Dispose();
            fragShader = null;

            vertShader.Dispose();
            vertShader = null;

            pipeline.Dispose();
            pipeline = null;

            pipelineLayout.Dispose();
            pipelineLayout = null;

            foreach (var imageView in swapChainImageViews)
            {
                imageView.Dispose();
            }
            swapChainImageViews = null;

            renderPass.Dispose();
            renderPass = null;

            swapChain.Dispose();
            swapChain = null;

            device.Dispose();
            device = null;

            surface.Dispose();
            surface = null;

            instance.Dispose();
            instance = null;
        }
Exemple #3
0
        public void Dispose()
        {
            ThrowIfDisposed();

            transientBuffer.Dispose();
            commandPool.Dispose();
            fence.Dispose();
            disposed = true;
        }
Exemple #4
0
 /// <summary>
 /// Dispose the object and free its resources
 /// </summary>
 public void Dispose()
 {
     if (Disposed)
     {
         return;
     }
     Disposed = true;
     if (HasCommandPool)
     {
         CommandPool?.Dispose();
     }
 }
Exemple #5
0
        /// <inheritdoc />
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                _purgeCommandPool.Dispose();
                _getContentHashListCommandPool.Dispose();
                _getSelectorsCommandPool.Dispose();
                _replaceCommandPool.Dispose();
                _touchPartitionCommandPool.Dispose();
                _touchSingleCommandPool.Dispose();
                _directoryLock.Dispose();
                _fileSystem.Dispose();

                _disposed = true;
            }

            base.Dispose(disposing);
        }
Exemple #6
0
        public void Dispose()
        {
            if (_disposed)
            {
                return;
            }

            Output.Dispose();
            Inputs.ForEach(input => input.Dispose());
            _descriptorPool.Dispose();
            _pipeline.Dispose();
            _pipelineLayout.Dispose();
            _descriptorSetLayout.Dispose();
            _commandPool.Dispose();
            _fence.Dispose();

            _disposed = true;
        }
 public void Cleanup()
 {
     /*
      * Clean up all Vulkan Resources.
      */
     bufferMemory.Dispose();
     buffer.Dispose();
     computeShaderModule.Dispose();
     descriptorPool.Dispose();
     descriptorSetLayout.Dispose();
     pipelineLayout.Dispose();
     foreach (Pipeline pipeline in pipelines)
     {
         pipeline.Dispose();
     }
     commandPool.Dispose();
     device.Dispose();
     instance.Dispose();
 }
Exemple #8
0
 public override void Dispose()
 {
     CommandPool.Dispose();
     base.Dispose();
 }