vulkan: rework driver::Get*ProcAddr
Introduce driver::ProcHook which is a struct to describe an intercepted function. Given a function name, GetProcHook returns a ProcHook if the function is intercepted. NULL otherwise. A ProcHook has three function pointers. ProcHook::proc points to the real intercepting function. ProcHook::disabled_proc points to a no-op function that logs an error. ProcHook::checked_proc points to a trampoline that calls either ProcHook::proc or ProcHook::disabled_proc. For core functions, driver::Get*ProcAddr simply return ProcHook::proc. For extension functions, driver::Get*ProcAddr return ProcHook::proc when the extension is known to be enabled. They return ProcHook::disabled_proc when the extension is known to be disabled. Finally, they return ProcHook::checked_proc when they do not know if the extension is enabled or not. All ProcHooks as well as their disabled_proc/checked_proc are generated in driver_gen.cpp. This allows us to get rid of all hand-written "_Disabled" functions, all no-op "_Bottom" functions, and special cases for VK_ANDROID_native_buffer. The reworked driver::Get*ProcAddr also detects more applications' errors and logs them. Change-Id: I8e6f476f450688b5547fd75243c66cb603c516b5
Loading
Please register or sign in to comment