diff --git a/example/Vulkan/RenderSurfaceAttribute.cpp b/example/Vulkan/RenderSurfaceAttribute.cpp index e9b2c87e..446e85dd 100644 --- a/example/Vulkan/RenderSurfaceAttribute.cpp +++ b/example/Vulkan/RenderSurfaceAttribute.cpp @@ -130,6 +130,9 @@ RenderSurfaceAttribute::RenderSurfaceAttribute(VkInstance inst,VkPhysicalDevice RenderSurfaceAttribute::~RenderSurfaceAttribute() { + if(desc_pool) + vkDestroyDescriptorPool(device,desc_pool,nullptr); + if(depth.view) vkDestroyImageView(device,depth.view,nullptr); diff --git a/example/Vulkan/RenderSurfaceAttribute.h b/example/Vulkan/RenderSurfaceAttribute.h index 5e7783ec..d8736165 100644 --- a/example/Vulkan/RenderSurfaceAttribute.h +++ b/example/Vulkan/RenderSurfaceAttribute.h @@ -47,6 +47,8 @@ struct RenderSurfaceAttribute VkImageView view =nullptr; }depth; + VkDescriptorPool desc_pool =nullptr; + public: RenderSurfaceAttribute(VkInstance inst,VkPhysicalDevice pd,VkSurfaceKHR s); diff --git a/example/Vulkan/RenderSurfaceCreater.cpp b/example/Vulkan/RenderSurfaceCreater.cpp index 10c5320f..43bfa05c 100644 --- a/example/Vulkan/RenderSurfaceCreater.cpp +++ b/example/Vulkan/RenderSurfaceCreater.cpp @@ -259,6 +259,33 @@ namespace return(true); } + + VkDescriptorPool CreateDescriptorPool(VkDevice device,int sets_count) + { + constexpr size_t DESC_POOL_COUNT=1; + + VkDescriptorPoolSize pool_size[DESC_POOL_COUNT]; + + for(size_t i=0;idesc_pool=CreateDescriptorPool(rsa->device,1); + + if(!rsa->desc_pool) + return(nullptr); + return(new RenderSurface(rsa)); } VK_NAMESPACE_END