2020-02-10 06:07:35 +00:00
|
|
|
#ifndef __QF_Vulkan_buffer_h
|
|
|
|
#define __QF_Vulkan_buffer_h
|
|
|
|
|
|
|
|
typedef struct qfv_buffer_s {
|
|
|
|
struct qfv_device_s *device;
|
|
|
|
VkBuffer buffer;
|
|
|
|
} qfv_buffer_t;
|
|
|
|
|
|
|
|
typedef struct qfv_buffertransition_s {
|
|
|
|
qfv_buffer_t *buffer;
|
|
|
|
VkAccessFlags srcAccess;
|
|
|
|
VkAccessFlags dstAccess;
|
|
|
|
uint32_t srcQueueFamily;
|
|
|
|
uint32_t dstQueueFamily;
|
|
|
|
VkDeviceSize offset;
|
|
|
|
VkDeviceSize size;
|
|
|
|
} qfv_buffertransition_t;
|
|
|
|
|
|
|
|
typedef struct qfv_bufferbarrierset_s {
|
|
|
|
struct qfv_device_s *device;
|
|
|
|
uint32_t numBarriers;
|
|
|
|
VkBufferMemoryBarrier *barriers;
|
|
|
|
} qfv_bufferbarrierset_t;
|
|
|
|
|
2020-02-10 09:17:58 +00:00
|
|
|
typedef struct qfv_bufferview_s {
|
|
|
|
struct qfv_device_s *device;
|
|
|
|
VkBufferView view;
|
|
|
|
qfv_buffer_t *buffer;
|
|
|
|
VkFormat format;
|
|
|
|
VkDeviceSize offset;
|
|
|
|
VkDeviceSize size;
|
|
|
|
} qfv_bufferview_t;
|
|
|
|
|
2020-02-10 06:07:35 +00:00
|
|
|
struct qfv_device_s;
|
|
|
|
qfv_buffer_t *QFV_CreateBuffer (struct qfv_device_s *device,
|
|
|
|
VkDeviceSize size,
|
|
|
|
VkBufferUsageFlags usage);
|
|
|
|
|
2020-02-10 09:33:29 +00:00
|
|
|
struct qfv_memory_s *QFV_AllocBufferMemory (qfv_buffer_t *buffer,
|
2020-02-10 09:17:58 +00:00
|
|
|
VkMemoryPropertyFlags properties,
|
|
|
|
VkDeviceSize size, VkDeviceSize offset);
|
2020-02-10 06:07:35 +00:00
|
|
|
|
2020-02-10 09:33:29 +00:00
|
|
|
int QFV_BindBufferMemory (qfv_buffer_t *buffer, struct qfv_memory_s *memory,
|
2020-02-10 06:07:35 +00:00
|
|
|
VkDeviceSize offset);
|
|
|
|
|
|
|
|
qfv_bufferbarrierset_t *
|
|
|
|
QFV_CreateBufferTransitionSet (qfv_buffertransition_t **transitions,
|
|
|
|
int numTransitions);
|
|
|
|
|
2020-02-10 09:17:58 +00:00
|
|
|
qfv_bufferview_t *QFV_CreateBufferView (qfv_buffer_t *buffer, VkFormat format,
|
|
|
|
VkDeviceSize offset, VkDeviceSize size);
|
2020-02-10 06:07:35 +00:00
|
|
|
|
|
|
|
#endif//__QF_Vulkan_buffer_h
|