quakeforge/include/QF/Vulkan/capture.h
Bill Currie 6bbbe4997b [vulkan] Invalidate mapped capture image memory
I think I had gotten lucky with captures not being corrupt due to them
being much bigger than all but the L3 cache (and then they're over 1/2
the size), so the memory was being automatically invalidated by other
activity. Don't want to trust such luck, though.
2022-04-01 16:19:10 +09:00

45 lines
1.2 KiB
C

#ifndef __QF_Vulkan_capture_h
#define __QF_Vulkan_capture_h
#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;
size_t imgsize;
size_t memsize;
byte *data;
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