return &icd;
}
+static vk_physical_device_t dev;
+
+vk_physical_device_t *
+vk_get_physical_device(VkPhysicalDevice pdev)
+{
+ if (dev.pdev != VK_NULL_HANDLE && dev.pdev != pdev)
+ return NULL;
+
+ dev.pdev = pdev;
+ return &dev;
+}
+
static const VkExtensionProperties wsi_instance_extensions[] = {
{ VK_KHR_SURFACE_EXTENSION_NAME, 25 },
{ VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME, 4 },
ARRAY_LENGTH(wsi_instance_extensions) * sizeof(VkExtensionProperties));
icd.instance_extension_count = count + ARRAY_LENGTH(wsi_instance_extensions);
+ dev.pdev = VK_NULL_HANDLE;
}
static void __attribute__((destructor))
#include <utils.h>
#include <tpl.h>
-typedef struct vk_surface vk_surface_t;
-typedef struct vk_swapchain vk_swapchain_t;
-typedef struct vk_buffer vk_buffer_t;
-typedef struct vk_icd vk_icd_t;
+typedef struct vk_surface vk_surface_t;
+typedef struct vk_swapchain vk_swapchain_t;
+typedef struct vk_buffer vk_buffer_t;
+typedef struct vk_physical_device vk_physical_device_t;
+typedef struct vk_icd vk_icd_t;
struct vk_icd {
void *lib;
- PFN_vkGetInstanceProcAddr get_proc_addr;
+ PFN_vkGetInstanceProcAddr get_proc_addr;
PFN_vkEnumerateDeviceExtensionProperties enum_dev_exts;
uint32_t instance_extension_count;
vk_icd_t *
vk_get_icd(void);
+struct vk_physical_device {
+ VkPhysicalDevice pdev;
+};
+
+vk_physical_device_t *
+vk_get_physical_device(VkPhysicalDevice pdev);
+
struct vk_buffer {
tbm_surface_h tbm;
VkImage image;