-
Notifications
You must be signed in to change notification settings - Fork 172
May have found something that isn't validated. #2097
Comments
AFAIK unfortunately the current architecture does not allow validating dispatchable handles (such as device and instance). It simply crashes in the loader trying to use the no-longer-valid instance pointer before it can even get to the validation layer checking function. It is a bit obvious really. Validation layers are instance layers. No/destroyed instance -> no layer. PS: yer SDK is old. |
Mh. Sounds reasonable. But is there a way to hook into the instance destruction and validate things before the instance gets destroyed? Basically as soon as the destroy instance is run, you then check if everything was cleaned up, before the instance gets actually torn apart? |
@Berserker66 Oh yeah, actually that should happen. AFAIK all the leaked child objects should be reported on object destruction time. Though testing it I get only a complaint about debug callback object (but no other object) while destroying instance prematurely. PS: maybe rename this Issue to something along these lines. |
@Berserker66 yes, object_tracker will report undestroyed objects at DestroyInstance() and DestroyDevice() time. |
@tobine I have stitched together (not-so-)minimal example testing it: I leak Also I tried with a debug callback object. I get (for some reason) four errors about the leaked callback object, but still nothing about device. In a larger program I get errors about none of the leaked objects except again the four about callback object. |
@krOoze, yup, DestroyInstance calls ReportUndestroyedObjects for each device, and though it will report any objects owned by THAT device as 'leaked' it won't say anything specific about the device itself. We can certainly make this more clear. |
So, in my project I just messed with the way all my command pools and command buffers are handled.
At the end of the restructure, I now have a vulkan crash on exit. No validation warning of anything being wrong.
https://i.imgur.com/KgqKb2h.png
I use vulkan through a python wrapper, so I don't know much about what seems to have gone wrong on the C level, I also almost never use Visual Studio, so I don't know if I can dump the exception info somehow.
My vulkan info, should it matter:
https://pastebin.com/W0cUTtzd
Edit:
I have fixed the crash - Destroy commands fired in the wrong order, the device and instance were long gone and then two command pools and ~2 command buffers were tried to be cleaned up afterwards, which is wrong. Still, that should have a validation layer message, I think.
The text was updated successfully, but these errors were encountered: