| 30 | extern "C" { |
| 31 | |
| 32 | EXPORT_FUNCTION VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char* pName) { |
| 33 | PFN_vkVoidFunction instance_func = nullptr; |
| 34 | switch (ApiDumpInstance::current().settings().format()) { |
| 35 | case ApiDumpFormat::Text: |
| 36 | instance_func = api_dump_known_instance_functions<ApiDumpFormat::Text>(instance, pName); |
| 37 | break; |
| 38 | case ApiDumpFormat::Html: |
| 39 | instance_func = api_dump_known_instance_functions<ApiDumpFormat::Html>(instance, pName); |
| 40 | break; |
| 41 | case ApiDumpFormat::Json: |
| 42 | instance_func = api_dump_known_instance_functions<ApiDumpFormat::Json>(instance, pName); |
| 43 | break; |
| 44 | } |
| 45 | if (instance_func) return instance_func; |
| 46 | PFN_vkVoidFunction device_func = nullptr; |
| 47 | |
| 48 | switch (ApiDumpInstance::current().settings().format()) { |
| 49 | case ApiDumpFormat::Text: |
| 50 | device_func = api_dump_known_device_functions<ApiDumpFormat::Text>(NULL, pName); |
| 51 | break; |
| 52 | case ApiDumpFormat::Html: |
| 53 | device_func = api_dump_known_device_functions<ApiDumpFormat::Html>(NULL, pName); |
| 54 | break; |
| 55 | case ApiDumpFormat::Json: |
| 56 | device_func = api_dump_known_device_functions<ApiDumpFormat::Json>(NULL, pName); |
| 57 | break; |
| 58 | } |
| 59 | // Make sure that device functions queried through GIPA works |
| 60 | if (device_func) return device_func; |
| 61 | |
| 62 | // Haven't created an instance yet, exit now since there is no instance_dispatch_table |
| 63 | if (instance_dispatch_table(instance)->GetInstanceProcAddr == NULL) return nullptr; |
| 64 | return instance_dispatch_table(instance)->GetInstanceProcAddr(instance, pName); |
| 65 | } |
| 66 | |
| 67 | EXPORT_FUNCTION VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char* pName) { |
| 68 | PFN_vkVoidFunction device_func = nullptr; |
nothing calls this directly
no test coverage detected