2019-07-08 16:00:47 +00:00
|
|
|
#ifndef __vid_vulkan_h
|
|
|
|
#define __vid_vulkan_h
|
|
|
|
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
#endif
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
2019-07-10 04:16:46 +00:00
|
|
|
struct VulkanInstance_s;
|
2019-07-08 16:00:47 +00:00
|
|
|
typedef struct vulkan_ctx_s {
|
|
|
|
void (*load_vulkan) (struct vulkan_ctx_s *ctx);
|
|
|
|
void (*unload_vulkan) (struct vulkan_ctx_s *ctx);
|
|
|
|
|
2019-07-09 02:54:23 +00:00
|
|
|
const char **required_extensions;
|
2019-07-10 04:16:46 +00:00
|
|
|
int (*extension_enabled) (struct VulkanInstance_s *inst,
|
|
|
|
const char *ext);
|
2019-07-08 16:00:47 +00:00
|
|
|
struct vulkan_presentation_s *presentation;
|
|
|
|
int (*get_presentation_support) (struct vulkan_ctx_s *ctx,
|
|
|
|
VkPhysicalDevice physicalDevice,
|
|
|
|
uint32_t queueFamilyIndex);
|
2019-07-09 07:33:44 +00:00
|
|
|
void (*choose_visual) (struct vulkan_ctx_s *ctx);
|
|
|
|
void (*create_window) (struct vulkan_ctx_s *ctx);
|
2019-07-08 16:00:47 +00:00
|
|
|
VkSurfaceKHR (*create_surface) (struct vulkan_ctx_s *ctx);
|
2019-07-09 02:54:23 +00:00
|
|
|
|
|
|
|
struct VulkanInstance_s *vtx;
|
2019-07-09 07:33:44 +00:00
|
|
|
struct VulkanDevice_s *dev;
|
2019-07-08 16:00:47 +00:00
|
|
|
VkInstance instance;
|
2019-07-10 04:16:46 +00:00
|
|
|
VkPhysicalDevice physDevice;
|
2019-07-09 07:33:44 +00:00
|
|
|
VkDevice device;
|
2019-07-10 15:58:14 +00:00
|
|
|
VkSwapchainKHR swapchain;
|
|
|
|
int32_t numSwapchainImages;
|
|
|
|
VkImage *swapchainImages;
|
2019-07-08 16:00:47 +00:00
|
|
|
#define EXPORTED_VULKAN_FUNCTION(fname) PFN_##fname fname;
|
|
|
|
#define GLOBAL_LEVEL_VULKAN_FUNCTION(fname) PFN_##fname fname;
|
|
|
|
#include "QF/Vulkan/funclist.h"
|
|
|
|
} vulkan_ctx_t;
|
|
|
|
|
|
|
|
#endif//__vid_vulkan_h
|