quakeforge/include/vid_vulkan.h
Bill Currie 559bd2e636 Create command pool and frame timing fences
Nothing is actually done yet, so the reported fps is around 172k (yes,
k), but startup and shutdown seems to be clean (yay validation layers).
2020-02-16 22:45:27 +09:00

42 lines
1.3 KiB
C

#ifndef __vid_vulkan_h
#define __vid_vulkan_h
#ifndef VK_NO_PROTOTYPES
#define VK_NO_PROTOTYPES
#endif
#include <vulkan/vulkan.h>
typedef struct vulkan_frameset_s {
int curFrame; // index into fences
int curImage; // index into cmdBuffers and swapchain images
struct qfv_fenceset_s *fences;
struct qfv_cmdbufferset_s *cmdBuffers;
} vulkan_frameset_t;
typedef struct vulkan_ctx_s {
void (*load_vulkan) (struct vulkan_ctx_s *ctx);
void (*unload_vulkan) (struct vulkan_ctx_s *ctx);
const char **required_extensions;
struct vulkan_presentation_s *presentation;
int (*get_presentation_support) (struct vulkan_ctx_s *ctx,
VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex);
void (*choose_visual) (struct vulkan_ctx_s *ctx);
void (*create_window) (struct vulkan_ctx_s *ctx);
VkSurfaceKHR (*create_surface) (struct vulkan_ctx_s *ctx);
struct qfv_instance_s *instance;
struct qfv_device_s *device;
struct qfv_swapchain_s *swapchain;
VkSurfaceKHR surface; //FIXME surface = window, so "contains" swapchain
struct qfv_cmdpool_s *cmdpool;
vulkan_frameset_t frameset;
#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