Browse Source

vulkan: destroying render pass after creating pipeline state is OK after all

See the following issues:
https://github.com/KhronosGroup/Vulkan-Docs/issues/516
https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/2070
rdb 7 years ago
parent
commit
d738d4af2d
1 changed files with 2 additions and 7 deletions
  1. 2 7
      panda/src/vulkandisplay/vulkanGraphicsWindow.cxx

+ 2 - 7
panda/src/vulkandisplay/vulkanGraphicsWindow.cxx

@@ -677,13 +677,8 @@ setup_render_pass() {
 
   // Destroy the previous render pass object.
   if (_render_pass != VK_NULL_HANDLE) {
-    // Actually, we can't destroy it, since we may now have pipeline states
-    // that reference it.  Destroying it now would also require destroying the
-    // framebuffer and clearing all of the prepared states from the GSG.
-    // Maybe we need to start reference counting render passes?
-    vulkandisplay_cat.warning() << "Leaking VkRenderPass.\n";
-    //vkDestroyRenderPass(vkgsg->_device, _render_pass, nullptr);
-    //_render_pass = VK_NULL_HANDLE;
+    vkDestroyRenderPass(vkgsg->_device, _render_pass, nullptr);
+    _render_pass = VK_NULL_HANDLE;
   }
 
   _render_pass = pass;