2020-02-10 09:18:37 +00:00
|
|
|
#ifndef __QF_Vulkan_image_h
|
|
|
|
#define __QF_Vulkan_image_h
|
|
|
|
|
2020-02-17 11:29:35 +00:00
|
|
|
#include "QF/darray.h"
|
|
|
|
|
|
|
|
typedef struct qfv_imageset_s DARRAY_TYPE (VkImage) qfv_imageset_t;
|
|
|
|
typedef struct qfv_imageviewset_s DARRAY_TYPE (VkImageView) qfv_imageviewset_t;
|
2020-02-10 09:18:37 +00:00
|
|
|
|
2020-02-18 05:28:28 +00:00
|
|
|
typedef struct qfv_imageresource_s {
|
|
|
|
struct qfv_device_s *device;
|
|
|
|
VkImage image;
|
|
|
|
VkDeviceMemory object;
|
|
|
|
VkImageView view;
|
|
|
|
} qfv_imageresource_t;
|
|
|
|
|
2020-02-10 09:18:37 +00:00
|
|
|
typedef struct qfv_imagetransition_s {
|
2020-02-17 11:29:35 +00:00
|
|
|
VkImage image;
|
2020-02-10 09:18:37 +00:00
|
|
|
VkAccessFlags srcAccess;
|
|
|
|
VkAccessFlags dstAccess;
|
|
|
|
VkImageLayout oldLayout;
|
|
|
|
VkImageLayout newLayout;
|
|
|
|
uint32_t srcQueueFamily;
|
|
|
|
uint32_t dstQueueFamily;
|
|
|
|
VkImageAspectFlags aspect;
|
|
|
|
} qfv_imagetransition_t;
|
|
|
|
|
2020-02-17 11:29:35 +00:00
|
|
|
typedef struct qfv_imagetransitionset_s
|
|
|
|
DARRAY_TYPE (qfv_imagetransition_t) qfv_imagetransitionset_t;
|
|
|
|
typedef struct qfv_imagebarrierset_s
|
|
|
|
DARRAY_TYPE (VkImageMemoryBarrier) qfv_imagebarrierset_t;
|
2020-02-10 09:18:37 +00:00
|
|
|
|
|
|
|
struct qfv_device_s;
|
2020-02-17 11:29:35 +00:00
|
|
|
VkImage QFV_CreateImage (struct qfv_device_s *device, int cubemap,
|
|
|
|
VkImageType type,
|
|
|
|
VkFormat format,
|
|
|
|
VkExtent3D size,
|
|
|
|
uint32_t num_mipmaps,
|
|
|
|
uint32_t num_layers,
|
|
|
|
VkSampleCountFlagBits samples,
|
2021-01-10 16:25:55 +00:00
|
|
|
VkImageUsageFlags usage_scenarios);
|
2020-02-17 11:29:35 +00:00
|
|
|
|
|
|
|
VkDeviceMemory QFV_AllocImageMemory (struct qfv_device_s *device,
|
|
|
|
VkImage image,
|
2020-02-10 09:18:37 +00:00
|
|
|
VkMemoryPropertyFlags properties,
|
|
|
|
VkDeviceSize size, VkDeviceSize offset);
|
|
|
|
|
2020-02-18 05:28:28 +00:00
|
|
|
int QFV_BindImageMemory (struct qfv_device_s *device, VkImage image,
|
|
|
|
VkDeviceMemory object, VkDeviceSize offset);
|
|
|
|
|
2020-02-10 09:18:37 +00:00
|
|
|
qfv_imagebarrierset_t *
|
2020-02-17 11:29:35 +00:00
|
|
|
QFV_CreateImageTransitionSet (qfv_imagetransition_t *transitions,
|
2020-02-10 09:18:37 +00:00
|
|
|
int numTransitions);
|
|
|
|
|
2020-02-17 11:29:35 +00:00
|
|
|
VkImageView QFV_CreateImageView (struct qfv_device_s *device,
|
|
|
|
VkImage image, VkImageViewType type,
|
|
|
|
VkFormat format, VkImageAspectFlags aspect);
|
2020-02-11 00:37:04 +00:00
|
|
|
|
2020-02-10 09:18:37 +00:00
|
|
|
#endif//__QF_Vulkan_image_h
|