mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 10:50:08 +00:00
742ef96748
Split out the scissor op into its own implementation as a proof of concept of how ops are meant to look when they are actually working.
71 lines
4.6 KiB
C
71 lines
4.6 KiB
C
#pragma once
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
#include "gskvulkanrenderpassprivate.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _GskVulkanOp GskVulkanOp;
|
|
typedef struct _GskVulkanOpClass GskVulkanOpClass;
|
|
|
|
struct _GskVulkanOp
|
|
{
|
|
const GskVulkanOpClass *op_class;
|
|
};
|
|
|
|
struct _GskVulkanOpClass
|
|
{
|
|
gsize size;
|
|
|
|
void (* finish) (GskVulkanOp *op);
|
|
|
|
void (* upload) (GskVulkanOp *op,
|
|
GskVulkanRenderPass *pass,
|
|
GskVulkanRender *render,
|
|
GskVulkanUploader *uploader,
|
|
const graphene_rect_t *clip,
|
|
const graphene_vec2_t *scale);
|
|
gsize (* count_vertex_data) (GskVulkanOp *op,
|
|
gsize n_bytes);
|
|
void (* collect_vertex_data) (GskVulkanOp *op,
|
|
GskVulkanRenderPass *pass,
|
|
GskVulkanRender *render,
|
|
guchar *data);
|
|
void (* reserve_descriptor_sets) (GskVulkanOp *op,
|
|
GskVulkanRender *render);
|
|
GskVulkanPipeline * (* get_pipeline) (GskVulkanOp *op);
|
|
void (* command) (GskVulkanOp *op,
|
|
VkPipelineLayout pipeline_layout,
|
|
VkCommandBuffer command_buffer);
|
|
};
|
|
|
|
/* 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)
|
|
|
|
void gsk_vulkan_op_init (GskVulkanOp *op,
|
|
const GskVulkanOpClass *op_class);
|
|
void gsk_vulkan_op_finish (GskVulkanOp *op);
|
|
|
|
void gsk_vulkan_op_upload (GskVulkanOp *op,
|
|
GskVulkanRenderPass *pass,
|
|
GskVulkanRender *render,
|
|
GskVulkanUploader *uploader,
|
|
const graphene_rect_t *clip,
|
|
const graphene_vec2_t *scale);
|
|
gsize gsk_vulkan_op_count_vertex_data (GskVulkanOp *op,
|
|
gsize n_bytes);
|
|
void gsk_vulkan_op_collect_vertex_data (GskVulkanOp *op,
|
|
GskVulkanRenderPass *pass,
|
|
GskVulkanRender *render,
|
|
guchar *data);
|
|
void gsk_vulkan_op_reserve_descriptor_sets (GskVulkanOp *op,
|
|
GskVulkanRender *render);
|
|
GskVulkanPipeline * gsk_vulkan_op_get_pipeline (GskVulkanOp *op);
|
|
void gsk_vulkan_op_command (GskVulkanOp *op,
|
|
VkPipelineLayout pipeline_layout,
|
|
VkCommandBuffer command_buffer);
|
|
|
|
G_END_DECLS
|
|
|