mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Refactor the LOAD_INSTANCE_FUNC macro to load a function
This commit is contained in:
parent
4f9f0acd32
commit
12ecf25618
@ -264,7 +264,16 @@ static VulkanLibraryHandle vulkanLibrary;
|
||||
bool g_vulkanAvailabilityChecked = false;
|
||||
bool g_vulkanMayBeAvailable = false;
|
||||
|
||||
#define LOAD_INSTANCE_FUNC(instance, x) x = (PFN_ ## x)vkGetInstanceProcAddr(instance, #x); if (!x) {INFO_LOG(Log::G3D, "Missing (instance): %s", #x);}
|
||||
static void *LoadInstanceFunc(VkInstance instance, const char *name) {
|
||||
void *funcPtr = vkGetInstanceProcAddr(instance, name);
|
||||
if (!funcPtr) {
|
||||
INFO_LOG(Log::G3D, "Missing function (instance): %s", name);
|
||||
return nullptr;
|
||||
}
|
||||
return funcPtr;
|
||||
}
|
||||
#define LOAD_INSTANCE_FUNC(instance, x) x = (PFN_ ## x)LoadInstanceFunc(instance, #x);
|
||||
|
||||
#define LOAD_INSTANCE_FUNC_CORE(instance, x, ext_x, min_core) \
|
||||
x = (PFN_ ## x)vkGetInstanceProcAddr(instance, vulkanApiVersion >= min_core ? #x : #ext_x); \
|
||||
if (vulkanApiVersion >= min_core && !x) x = (PFN_ ## x)vkGetInstanceProcAddr(instance, #ext_x); \
|
||||
|
Loading…
Reference in New Issue
Block a user