Vulkan: Create VkInstance and register debug report
diff --git a/src/backend/vulkan/VulkanFunctions.cpp b/src/backend/vulkan/VulkanFunctions.cpp
index 113c871..62a8d8e 100644
--- a/src/backend/vulkan/VulkanFunctions.cpp
+++ b/src/backend/vulkan/VulkanFunctions.cpp
@@ -14,6 +14,7 @@
#include "backend/vulkan/VulkanFunctions.h"
+#include "backend/vulkan/VulkanInfo.h"
#include "common/DynamicLib.h"
namespace backend {
@@ -38,5 +39,34 @@
return true;
}
+ #define GET_INSTANCE_PROC(name) \
+ name = reinterpret_cast<decltype(name)>(GetInstanceProcAddr(instance, "vk" #name)); \
+ if (name == nullptr) { \
+ return false; \
+ }
+
+ bool VulkanFunctions::LoadInstanceProcs(VkInstance instance, const KnownGlobalVulkanExtensions& usedGlobals) {
+ GET_INSTANCE_PROC(CreateDevice);
+ GET_INSTANCE_PROC(DestroyDevice);
+ GET_INSTANCE_PROC(EnumerateDeviceExtensionProperties);
+ GET_INSTANCE_PROC(EnumerateDeviceLayerProperties);
+ GET_INSTANCE_PROC(EnumeratePhysicalDevices);
+ GET_INSTANCE_PROC(GetPhysicalDeviceFeatures);
+ GET_INSTANCE_PROC(GetPhysicalDeviceFormatProperties);
+ GET_INSTANCE_PROC(GetPhysicalDeviceImageFormatProperties);
+ GET_INSTANCE_PROC(GetPhysicalDeviceMemoryProperties);
+ GET_INSTANCE_PROC(GetPhysicalDeviceProperties);
+ GET_INSTANCE_PROC(GetPhysicalDeviceQueueFamilyProperties);
+ GET_INSTANCE_PROC(GetPhysicalDeviceSparseImageFormatProperties);
+
+ if (usedGlobals.debugReport) {
+ GET_INSTANCE_PROC(CreateDebugReportCallbackEXT);
+ GET_INSTANCE_PROC(DebugReportMessageEXT);
+ GET_INSTANCE_PROC(DestroyDebugReportCallbackEXT);
+ }
+
+ return true;
+ }
+
}
}