2023-01-30 04:00:35 +00:00
|
|
|
#ifndef __QF_Vulkan_render_h
|
|
|
|
#define __QF_Vulkan_render_h
|
|
|
|
|
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
#endif
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
2023-02-13 08:45:36 +00:00
|
|
|
#include "QF/cexpr.h"
|
2023-01-30 04:00:35 +00:00
|
|
|
#include "QF/simd/types.h"
|
2023-06-24 05:55:46 +00:00
|
|
|
|
2023-03-28 01:28:44 +00:00
|
|
|
#ifndef __QFCC__
|
2023-06-24 05:55:46 +00:00
|
|
|
#include "QF/darray.h"
|
2023-03-28 01:28:44 +00:00
|
|
|
#include "QF/Vulkan/command.h"
|
|
|
|
#endif
|
2023-01-30 04:00:35 +00:00
|
|
|
|
2023-02-19 03:31:40 +00:00
|
|
|
typedef struct qfv_output_s {
|
|
|
|
VkExtent2D extent;
|
|
|
|
VkImage image; // only if owned
|
|
|
|
VkImageView view;
|
|
|
|
VkFormat format;
|
|
|
|
uint32_t frames;
|
|
|
|
VkImageView *view_list; // per frame
|
|
|
|
VkImageLayout finalLayout;
|
|
|
|
} qfv_output_t;
|
|
|
|
|
2023-02-11 17:40:52 +00:00
|
|
|
typedef struct qfv_reference_s {
|
|
|
|
const char *name;
|
|
|
|
int line;
|
|
|
|
} qfv_reference_t;
|
|
|
|
|
2023-03-29 00:45:17 +00:00
|
|
|
typedef struct qfv_descriptorsetlayoutinfo_s {
|
2023-02-26 11:54:11 +00:00
|
|
|
const char *name;
|
|
|
|
VkDescriptorSetLayoutCreateFlags flags;
|
|
|
|
uint32_t num_bindings;
|
|
|
|
VkDescriptorSetLayoutBinding *bindings;
|
|
|
|
VkDescriptorSetLayout setLayout;
|
2023-03-29 00:45:17 +00:00
|
|
|
} qfv_descriptorsetlayoutinfo_t;
|
2023-02-26 11:54:11 +00:00
|
|
|
|
2023-06-16 10:05:53 +00:00
|
|
|
typedef enum qfv_type_t {
|
|
|
|
qfv_float,
|
|
|
|
qfv_int,
|
|
|
|
qfv_uint,
|
|
|
|
qfv_vec3,
|
|
|
|
qfv_vec4,
|
|
|
|
qfv_mat4,
|
|
|
|
} qfv_type_t;
|
|
|
|
|
|
|
|
typedef struct qfv_pushconstantinfo_s {
|
|
|
|
const char *name;
|
|
|
|
int line;
|
|
|
|
qfv_type_t type;
|
|
|
|
uint32_t offset;
|
|
|
|
uint32_t size;
|
|
|
|
} qfv_pushconstantinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_pushconstantrangeinfo_s {
|
|
|
|
VkShaderStageFlags stageFlags;
|
|
|
|
uint32_t num_pushconstants;
|
|
|
|
qfv_pushconstantinfo_t *pushconstants;
|
|
|
|
} qfv_pushconstantrangeinfo_t;
|
|
|
|
|
2023-02-26 18:00:14 +00:00
|
|
|
typedef struct qfv_layoutinfo_s {
|
|
|
|
const char *name;
|
|
|
|
uint32_t num_sets;
|
|
|
|
qfv_reference_t *sets;
|
2023-06-16 10:05:53 +00:00
|
|
|
uint32_t num_pushconstantranges;
|
|
|
|
qfv_pushconstantrangeinfo_t *pushconstantranges;
|
2023-02-26 18:00:14 +00:00
|
|
|
VkPipelineLayout layout;
|
|
|
|
} qfv_layoutinfo_t;
|
|
|
|
|
2023-02-09 05:52:43 +00:00
|
|
|
typedef struct qfv_imageinfo_s {
|
|
|
|
const char *name;
|
|
|
|
VkImageCreateFlags flags;
|
|
|
|
VkImageType imageType;
|
|
|
|
VkFormat format;
|
|
|
|
VkExtent3D extent;
|
|
|
|
uint32_t mipLevels;
|
|
|
|
uint32_t arrayLayers;
|
|
|
|
VkSampleCountFlagBits samples;
|
|
|
|
VkImageTiling tiling;
|
|
|
|
VkImageUsageFlags usage;
|
2023-02-10 10:45:02 +00:00
|
|
|
VkImageLayout initialLayout;
|
2023-02-09 05:52:43 +00:00
|
|
|
} qfv_imageinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_imageviewinfo_s {
|
|
|
|
const char *name;
|
|
|
|
VkImageViewCreateFlags flags;
|
2023-02-19 03:53:02 +00:00
|
|
|
qfv_reference_t image;
|
2023-02-09 05:52:43 +00:00
|
|
|
VkImageViewType viewType;
|
|
|
|
VkFormat format;
|
|
|
|
VkComponentMapping components;
|
|
|
|
VkImageSubresourceRange subresourceRange;
|
|
|
|
} qfv_imageviewinfo_t;
|
|
|
|
|
2023-03-27 15:12:13 +00:00
|
|
|
typedef struct qfv_bufferinfo_s {
|
|
|
|
const char *name;
|
|
|
|
VkBufferCreateFlags flags;
|
|
|
|
VkDeviceSize size;
|
|
|
|
VkBufferUsageFlags usage;
|
|
|
|
VkSharingMode sharingMode;
|
|
|
|
} qfv_bufferinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_bufferviewinfo_s {
|
|
|
|
const char *name;
|
|
|
|
VkBufferViewCreateFlags flags;
|
|
|
|
qfv_reference_t buffer;
|
|
|
|
VkFormat format;
|
|
|
|
VkDeviceSize offset;
|
|
|
|
VkDeviceSize range;
|
|
|
|
} qfv_bufferviewinfo_t;
|
|
|
|
|
2023-02-09 05:52:43 +00:00
|
|
|
typedef struct qfv_dependencymask_s {
|
|
|
|
VkPipelineStageFlags stage;
|
|
|
|
VkAccessFlags access;
|
|
|
|
} qfv_dependencymask_t;
|
|
|
|
|
|
|
|
typedef struct qfv_dependencyinfo_s {
|
|
|
|
const char *name;
|
|
|
|
qfv_dependencymask_t src;
|
|
|
|
qfv_dependencymask_t dst;
|
|
|
|
VkDependencyFlags flags;
|
|
|
|
} qfv_dependencyinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_attachmentinfo_s {
|
|
|
|
const char *name;
|
2023-06-20 06:18:58 +00:00
|
|
|
int line;
|
2023-02-09 05:52:43 +00:00
|
|
|
VkAttachmentDescriptionFlags flags;
|
|
|
|
VkFormat format;
|
|
|
|
VkSampleCountFlagBits samples;
|
|
|
|
VkAttachmentLoadOp loadOp;
|
|
|
|
VkAttachmentStoreOp storeOp;
|
|
|
|
VkAttachmentLoadOp stencilLoadOp;
|
|
|
|
VkAttachmentStoreOp stencilStoreOp;
|
|
|
|
VkImageLayout initialLayout;
|
|
|
|
VkImageLayout finalLayout;
|
2023-02-10 10:45:02 +00:00
|
|
|
VkClearValue clearValue;
|
2023-03-02 09:33:16 +00:00
|
|
|
qfv_reference_t view;
|
2023-06-20 06:18:58 +00:00
|
|
|
const char *external;
|
2023-02-09 05:52:43 +00:00
|
|
|
} qfv_attachmentinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_taskinfo_s {
|
2023-02-13 08:45:36 +00:00
|
|
|
exprfunc_t *func;
|
|
|
|
const exprval_t **params;
|
2023-02-12 16:43:17 +00:00
|
|
|
void *param_data;
|
2023-02-09 05:52:43 +00:00
|
|
|
} qfv_taskinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_attachmentrefinfo_s {
|
2023-02-10 10:45:02 +00:00
|
|
|
const char *name;
|
2023-02-20 15:44:26 +00:00
|
|
|
int line;
|
2023-02-10 10:45:02 +00:00
|
|
|
VkImageLayout layout;
|
2023-02-18 08:00:52 +00:00
|
|
|
VkPipelineColorBlendAttachmentState blend;
|
2023-02-10 10:45:02 +00:00
|
|
|
} qfv_attachmentrefinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_attachmentsetinfo_s {
|
2023-02-09 05:52:43 +00:00
|
|
|
uint32_t num_input;
|
2023-02-10 10:45:02 +00:00
|
|
|
qfv_attachmentrefinfo_t *input;
|
2023-02-09 05:52:43 +00:00
|
|
|
uint32_t num_color;
|
2023-02-10 10:45:02 +00:00
|
|
|
qfv_attachmentrefinfo_t *color;
|
|
|
|
qfv_attachmentrefinfo_t *resolve;
|
|
|
|
qfv_attachmentrefinfo_t *depth;
|
2023-02-09 05:52:43 +00:00
|
|
|
uint32_t num_preserve;
|
2023-02-20 15:44:26 +00:00
|
|
|
qfv_reference_t *preserve;
|
2023-02-10 10:45:02 +00:00
|
|
|
} qfv_attachmentsetinfo_t;
|
2023-02-09 05:52:43 +00:00
|
|
|
|
|
|
|
typedef struct qfv_pipelineinfo_s {
|
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
2023-06-26 02:54:28 +00:00
|
|
|
bool disabled;
|
2023-02-09 05:52:43 +00:00
|
|
|
uint32_t num_tasks;
|
|
|
|
qfv_taskinfo_t *tasks;
|
2023-02-18 08:00:52 +00:00
|
|
|
|
|
|
|
VkPipelineCreateFlags flags;
|
[vulkan] Start work on a render job system
The jobs will become the core of the renderer, with each job step being
one of a render pass, compute pass, or processor (CPU-only) task. The
steps support dependencies, which will allow for threading the system in
the future.
Currently, just the structures, parse support, and prototype job
specification (render.plist) have been implemented. No conversion to
working data is done yet, and many things, in particular resources, will
need to be reworked, but this gets the basic design in.
2023-03-10 10:47:40 +00:00
|
|
|
VkPipelineShaderStageCreateInfo *compute_stage;
|
|
|
|
uint32_t dispatch[3];
|
|
|
|
|
2023-02-18 08:00:52 +00:00
|
|
|
uint32_t num_graph_stages;
|
|
|
|
const VkPipelineShaderStageCreateInfo *graph_stages;
|
|
|
|
const VkPipelineVertexInputStateCreateInfo *vertexInput;
|
|
|
|
const VkPipelineInputAssemblyStateCreateInfo *inputAssembly;
|
|
|
|
const VkPipelineTessellationStateCreateInfo *tessellation;
|
|
|
|
const VkPipelineViewportStateCreateInfo *viewport;
|
|
|
|
const VkPipelineRasterizationStateCreateInfo *rasterization;
|
|
|
|
const VkPipelineMultisampleStateCreateInfo *multisample;
|
|
|
|
const VkPipelineDepthStencilStateCreateInfo *depthStencil;
|
|
|
|
const VkPipelineColorBlendStateCreateInfo *colorBlend;
|
|
|
|
const VkPipelineDynamicStateCreateInfo *dynamic;
|
2023-02-19 03:53:02 +00:00
|
|
|
qfv_reference_t layout;
|
2023-02-09 05:52:43 +00:00
|
|
|
} qfv_pipelineinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_subpassinfo_s {
|
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
|
|
|
uint32_t num_dependencies;
|
|
|
|
qfv_dependencyinfo_t *dependencies;
|
2023-02-18 08:16:50 +00:00
|
|
|
qfv_attachmentsetinfo_t *attachments;
|
2023-02-09 05:52:43 +00:00
|
|
|
uint32_t num_pipelines;
|
|
|
|
qfv_pipelineinfo_t *pipelines;
|
2023-02-18 08:00:52 +00:00
|
|
|
qfv_pipelineinfo_t *base_pipeline;
|
2023-02-09 05:52:43 +00:00
|
|
|
} qfv_subpassinfo_t;
|
|
|
|
|
2023-02-11 17:40:52 +00:00
|
|
|
typedef struct qfv_framebufferinfo_s {
|
2023-06-17 03:13:38 +00:00
|
|
|
qfv_attachmentinfo_t *attachments;
|
2023-02-11 17:40:52 +00:00
|
|
|
uint32_t num_attachments;
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t layers;
|
|
|
|
} qfv_framebufferinfo_t;
|
|
|
|
|
2023-02-09 05:52:43 +00:00
|
|
|
typedef struct qfv_renderpassinfo_s {
|
2023-02-20 15:44:26 +00:00
|
|
|
vec4f_t color;
|
2023-02-09 05:52:43 +00:00
|
|
|
const char *name;
|
2023-02-27 06:02:48 +00:00
|
|
|
void *pNext;
|
2023-02-11 17:40:52 +00:00
|
|
|
qfv_framebufferinfo_t framebuffer;
|
2023-02-09 05:52:43 +00:00
|
|
|
uint32_t num_subpasses;
|
|
|
|
qfv_subpassinfo_t *subpasses;
|
2023-06-22 15:43:34 +00:00
|
|
|
qfv_reference_t output;
|
2023-02-09 05:52:43 +00:00
|
|
|
} qfv_renderpassinfo_t;
|
|
|
|
|
[vulkan] Start work on a render job system
The jobs will become the core of the renderer, with each job step being
one of a render pass, compute pass, or processor (CPU-only) task. The
steps support dependencies, which will allow for threading the system in
the future.
Currently, just the structures, parse support, and prototype job
specification (render.plist) have been implemented. No conversion to
working data is done yet, and many things, in particular resources, will
need to be reworked, but this gets the basic design in.
2023-03-10 10:47:40 +00:00
|
|
|
typedef struct qfv_computeinfo_s {
|
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
uint32_t num_pipelines;
|
|
|
|
qfv_pipelineinfo_t *pipelines;
|
|
|
|
} qfv_computeinfo_t;
|
|
|
|
|
2023-02-09 05:52:43 +00:00
|
|
|
typedef struct qfv_renderinfo_s {
|
[vulkan] Start work on a render job system
The jobs will become the core of the renderer, with each job step being
one of a render pass, compute pass, or processor (CPU-only) task. The
steps support dependencies, which will allow for threading the system in
the future.
Currently, just the structures, parse support, and prototype job
specification (render.plist) have been implemented. No conversion to
working data is done yet, and many things, in particular resources, will
need to be reworked, but this gets the basic design in.
2023-03-10 10:47:40 +00:00
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
|
|
|
|
2023-02-09 05:52:43 +00:00
|
|
|
uint32_t num_renderpasses;
|
|
|
|
qfv_renderpassinfo_t *renderpasses;
|
|
|
|
} qfv_renderinfo_t;
|
|
|
|
|
[vulkan] Start work on a render job system
The jobs will become the core of the renderer, with each job step being
one of a render pass, compute pass, or processor (CPU-only) task. The
steps support dependencies, which will allow for threading the system in
the future.
Currently, just the structures, parse support, and prototype job
specification (render.plist) have been implemented. No conversion to
working data is done yet, and many things, in particular resources, will
need to be reworked, but this gets the basic design in.
2023-03-10 10:47:40 +00:00
|
|
|
typedef struct qfv_processinfo_s {
|
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
uint32_t num_tasks;
|
|
|
|
qfv_taskinfo_t *tasks;
|
|
|
|
} qfv_processinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_stepinfo_s {
|
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
uint32_t num_dependencies;
|
|
|
|
qfv_reference_t *dependencies;
|
|
|
|
|
|
|
|
qfv_renderinfo_t *render;
|
|
|
|
qfv_computeinfo_t *compute;
|
|
|
|
qfv_processinfo_t *process;
|
|
|
|
} qfv_stepinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_jobinfo_s {
|
|
|
|
struct memsuper_s *memsuper;
|
|
|
|
|
2023-03-22 10:32:49 +00:00
|
|
|
struct plitem_s *plitem;
|
[vulkan] Start work on a render job system
The jobs will become the core of the renderer, with each job step being
one of a render pass, compute pass, or processor (CPU-only) task. The
steps support dependencies, which will allow for threading the system in
the future.
Currently, just the structures, parse support, and prototype job
specification (render.plist) have been implemented. No conversion to
working data is done yet, and many things, in particular resources, will
need to be reworked, but this gets the basic design in.
2023-03-10 10:47:40 +00:00
|
|
|
uint32_t num_steps;
|
|
|
|
qfv_stepinfo_t *steps;
|
2023-03-22 10:32:49 +00:00
|
|
|
|
|
|
|
uint32_t num_images;
|
2023-03-27 15:12:13 +00:00
|
|
|
uint32_t num_imageviews;
|
2023-03-22 10:32:49 +00:00
|
|
|
qfv_imageinfo_t *images;
|
2023-03-27 15:12:13 +00:00
|
|
|
qfv_imageviewinfo_t *imageviews;
|
|
|
|
uint32_t num_buffers;
|
|
|
|
uint32_t num_bufferviews;
|
|
|
|
qfv_imageinfo_t *buffers;
|
|
|
|
qfv_imageviewinfo_t *bufferviews;
|
2023-03-22 10:32:49 +00:00
|
|
|
|
2023-06-24 05:55:46 +00:00
|
|
|
uint32_t num_dslayouts;
|
|
|
|
qfv_descriptorsetlayoutinfo_t *dslayouts;
|
[vulkan] Start work on a render job system
The jobs will become the core of the renderer, with each job step being
one of a render pass, compute pass, or processor (CPU-only) task. The
steps support dependencies, which will allow for threading the system in
the future.
Currently, just the structures, parse support, and prototype job
specification (render.plist) have been implemented. No conversion to
working data is done yet, and many things, in particular resources, will
need to be reworked, but this gets the basic design in.
2023-03-10 10:47:40 +00:00
|
|
|
} qfv_jobinfo_t;
|
|
|
|
|
2023-06-25 14:33:47 +00:00
|
|
|
typedef struct qfv_samplercreateinfo_s {
|
|
|
|
const char *name;
|
|
|
|
VkSamplerCreateFlags flags;
|
|
|
|
VkFilter magFilter;
|
|
|
|
VkFilter minFilter;
|
|
|
|
VkSamplerMipmapMode mipmapMode;
|
|
|
|
VkSamplerAddressMode addressModeU;
|
|
|
|
VkSamplerAddressMode addressModeV;
|
|
|
|
VkSamplerAddressMode addressModeW;
|
|
|
|
float mipLodBias;
|
|
|
|
VkBool32 anisotropyEnable;
|
|
|
|
float maxAnisotropy;
|
|
|
|
VkBool32 compareEnable;
|
|
|
|
VkCompareOp compareOp;
|
|
|
|
float minLod;
|
|
|
|
float maxLod;
|
|
|
|
VkBorderColor borderColor;
|
|
|
|
VkBool32 unnormalizedCoordinates;
|
|
|
|
VkSampler sampler;
|
|
|
|
} qfv_samplercreateinfo_t;
|
|
|
|
|
|
|
|
typedef struct qfv_samplerinfo_s {
|
|
|
|
struct memsuper_s *memsuper;
|
|
|
|
|
|
|
|
struct plitem_s *plitem;
|
|
|
|
qfv_samplercreateinfo_t *samplers;
|
|
|
|
uint32_t num_samplers;
|
|
|
|
} qfv_samplerinfo_t;
|
|
|
|
|
2023-03-28 01:28:44 +00:00
|
|
|
#ifndef __QFCC__
|
2023-01-30 04:00:35 +00:00
|
|
|
typedef struct qfv_label_s {
|
|
|
|
vec4f_t color;
|
|
|
|
const char *name;
|
|
|
|
} qfv_label_t;
|
|
|
|
|
|
|
|
typedef struct qfv_pipeline_s {
|
|
|
|
qfv_label_t label;
|
2023-06-26 02:54:28 +00:00
|
|
|
bool disabled;
|
2023-01-30 04:00:35 +00:00
|
|
|
VkPipelineBindPoint bindPoint;
|
2023-06-15 06:17:39 +00:00
|
|
|
vec4u_t dispatch;
|
2023-01-30 04:00:35 +00:00
|
|
|
VkPipeline pipeline;
|
|
|
|
VkPipelineLayout layout;
|
2023-03-26 09:22:46 +00:00
|
|
|
|
2023-01-30 04:00:35 +00:00
|
|
|
VkViewport viewport;
|
|
|
|
VkRect2D scissor;
|
2023-06-24 05:55:46 +00:00
|
|
|
uint32_t num_indices;
|
|
|
|
uint32_t *ds_indices;
|
2023-02-20 15:44:26 +00:00
|
|
|
|
|
|
|
uint32_t task_count;
|
|
|
|
qfv_taskinfo_t *tasks;
|
2023-01-30 04:00:35 +00:00
|
|
|
} qfv_pipeline_t;
|
|
|
|
|
2023-06-15 04:13:52 +00:00
|
|
|
typedef struct qfv_subpass_s {
|
2023-01-30 04:00:35 +00:00
|
|
|
qfv_label_t label;
|
2023-02-27 09:10:09 +00:00
|
|
|
VkCommandBufferInheritanceInfo inherit;
|
2023-01-30 04:00:35 +00:00
|
|
|
VkCommandBufferBeginInfo beginInfo;
|
2023-02-20 15:44:26 +00:00
|
|
|
uint32_t pipeline_count;
|
2023-01-30 04:00:35 +00:00
|
|
|
qfv_pipeline_t *pipelines;
|
2023-06-15 04:13:52 +00:00
|
|
|
} qfv_subpass_t;
|
2023-01-30 04:00:35 +00:00
|
|
|
|
2023-06-22 12:36:14 +00:00
|
|
|
typedef struct qfv_framebuffer_s {
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t layers;
|
|
|
|
uint32_t num_attachments;
|
|
|
|
VkImageView *views;
|
|
|
|
} qfv_framebuffer_t;
|
|
|
|
|
2023-06-15 04:13:52 +00:00
|
|
|
typedef struct qfv_renderpass_s {
|
2023-01-30 04:00:35 +00:00
|
|
|
struct vulkan_ctx_s *vulkan_ctx;
|
|
|
|
qfv_label_t label; // for debugging
|
|
|
|
|
|
|
|
VkRenderPassBeginInfo beginInfo;
|
|
|
|
VkSubpassContents subpassContents;
|
|
|
|
|
|
|
|
uint32_t subpass_count;
|
2023-06-15 04:13:52 +00:00
|
|
|
qfv_subpass_t *subpasses;
|
2023-06-22 12:36:14 +00:00
|
|
|
|
|
|
|
qfv_framebuffer_t framebuffer;
|
|
|
|
qfv_framebufferinfo_t *framebufferinfo;
|
2023-06-22 15:43:34 +00:00
|
|
|
VkImageView output;
|
|
|
|
qfv_reference_t outputref;
|
2023-06-15 04:13:52 +00:00
|
|
|
} qfv_renderpass_t;
|
2023-01-30 04:00:35 +00:00
|
|
|
|
2023-03-26 09:22:46 +00:00
|
|
|
typedef struct qfv_render_s {
|
|
|
|
qfv_label_t label;
|
2023-06-15 04:13:52 +00:00
|
|
|
qfv_renderpass_t *active;
|
|
|
|
qfv_renderpass_t *renderpasses;
|
2023-03-26 09:22:46 +00:00
|
|
|
uint32_t num_renderpasses;
|
2023-06-20 06:18:58 +00:00
|
|
|
qfv_output_t output;
|
2023-03-26 09:22:46 +00:00
|
|
|
} qfv_render_t;
|
|
|
|
|
|
|
|
typedef struct qfv_compute_s {
|
|
|
|
qfv_label_t label;
|
|
|
|
qfv_pipeline_t *pipelines;
|
|
|
|
uint32_t pipeline_count;
|
|
|
|
} qfv_compute_t;
|
|
|
|
|
|
|
|
typedef struct qfv_process_s {
|
|
|
|
qfv_label_t label;
|
|
|
|
qfv_taskinfo_t *tasks;
|
2023-03-28 01:28:44 +00:00
|
|
|
uint32_t task_count;
|
2023-03-26 09:22:46 +00:00
|
|
|
} qfv_process_t;
|
|
|
|
|
|
|
|
typedef struct qfv_step_s {
|
|
|
|
qfv_label_t label;
|
|
|
|
qfv_render_t *render;
|
|
|
|
qfv_compute_t *compute;
|
|
|
|
qfv_process_t *process;
|
|
|
|
} qfv_step_t;
|
|
|
|
|
2023-03-22 10:32:49 +00:00
|
|
|
typedef struct qfv_job_s {
|
2023-03-26 09:22:46 +00:00
|
|
|
qfv_label_t label;
|
2023-02-19 03:53:02 +00:00
|
|
|
struct qfv_resource_s *resources;
|
|
|
|
struct qfv_resobj_s *images;
|
|
|
|
struct qfv_resobj_s *image_views;
|
2023-02-20 15:44:26 +00:00
|
|
|
|
|
|
|
uint32_t num_renderpasses;
|
2023-03-22 10:32:49 +00:00
|
|
|
uint32_t num_pipelines;
|
|
|
|
uint32_t num_layouts;
|
2023-03-26 09:22:46 +00:00
|
|
|
uint32_t num_steps;
|
2023-03-22 10:32:49 +00:00
|
|
|
VkRenderPass *renderpasses;
|
|
|
|
VkPipeline *pipelines;
|
|
|
|
VkPipelineLayout *layouts;
|
2023-03-26 09:22:46 +00:00
|
|
|
qfv_step_t *steps;
|
2023-03-28 01:28:44 +00:00
|
|
|
qfv_cmdbufferset_t commands;
|
2023-06-24 05:55:46 +00:00
|
|
|
uint32_t num_dsmanagers;
|
|
|
|
struct qfv_dsmanager_s **dsmanager;
|
2023-03-22 10:32:49 +00:00
|
|
|
} qfv_job_t;
|
2023-02-19 03:53:02 +00:00
|
|
|
|
2023-06-22 07:44:05 +00:00
|
|
|
typedef struct qfv_renderframe_s {
|
|
|
|
VkFence fence;
|
|
|
|
VkSemaphore imageAvailableSemaphore;
|
|
|
|
VkSemaphore renderDoneSemaphore;
|
2023-06-22 08:00:10 +00:00
|
|
|
qfv_cmdpoolmgr_t cmdpool;
|
2023-06-22 07:44:05 +00:00
|
|
|
} qfv_renderframe_t;
|
|
|
|
|
|
|
|
typedef struct qfv_renderframeset_s
|
|
|
|
DARRAY_TYPE (qfv_renderframe_t) qfv_renderframeset_t;
|
|
|
|
|
2023-02-19 03:53:02 +00:00
|
|
|
typedef struct qfv_renderctx_s {
|
|
|
|
struct hashctx_s *hashctx;
|
|
|
|
exprtab_t task_functions;
|
2023-03-22 10:32:49 +00:00
|
|
|
qfv_jobinfo_t *jobinfo;
|
2023-06-25 14:33:47 +00:00
|
|
|
qfv_samplerinfo_t *samplerinfo;
|
2023-03-22 10:32:49 +00:00
|
|
|
qfv_job_t *job;
|
2023-06-22 07:44:05 +00:00
|
|
|
qfv_renderframeset_t frames;
|
2023-02-19 03:53:02 +00:00
|
|
|
} qfv_renderctx_t;
|
|
|
|
|
2023-03-28 01:28:44 +00:00
|
|
|
typedef struct qfv_taskctx_s {
|
|
|
|
struct vulkan_ctx_s *ctx;
|
|
|
|
qfv_pipeline_t *pipeline;
|
2023-06-22 12:36:14 +00:00
|
|
|
qfv_renderpass_t *renderpass;
|
2023-06-16 13:34:08 +00:00
|
|
|
VkCommandBuffer cmd;
|
2023-03-28 01:28:44 +00:00
|
|
|
} qfv_taskctx_t;
|
|
|
|
|
2023-06-22 08:00:10 +00:00
|
|
|
VkCommandBuffer QFV_GetCmdBuffer (struct vulkan_ctx_s *ctx, bool secondary);
|
2023-06-15 06:17:39 +00:00
|
|
|
void QFV_AppendCmdBuffer (struct vulkan_ctx_s *ctx, VkCommandBuffer cmd);
|
|
|
|
|
2023-03-28 01:28:44 +00:00
|
|
|
void QFV_RunRenderJob (struct vulkan_ctx_s *ctx);
|
2023-06-25 14:33:47 +00:00
|
|
|
void QFV_LoadRenderInfo (struct vulkan_ctx_s *ctx, const char *name);
|
|
|
|
void QFV_LoadSamplerInfo (struct vulkan_ctx_s *ctx, const char *name);
|
2023-02-19 03:53:02 +00:00
|
|
|
void QFV_BuildRender (struct vulkan_ctx_s *ctx);
|
2023-02-13 08:45:36 +00:00
|
|
|
void QFV_Render_Init (struct vulkan_ctx_s *ctx);
|
2023-02-19 03:53:02 +00:00
|
|
|
void QFV_Render_Shutdown (struct vulkan_ctx_s *ctx);
|
2023-02-13 15:55:22 +00:00
|
|
|
void QFV_Render_AddTasks (struct vulkan_ctx_s *ctx, exprsym_t *task_sys);
|
2023-06-20 06:18:58 +00:00
|
|
|
|
2023-06-21 05:47:19 +00:00
|
|
|
void QFV_CreateFramebuffer (struct vulkan_ctx_s *ctx, qfv_renderpass_t *rp);
|
|
|
|
|
2023-06-24 12:42:46 +00:00
|
|
|
struct qfv_dsmanager_s *
|
|
|
|
QFV_Render_DSManager (struct vulkan_ctx_s *ctx,
|
|
|
|
const char *setName) __attribute__((pure));
|
2023-06-25 14:33:47 +00:00
|
|
|
VkSampler QFV_Render_Sampler (struct vulkan_ctx_s *ctx, const char *name);
|
2023-06-24 12:42:46 +00:00
|
|
|
|
2023-06-20 06:18:58 +00:00
|
|
|
qfv_step_t *QFV_GetStep (const exprval_t *param, qfv_job_t *job);
|
2023-06-21 08:58:15 +00:00
|
|
|
qfv_step_t *QFV_FindStep (const char *step, qfv_job_t *job) __attribute__((pure));
|
2023-06-24 05:55:46 +00:00
|
|
|
|
2023-03-28 01:28:44 +00:00
|
|
|
#endif//__QFCC__
|
2023-01-30 04:00:35 +00:00
|
|
|
|
|
|
|
#endif//__QF_Vulkan_render_h
|