Ejemplo n.º 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;
            }
        }
Ejemplo n.º 2
0
        internal void Build()
        {
            GraphicsCommandPool?.Reset();
            ComputeCommandPool?.Reset();

            ImageAvailableSemaphore?.Dispose();
            RenderingFinishedSemaphore?.Dispose();
            Swapchain?.Dispose();

            ImageAvailableSemaphore    = ToDispose(Device.CreateSemaphore());
            RenderingFinishedSemaphore = ToDispose(Device.CreateSemaphore());

            Swapchain = ToDispose(VKHelper.CreateSwapchain(this));
            CacheSwapchainImages();
        }
Ejemplo n.º 3
0
        public void DestroySwapChainStuff()
        {
            foreach (ImageView iv in mChainImageViews)
            {
                iv.Dispose();
            }
            mChainImageViews = null;

            mDPool.Dispose();

            mSwapChain.Dispose();
        }