Why validation layer doesn't say me I forgot to destroy a device or a surface?

偶尔善良 提交于 2019-12-12 18:15:19

问题


I added VK_LAYER_LUNARG_standard_validation validation layers to my instance. Next I created a debug callback and other vulkan objects. For the test case the only object I'm clearing is the instance (because validation layers should report on instance destruction). And from all of the objects I have the layer reports only about VkDebugReportCallbackEXT:

validation layer: Debug Report callbacks not removed before DestroyInstance

Why it doesn't say me about VkSurfaceKHR and VkDevice (they are created for sure).


回答1:


Some of it was fixed in head, but not yet released as SDK.

Other thing is that vkDestroyInstance related messages can only be reported through temporary debug report callback provided through pNext of vkCreateInstance. The reason is all the child objects must be destroyed before vkDestroyInstance, including your debug callback, so it is not usable during vkDestroyInstance.

So, also chain your VkDebugReportCallbackCreateInfoEXT to the pNext chain of vkCreateInstance.



来源:https://stackoverflow.com/questions/47670221/why-validation-layer-doesnt-say-me-i-forgot-to-destroy-a-device-or-a-surface

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!