2021-03-25 06:59:28 +00:00
|
|
|
#ifndef __QF_Vulkan_capture_h
|
|
|
|
#define __QF_Vulkan_capture_h
|
|
|
|
|
2022-05-08 08:57:40 +00:00
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
#endif
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
2021-03-25 06:59:28 +00:00
|
|
|
#include "QF/darray.h"
|
|
|
|
#include "QF/qtypes.h"
|
|
|
|
|
|
|
|
typedef struct qfv_capture_image_s {
|
|
|
|
VkImage image;
|
|
|
|
VkImageLayout layout;
|
|
|
|
VkCommandBuffer cmd;
|
|
|
|
byte *data;
|
|
|
|
} qfv_capture_image_t;
|
|
|
|
|
|
|
|
typedef struct qfv_capture_image_set_s
|
|
|
|
DARRAY_TYPE (qfv_capture_image_t) qfv_capture_image_set_t;
|
|
|
|
|
|
|
|
#define QFV_AllocCaptureImageSet(num, allocator) \
|
|
|
|
DARRAY_ALLOCFIXED (qfv_capture_image_set_t, num, allocator)
|
|
|
|
|
|
|
|
typedef struct qfv_capture_s {
|
|
|
|
struct qfv_device_s *device;
|
|
|
|
|
|
|
|
int canBlit;
|
|
|
|
VkExtent2D extent;
|
|
|
|
qfv_capture_image_set_t *image_set;
|
2022-04-01 07:19:10 +00:00
|
|
|
size_t imgsize;
|
2021-03-25 06:59:28 +00:00
|
|
|
size_t memsize;
|
2022-04-01 07:19:10 +00:00
|
|
|
byte *data;
|
2021-03-25 06:59:28 +00:00
|
|
|
VkDeviceMemory memory;
|
|
|
|
} qfv_capture_t;
|
|
|
|
|
|
|
|
struct qfv_swapchain_s;
|
|
|
|
|
|
|
|
qfv_capture_t *QFV_CreateCapture (struct qfv_device_s *device, int numframes,
|
|
|
|
struct qfv_swapchain_s *swapchain,
|
|
|
|
VkCommandPool cmdPool);
|
|
|
|
void QFV_RenewCapture (qfv_capture_t *capture,
|
|
|
|
struct qfv_swapchain_s *swapchain);
|
|
|
|
void QFV_DestroyCapture (qfv_capture_t *capture);
|
|
|
|
|
|
|
|
VkCommandBuffer QFV_CaptureImage (qfv_capture_t *capture, VkImage scImage,
|
|
|
|
int frame);
|
|
|
|
const byte *QFV_CaptureData (qfv_capture_t *capture, int frame) __attribute__((pure));
|
|
|
|
|
|
|
|
#endif//__QF_Vulkan_capture_h
|