vulkan: Device initialization

This initialized a Vulkan logical device according to compositor
preference, but does not yet do anything with it.
This commit is contained in:
Kenny Levinsen 2024-08-04 23:37:35 +02:00
parent 9cf99ea4bf
commit 42caf8b387
5 changed files with 352 additions and 1 deletions

20
vulkan.h Normal file
View file

@ -0,0 +1,20 @@
#pragma once
#include <sys/types.h>
#include <vulkan/vulkan.h>
struct vulkan {
VkInstance instance;
VkPhysicalDevice *devices;
uint32_t device_len;
VkPhysicalDevice physical_device;
VkDevice device;
struct {
PFN_vkGetMemoryFdKHR vkGetMemoryFdKHR;
} api;
};
void vulkan_destroy(struct vulkan *vk);
struct vulkan *vulkan_create(dev_t preferred_device);