Open hysw opened 2 years ago
I can confirm that the query of vkCreateDevice
with an invalid instance is incorrect vulkan behavior, however due to the loader having a bug which made that work, it is now a known "bug" in the loader.
PR that documents this behavior (and re-introduces it cause I tried to fix it last week but got pushback as it breaks a bunch of users systems) https://github.com/KhronosGroup/Vulkan-Loader/pull/1183
I got hit by this as well, on Android (without RenderDoc).
However the issue is more subtle on Android as (PFN_vkCreateDevice)gipa(VK_NULL_HANDLE, "vkCreateDevice");
returns a non-null function pointer, and everything seems to work fine except the layer behaved incorrectly and many of the intercepted functions didn't get called back by the layer.
EDIT: That wasn't actually the real issue. The real issue was that on Android vkGetDeviceProcAddr()
will be called by the loader to resolve the address of itself, and in that case I was forwarding the call to the next layer instead of intercepting it.
I'm creating this issue since I can't find the source for https://renderdoc.org/vulkan-layer-guide.html and make a pull request.
In layer's
CreateDevice
functionHere
pfnNextGetInstanceProcAddr
is called withVK_NULL_HANDLE
and"vkCreateDevice"
which the return is undefined according to the Vulkan spec. Most implementations happens to return a validvkCreateDevice
pointer. However renderdoc layer returns nullptr in this case and we got a segfault.A correct implementation should get the instance from physical device and pass that to
pfnNextGetInstanceProcAddr
.