2019-07-23 03:28:57 +00:00
|
|
|
#ifndef __QF_Vulkan_command_h
|
|
|
|
#define __QF_Vulkan_command_h
|
|
|
|
|
|
|
|
typedef struct qfv_cmdpool_s {
|
2020-02-07 02:45:05 +00:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 03:28:57 +00:00
|
|
|
VkCommandPool cmdpool;
|
|
|
|
} qfv_cmdpool_t;
|
|
|
|
|
|
|
|
typedef struct qfv_cmdbuffer_s {
|
2020-02-07 02:45:05 +00:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 04:05:32 +00:00
|
|
|
VkCommandPool cmdpool;
|
2019-07-23 03:28:57 +00:00
|
|
|
VkCommandBuffer buffer;
|
|
|
|
} qfv_cmdbuffer_t;
|
|
|
|
|
|
|
|
typedef struct qfv_cmdbufferset_s {
|
2020-02-07 02:45:05 +00:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 03:28:57 +00:00
|
|
|
VkCommandBuffer *buffers;
|
|
|
|
int numBuffers;
|
|
|
|
} qfv_cmdbufferset_t;
|
|
|
|
|
|
|
|
typedef struct qfv_semaphore_s {
|
2020-02-07 02:45:05 +00:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 03:28:57 +00:00
|
|
|
VkSemaphore semaphore;
|
|
|
|
} qfv_semaphore_t;
|
|
|
|
|
|
|
|
typedef struct qfv_semaphoreset_s {
|
2020-02-07 02:45:05 +00:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 03:28:57 +00:00
|
|
|
VkSemaphore *semaphores;
|
|
|
|
VkPipelineStageFlags *stages;
|
|
|
|
int numSemaphores;
|
|
|
|
} qfv_semaphoreset_t;
|
|
|
|
|
|
|
|
typedef struct qfv_fence_s {
|
2020-02-07 02:45:05 +00:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 03:28:57 +00:00
|
|
|
VkFence fence;
|
|
|
|
} qfv_fence_t;
|
|
|
|
|
|
|
|
typedef struct qfv_fenceset_s {
|
2020-02-07 02:45:05 +00:00
|
|
|
struct qfv_device_s *device;
|
2019-07-23 03:28:57 +00:00
|
|
|
VkFence *fences;
|
|
|
|
int numFences;
|
|
|
|
} qfv_fenceset_t;
|
|
|
|
|
2019-07-23 03:37:47 +00:00
|
|
|
struct qfv_queue_s;
|
2019-07-23 03:28:57 +00:00
|
|
|
qfv_cmdpool_t *QFV_CreateCommandPool (struct qfv_device_s *device,
|
|
|
|
uint32_t queueFamily,
|
|
|
|
int transient, int reset);
|
|
|
|
int QFV_ResetCommandPool (qfv_cmdpool_t *pool, int release);
|
2019-07-23 04:05:32 +00:00
|
|
|
void QFV_DestroyCommandPool (qfv_cmdpool_t *pool);
|
2019-07-23 03:28:57 +00:00
|
|
|
qfv_cmdbuffer_t *QFV_AllocateCommandBuffers (qfv_cmdpool_t *pool,
|
|
|
|
int secondary, int count);
|
|
|
|
qfv_cmdbufferset_t *QFV_CreateCommandBufferSet (qfv_cmdbuffer_t **buffers,
|
|
|
|
int numBuffers);
|
2019-07-23 04:05:32 +00:00
|
|
|
void QFV_FreeCommandBuffers (qfv_cmdbuffer_t *buffer, int count);
|
|
|
|
// NOTE: does not destroy buffers
|
|
|
|
void QFV_DestroyCommandBufferSet (qfv_cmdbufferset_t *buffers);
|
2019-07-23 03:28:57 +00:00
|
|
|
int QFV_BeginCommandBuffer (qfv_cmdbuffer_t *buffer, int oneTime,
|
|
|
|
int rpContinue, int simultaneous,
|
|
|
|
VkCommandBufferInheritanceInfo *inheritanceInfo);
|
|
|
|
int QFV_EndCommandBuffer (qfv_cmdbuffer_t *buffer);
|
|
|
|
int QFV_ResetCommandBuffer (qfv_cmdbuffer_t *buffer, int release);
|
|
|
|
|
|
|
|
qfv_semaphore_t *QFV_CreateSemaphore (struct qfv_device_s *device);
|
|
|
|
qfv_semaphoreset_t *QFV_CreateSemaphoreSet (qfv_semaphore_t **semaphores,
|
|
|
|
int numSemaphores);
|
2019-07-23 04:05:32 +00:00
|
|
|
void QFV_DestroySemaphore (qfv_semaphore_t *semaphore);
|
|
|
|
// NOTE: does not destroy semaphores
|
|
|
|
void QFV_DestroySemaphoreSet (qfv_semaphoreset_t *semaphores);
|
2019-07-23 03:28:57 +00:00
|
|
|
qfv_fence_t *QFV_CreateFence (struct qfv_device_s *device, int signaled);
|
|
|
|
qfv_fenceset_t *QFV_CreateFenceSet (qfv_fence_t **fences, int numFences);
|
2019-07-23 04:05:32 +00:00
|
|
|
void QFV_DestroyFence (qfv_fence_t *fence);
|
|
|
|
// NOTE: does not destroy fences
|
|
|
|
void QFV_DestroyFenceSet (qfv_fenceset_t *fences);
|
2019-07-23 03:28:57 +00:00
|
|
|
int QFV_WaitForFences (qfv_fenceset_t *fences, int all, uint64_t timeout);
|
|
|
|
int QFV_ResetFences (qfv_fenceset_t *fences);
|
2019-07-23 03:37:47 +00:00
|
|
|
int QFV_QueueSubmit (struct qfv_queue_s *queue,
|
2019-07-23 03:28:57 +00:00
|
|
|
qfv_semaphoreset_t *waitSemaphores,
|
|
|
|
qfv_cmdbufferset_t *buffers,
|
|
|
|
qfv_semaphoreset_t *signalSemaphores, qfv_fence_t *fence);
|
2019-07-23 04:05:32 +00:00
|
|
|
int QFV_QueueWaitIdle (struct qfv_queue_s *queue);
|
2019-07-23 03:28:57 +00:00
|
|
|
|
2020-02-10 06:07:35 +00:00
|
|
|
struct qfv_memorybarrierset_s *memBarriers;
|
|
|
|
struct qfv_bufferbarrierset_s *buffBarriers;
|
|
|
|
struct qfv_imagebarrierset_s *imgBarriers;
|
|
|
|
void QFV_CmdPipelineBarrier (qfv_cmdbuffer_t *cmdBuffer,
|
|
|
|
VkPipelineStageFlags srcStageMask,
|
|
|
|
VkPipelineStageFlags dstStageMask,
|
|
|
|
VkDependencyFlags dependencyFlags,
|
|
|
|
struct qfv_memorybarrierset_s *memBarriers,
|
|
|
|
struct qfv_bufferbarrierset_s *buffBarriers,
|
|
|
|
struct qfv_imagebarrierset_s *imgBarriers);
|
2019-07-23 03:28:57 +00:00
|
|
|
|
|
|
|
#endif//__QF_Vulkan_command_h
|