2020-02-12 09:55:51 +00:00
|
|
|
#ifndef __QF_Vulkan_renderpass_h
|
|
|
|
#define __QF_Vulkan_renderpass_h
|
|
|
|
|
2020-02-17 14:30:25 +00:00
|
|
|
#include "QF/darray.h"
|
2022-05-07 03:38:31 +00:00
|
|
|
#include "QF/simd/types.h"
|
2020-02-17 14:30:25 +00:00
|
|
|
|
2021-02-14 02:35:06 +00:00
|
|
|
typedef struct qfv_framebufferset_s
|
|
|
|
DARRAY_TYPE (VkFramebuffer) qfv_framebufferset_t;
|
|
|
|
|
|
|
|
#define QFV_AllocFrameBuffers(num, allocator) \
|
|
|
|
DARRAY_ALLOCFIXED (qfv_framebufferset_t, num, allocator)
|
|
|
|
|
2022-05-07 03:38:31 +00:00
|
|
|
typedef struct qfv_subpass_s {
|
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
|
|
|
} qfv_subpass_t;
|
|
|
|
|
2022-05-30 06:58:22 +00:00
|
|
|
typedef struct qfv_subpassset_s
|
|
|
|
DARRAY_TYPE (qfv_subpass_t) qfv_subpassset_t;
|
|
|
|
|
2021-12-02 12:58:29 +00:00
|
|
|
typedef struct qfv_renderframe_s {
|
|
|
|
struct vulkan_ctx_s *vulkan_ctx;
|
|
|
|
struct qfv_renderpass_s *renderpass;
|
|
|
|
VkSubpassContents subpassContents;
|
2022-05-30 02:06:13 +00:00
|
|
|
int subpassCount;
|
2022-05-07 03:38:31 +00:00
|
|
|
qfv_subpass_t *subpassInfo;
|
2021-12-02 12:58:29 +00:00
|
|
|
struct qfv_cmdbufferset_s *subpassCmdSets;
|
|
|
|
} qfv_renderframe_t;
|
|
|
|
|
|
|
|
typedef struct qfv_renderframeset_s
|
|
|
|
DARRAY_TYPE (qfv_renderframe_t) qfv_renderframeset_t;
|
|
|
|
|
|
|
|
typedef struct clearvalueset_s
|
|
|
|
DARRAY_TYPE (VkClearValue) clearvalueset_t;
|
|
|
|
|
2022-05-30 06:58:22 +00:00
|
|
|
typedef void (*qfv_draw_t) (qfv_renderframe_t *rFrame);
|
|
|
|
|
2021-12-02 12:58:29 +00:00
|
|
|
typedef struct qfv_renderpass_s {
|
2022-05-09 13:57:41 +00:00
|
|
|
vec4f_t color; // for debugging
|
|
|
|
const char *name; // for debugging
|
2021-12-02 12:58:29 +00:00
|
|
|
struct plitem_s *renderpassDef;
|
|
|
|
VkRenderPass renderpass;
|
|
|
|
clearvalueset_t *clearValues;
|
|
|
|
struct qfv_imageset_s *attachment_images;
|
|
|
|
struct qfv_imageviewset_s *attachment_views;
|
|
|
|
VkDeviceMemory attachmentMemory;
|
|
|
|
|
|
|
|
qfv_framebufferset_t *framebuffers;
|
2022-04-01 11:34:41 +00:00
|
|
|
VkViewport viewport;
|
|
|
|
VkRect2D scissor;
|
2022-05-31 01:41:19 +00:00
|
|
|
int order;
|
2022-05-31 01:56:00 +00:00
|
|
|
int primary_commands;
|
2022-05-30 06:58:22 +00:00
|
|
|
size_t subpassCount;
|
|
|
|
qfv_subpassset_t *subpass_info;
|
2021-12-02 12:58:29 +00:00
|
|
|
qfv_renderframeset_t frames;
|
|
|
|
|
2022-05-30 06:58:22 +00:00
|
|
|
qfv_draw_t draw;
|
2021-12-02 12:58:29 +00:00
|
|
|
} qfv_renderpass_t;
|
|
|
|
|
2022-05-30 06:58:22 +00:00
|
|
|
struct qfv_output_s;
|
|
|
|
qfv_renderpass_t *Vulkan_CreateRenderPass (struct vulkan_ctx_s *ctx,
|
|
|
|
const char *name,
|
|
|
|
struct qfv_output_s *output,
|
|
|
|
qfv_draw_t draw);
|
|
|
|
void Vulkan_DestroyRenderPass (struct vulkan_ctx_s *ctx,
|
|
|
|
qfv_renderpass_t *renderpass);
|
|
|
|
|
2020-02-12 09:55:51 +00:00
|
|
|
#endif//__QF_Vulkan_renderpass_h
|