2023-06-24 02:00:02 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
|
|
|
|
#include "gskvulkanrenderpassprivate.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2023-07-09 13:40:48 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GSK_VULKAN_STAGE_UPLOAD,
|
|
|
|
GSK_VULKAN_STAGE_COMMAND,
|
2023-07-15 20:19:20 +00:00
|
|
|
GSK_VULKAN_STAGE_SHADER,
|
2023-07-09 13:40:48 +00:00
|
|
|
/* magic ones */
|
|
|
|
GSK_VULKAN_STAGE_BEGIN_PASS,
|
|
|
|
GSK_VULKAN_STAGE_END_PASS
|
|
|
|
} GskVulkanStage;
|
|
|
|
|
2023-06-24 02:00:02 +00:00
|
|
|
struct _GskVulkanOp
|
|
|
|
{
|
|
|
|
const GskVulkanOpClass *op_class;
|
2023-06-28 02:30:35 +00:00
|
|
|
|
2023-07-06 04:40:09 +00:00
|
|
|
GskVulkanOp *next;
|
2023-06-24 02:00:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GskVulkanOpClass
|
|
|
|
{
|
|
|
|
gsize size;
|
2023-07-09 13:40:48 +00:00
|
|
|
GskVulkanStage stage;
|
2023-06-24 02:00:02 +00:00
|
|
|
|
|
|
|
void (* finish) (GskVulkanOp *op);
|
|
|
|
|
2023-07-05 04:32:52 +00:00
|
|
|
void (* print) (GskVulkanOp *op,
|
|
|
|
GString *string,
|
|
|
|
guint indent);
|
|
|
|
|
2023-06-24 02:00:02 +00:00
|
|
|
gsize (* count_vertex_data) (GskVulkanOp *op,
|
|
|
|
gsize n_bytes);
|
|
|
|
void (* collect_vertex_data) (GskVulkanOp *op,
|
|
|
|
guchar *data);
|
|
|
|
void (* reserve_descriptor_sets) (GskVulkanOp *op,
|
|
|
|
GskVulkanRender *render);
|
2023-07-09 13:56:30 +00:00
|
|
|
GskVulkanOp * (* command) (GskVulkanOp *op,
|
2023-06-25 20:16:37 +00:00
|
|
|
GskVulkanRender *render,
|
2023-07-15 09:39:18 +00:00
|
|
|
VkRenderPass render_pass,
|
2023-06-24 02:00:02 +00:00
|
|
|
VkCommandBuffer command_buffer);
|
|
|
|
};
|
|
|
|
|
2023-06-24 02:49:39 +00:00
|
|
|
/* ensures alignment of ops to multipes of 16 bytes - and that makes graphene happy */
|
|
|
|
#define GSK_VULKAN_OP_SIZE(struct_name) ((sizeof(struct_name) + 15) & ~15)
|
|
|
|
|
2023-07-09 18:28:12 +00:00
|
|
|
GskVulkanOp * gsk_vulkan_op_alloc (GskVulkanRender *render,
|
2023-06-24 02:49:39 +00:00
|
|
|
const GskVulkanOpClass *op_class);
|
2023-06-24 02:00:02 +00:00
|
|
|
void gsk_vulkan_op_finish (GskVulkanOp *op);
|
|
|
|
|
2023-07-05 04:32:52 +00:00
|
|
|
void gsk_vulkan_op_print (GskVulkanOp *op,
|
|
|
|
GString *string,
|
|
|
|
guint indent);
|
|
|
|
|
2023-06-24 02:00:02 +00:00
|
|
|
gsize gsk_vulkan_op_count_vertex_data (GskVulkanOp *op,
|
|
|
|
gsize n_bytes);
|
|
|
|
void gsk_vulkan_op_collect_vertex_data (GskVulkanOp *op,
|
|
|
|
guchar *data);
|
|
|
|
void gsk_vulkan_op_reserve_descriptor_sets (GskVulkanOp *op,
|
|
|
|
GskVulkanRender *render);
|
2023-07-09 13:56:30 +00:00
|
|
|
GskVulkanOp * gsk_vulkan_op_command (GskVulkanOp *op,
|
2023-06-25 20:16:37 +00:00
|
|
|
GskVulkanRender *render,
|
2023-07-15 09:39:18 +00:00
|
|
|
VkRenderPass render_pass,
|
2023-07-09 14:27:02 +00:00
|
|
|
VkCommandBuffer command_buffer);
|
|
|
|
|
2023-06-24 02:00:02 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|