Unity-Technologies / NativeRenderingPlugin

C++ Rendering Plugin example for Unity
https://docs.unity3d.com/Manual/NativePluginInterface.html
MIT License
815 stars 163 forks source link

How does Vulkan API interception work before VkInstance and VkDevice creating and after that? #37

Open MoMoPF opened 1 year ago

MoMoPF commented 1 year ago

In my test, I found that the intercept of vkCmdBeginRenderPass by Hook_vkCmdBeginRenderPass in function [ ProcessDeviceEvent ] didn't work in Editor mode. image

I also intercepted vkCreatInstance in function [ ProcessDeviceEvent ] and it didn't work.

However, if I intercept above APIs in function [ Hook_vkGetInstanceProcAddr ], everything works well. image

I think I could say that interception in function [ Hook_vkGetInstanceProcAddr ] works definitely . But when does interception in function [ ProcessDeviceEvent ] work?