2019-07-12 13:15:25 +09:00
|
|
|
#ifndef __QF_Vulkan_device_h
|
|
|
|
#define __QF_Vulkan_device_h
|
|
|
|
|
2021-12-16 22:55:44 +09:00
|
|
|
#include "QF/Vulkan/qf_vid.h"
|
|
|
|
|
2019-07-12 13:15:25 +09:00
|
|
|
typedef struct qfv_devfuncs_s {
|
|
|
|
#define DEVICE_LEVEL_VULKAN_FUNCTION(name) PFN_##name name;
|
|
|
|
#define DEVICE_LEVEL_VULKAN_FUNCTION_FROM_EXTENSION(name,ext) PFN_##name name;
|
|
|
|
#include "QF/Vulkan/funclist.h"
|
|
|
|
} qfv_devfuncs_t;
|
|
|
|
|
2019-07-23 12:37:47 +09:00
|
|
|
typedef struct qfv_queue_s {
|
2020-02-07 11:45:05 +09:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 12:37:47 +09:00
|
|
|
|
2023-03-27 23:50:57 +09:00
|
|
|
uint32_t queueFamily;
|
2019-07-23 12:37:47 +09:00
|
|
|
VkQueue queue;
|
|
|
|
} qfv_queue_t;
|
|
|
|
|
2019-07-12 13:15:25 +09:00
|
|
|
struct qfv_instance_s;
|
|
|
|
typedef struct qfv_device_s {
|
|
|
|
VkDevice dev;
|
2020-02-06 19:04:28 +09:00
|
|
|
struct qfv_physdev_s *physDev;
|
2019-07-12 13:15:25 +09:00
|
|
|
qfv_devfuncs_t *funcs;
|
2019-07-23 12:37:47 +09:00
|
|
|
qfv_queue_t queue;
|
2019-07-12 13:15:25 +09:00
|
|
|
struct strset_s *enabled_extensions;
|
|
|
|
int (*extension_enabled) (struct qfv_device_s *inst,
|
|
|
|
const char *ext);
|
|
|
|
} qfv_device_t;
|
|
|
|
|
|
|
|
struct vulkan_ctx_s;
|
2019-07-13 00:36:21 +09:00
|
|
|
qfv_device_t *QFV_CreateDevice (struct vulkan_ctx_s *ctx,
|
|
|
|
const char **extensions);
|
|
|
|
void QFV_DestroyDevice (qfv_device_t *device);
|
2019-07-23 13:05:32 +09:00
|
|
|
int QFV_DeviceWaitIdle (qfv_device_t *device);
|
2019-07-12 13:15:25 +09:00
|
|
|
|
2020-02-17 20:29:35 +09:00
|
|
|
VkFormat QFV_FindSupportedFormat (qfv_device_t *device, VkImageTiling tiling,
|
|
|
|
VkFormatFeatureFlags features,
|
|
|
|
int numCandidates,
|
|
|
|
const VkFormat *candidates);
|
|
|
|
|
2019-07-23 12:27:57 +09:00
|
|
|
#endif//__QF_Vulkan_device_h
|