File tree Expand file tree Collapse file tree
src/main/java/net/vulkanmod/vulkan/framebuffer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,18 +123,16 @@ private void createSwapChain() {
123123 createInfo .presentMode (presentMode );
124124 createInfo .clipped (true );
125125
126- createInfo .oldSwapchain (this .swapChainId );
126+ if (this .swapChainId != VK_NULL_HANDLE ) {
127+ this .swapChainImages .forEach (image -> vkDestroyImageView (device , image .getImageView (), null ));
128+ vkDestroySwapchainKHR (device , this .swapChainId , null );
129+ }
127130
128131 LongBuffer pSwapChain = stack .longs (VK_NULL_HANDLE );
129132
130133 int result = vkCreateSwapchainKHR (device , createInfo , null , pSwapChain );
131134 Vulkan .checkResult (result , "Failed to create swap chain" );
132135
133- if (this .swapChainId != VK_NULL_HANDLE ) {
134- this .swapChainImages .forEach (image -> vkDestroyImageView (device , image .getImageView (), null ));
135- vkDestroySwapchainKHR (device , this .swapChainId , null );
136- }
137-
138136 this .swapChainId = pSwapChain .get (0 );
139137
140138 vkGetSwapchainImagesKHR (device , this .swapChainId , imageCount , null );
You can’t perform that action at this time.
0 commit comments