]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/vkxlib/vulkancontext_platform.h
9c08c96102f5bd421e71de3079d7ce26d700d64e
[libs/gui.git] / source / graphics / vkxlib / vulkancontext_platform.h
1 #ifndef MSP_GRAPHICS_VULKANCONTEXT_PLATFORM_H_
2 #define MSP_GRAPHICS_VULKANCONTEXT_PLATFORM_H_
3
4 #define VK_USE_PLATFORM_XLIB_KHR
5 #include <vulkan/vulkan.h>
6 #include "vulkancontext.h"
7
8 namespace Msp {
9 namespace Graphics {
10
11 struct VulkanFunctions
12 {
13         PFN_vkCreateInstance vkCreateInstance;
14         PFN_vkDestroyInstance vkDestroyInstance;
15         PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
16         PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
17         PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupport;
18         PFN_vkCreateDevice vkCreateDevice;
19         PFN_vkDestroyDevice vkDestroyDevice;
20         PFN_vkGetDeviceQueue vkGetDeviceQueue;
21         PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurface;
22         PFN_vkDestroySurfaceKHR vkDestroySurface;
23         PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallback;
24         PFN_vkDestroyDebugReportCallbackEXT vkDestroyDebugReportCallback;
25 };
26
27 struct VulkanContext::Private
28 {
29         VulkanFunctions functions;
30         VkInstance instance;
31         VkPhysicalDevice physical_device;
32         VkDevice device;
33         unsigned graphics_queue_family;
34         VkQueue graphics_queue;
35         VkSurfaceKHR surface;
36         VkDebugReportCallbackEXT debug_report_callback;
37
38         Private();
39
40         static VkBool32 debug_report_func(VkDebugReportFlagsEXT, VkDebugReportObjectTypeEXT, uint64_t, size_t, int32_t, const char *, const char *, void *);
41 };
42
43 } // namespace Graphics
44 } // namespace Msp
45
46 #endif