2023-03-31 19:11:10 +00:00
|
|
|
#pragma once
|
2016-12-07 13:50:52 +00:00
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
2016-12-08 12:26:36 +00:00
|
|
|
#include <gsk/gskrendernode.h>
|
|
|
|
|
2018-01-06 14:36:55 +00:00
|
|
|
#include "gskvulkanimageprivate.h"
|
|
|
|
#include "gskvulkanpipelineprivate.h"
|
|
|
|
#include "gskvulkanrenderpassprivate.h"
|
2017-09-28 00:55:14 +00:00
|
|
|
#include "gsk/gskprivate.h"
|
2016-12-07 13:50:52 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2016-12-14 08:40:15 +00:00
|
|
|
typedef enum {
|
2016-12-26 16:11:13 +00:00
|
|
|
GSK_VULKAN_PIPELINE_LINEAR_GRADIENT,
|
|
|
|
GSK_VULKAN_PIPELINE_LINEAR_GRADIENT_CLIP,
|
|
|
|
GSK_VULKAN_PIPELINE_LINEAR_GRADIENT_CLIP_ROUNDED,
|
2017-01-10 13:59:20 +00:00
|
|
|
GSK_VULKAN_PIPELINE_BORDER,
|
|
|
|
GSK_VULKAN_PIPELINE_BORDER_CLIP,
|
|
|
|
GSK_VULKAN_PIPELINE_BORDER_CLIP_ROUNDED,
|
2017-09-03 13:54:47 +00:00
|
|
|
GSK_VULKAN_PIPELINE_BLUR,
|
|
|
|
GSK_VULKAN_PIPELINE_BLUR_CLIP,
|
|
|
|
GSK_VULKAN_PIPELINE_BLUR_CLIP_ROUNDED,
|
2017-09-01 20:58:42 +00:00
|
|
|
GSK_VULKAN_PIPELINE_TEXT,
|
|
|
|
GSK_VULKAN_PIPELINE_TEXT_CLIP,
|
|
|
|
GSK_VULKAN_PIPELINE_TEXT_CLIP_ROUNDED,
|
|
|
|
GSK_VULKAN_PIPELINE_COLOR_TEXT,
|
|
|
|
GSK_VULKAN_PIPELINE_COLOR_TEXT_CLIP,
|
|
|
|
GSK_VULKAN_PIPELINE_COLOR_TEXT_CLIP_ROUNDED,
|
2016-12-14 08:40:15 +00:00
|
|
|
/* add more */
|
|
|
|
GSK_VULKAN_N_PIPELINES
|
|
|
|
} GskVulkanPipelineType;
|
|
|
|
|
2023-05-23 03:08:13 +00:00
|
|
|
typedef enum {
|
|
|
|
GSK_VULKAN_SAMPLER_DEFAULT,
|
2023-05-23 03:26:08 +00:00
|
|
|
GSK_VULKAN_SAMPLER_REPEAT,
|
|
|
|
GSK_VULKAN_SAMPLER_NEAREST
|
2023-05-23 03:08:13 +00:00
|
|
|
} GskVulkanRenderSampler;
|
|
|
|
|
2016-12-08 16:46:08 +00:00
|
|
|
GskVulkanRender * gsk_vulkan_render_new (GskRenderer *renderer,
|
2016-12-08 23:06:59 +00:00
|
|
|
GdkVulkanContext *context);
|
2016-12-08 16:46:08 +00:00
|
|
|
void gsk_vulkan_render_free (GskVulkanRender *self);
|
2016-12-08 12:26:36 +00:00
|
|
|
|
2016-12-08 17:40:35 +00:00
|
|
|
gboolean gsk_vulkan_render_is_busy (GskVulkanRender *self);
|
2016-12-08 21:35:16 +00:00
|
|
|
void gsk_vulkan_render_reset (GskVulkanRender *self,
|
2016-12-22 18:01:07 +00:00
|
|
|
GskVulkanImage *target,
|
2018-03-28 13:01:34 +00:00
|
|
|
const graphene_rect_t *rect,
|
|
|
|
const cairo_region_t *clip);
|
2016-12-08 17:40:35 +00:00
|
|
|
|
2016-12-08 16:55:32 +00:00
|
|
|
GskRenderer * gsk_vulkan_render_get_renderer (GskVulkanRender *self);
|
|
|
|
|
2016-12-08 12:26:36 +00:00
|
|
|
void gsk_vulkan_render_add_cleanup_image (GskVulkanRender *self,
|
|
|
|
GskVulkanImage *image);
|
|
|
|
|
|
|
|
void gsk_vulkan_render_add_node (GskVulkanRender *self,
|
|
|
|
GskRenderNode *node);
|
|
|
|
|
2017-09-30 15:04:16 +00:00
|
|
|
void gsk_vulkan_render_add_render_pass (GskVulkanRender *self,
|
|
|
|
GskVulkanRenderPass *pass);
|
2017-09-28 00:56:01 +00:00
|
|
|
|
2016-12-08 12:26:36 +00:00
|
|
|
void gsk_vulkan_render_upload (GskVulkanRender *self);
|
|
|
|
|
2023-06-29 04:36:17 +00:00
|
|
|
VkPipeline gsk_vulkan_render_create_pipeline (GskVulkanRender *self,
|
|
|
|
const char *shader_name,
|
|
|
|
const char *clip_type,
|
|
|
|
const VkPipelineVertexInputStateCreateInfo *vertex_input_state,
|
|
|
|
VkFormat format,
|
|
|
|
VkRenderPass render_pass);
|
2016-12-14 08:40:15 +00:00
|
|
|
GskVulkanPipeline * gsk_vulkan_render_get_pipeline (GskVulkanRender *self,
|
2023-06-17 17:15:05 +00:00
|
|
|
GskVulkanPipelineType pipeline_type,
|
|
|
|
VkRenderPass render_pass);
|
2023-05-23 03:08:13 +00:00
|
|
|
gsize gsk_vulkan_render_get_image_descriptor (GskVulkanRender *self,
|
2023-06-28 18:50:43 +00:00
|
|
|
GskVulkanImage *source,
|
|
|
|
GskVulkanRenderSampler render_sampler);
|
2023-05-25 20:21:23 +00:00
|
|
|
gsize gsk_vulkan_render_get_buffer_descriptor (GskVulkanRender *self,
|
|
|
|
GskVulkanBuffer *buffer);
|
|
|
|
guchar * gsk_vulkan_render_get_buffer_memory (GskVulkanRender *self,
|
|
|
|
gsize size,
|
|
|
|
gsize alignment,
|
|
|
|
gsize *out_offset);
|
2023-06-20 13:39:29 +00:00
|
|
|
void gsk_vulkan_render_bind_descriptor_sets (GskVulkanRender *self,
|
|
|
|
VkCommandBuffer command_buffer);
|
2023-05-20 00:56:02 +00:00
|
|
|
|
2017-09-30 02:38:59 +00:00
|
|
|
void gsk_vulkan_render_draw (GskVulkanRender *self);
|
2023-06-25 03:02:48 +00:00
|
|
|
void gsk_vulkan_render_draw_pass (GskVulkanRender *self,
|
|
|
|
GskVulkanRenderPass *pass,
|
|
|
|
VkFence fence);
|
2016-12-07 13:50:52 +00:00
|
|
|
|
2017-11-02 20:39:00 +00:00
|
|
|
GdkTexture * gsk_vulkan_render_download_target (GskVulkanRender *self);
|
2023-05-24 14:55:18 +00:00
|
|
|
VkFence gsk_vulkan_render_get_fence (GskVulkanRender *self);
|
2016-12-22 18:01:07 +00:00
|
|
|
|
2016-12-07 13:50:52 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|