diff --git a/gsk/gskprivate.h b/gsk/gskprivate.h index 8584be6960..5d9f88c942 100644 --- a/gsk/gskprivate.h +++ b/gsk/gskprivate.h @@ -10,6 +10,9 @@ void gsk_ensure_resources (void); int pango_glyph_string_num_glyphs (PangoGlyphString *glyphs); +typedef struct _GskVulkanRender GskVulkanRender; +typedef struct _GskVulkanRenderPass GskVulkanRenderPass; + G_END_DECLS #endif /* __GSK_PRIVATE_H__ */ diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c index 3cb7e6603d..022c08d74e 100644 --- a/gsk/gskvulkanrenderpass.c +++ b/gsk/gskvulkanrenderpass.c @@ -1124,6 +1124,25 @@ gsk_vulkan_render_pass_collect_vertex_data (GskVulkanRenderPass *self, return n_bytes; } +GskVulkanBuffer * +gsk_vulkan_render_pass_get_vertex_data (GskVulkanRenderPass *self, + GskVulkanRender *render) +{ + gsize n_bytes; + GskVulkanBuffer *buffer; + guchar *data; + + n_bytes = gsk_vulkan_render_pass_count_vertex_data (self); + buffer = gsk_vulkan_buffer_new (self->vulkan, n_bytes); + data = gsk_vulkan_buffer_map (buffer); + + gsk_vulkan_render_pass_collect_vertex_data (self, render, data, 0, n_bytes); + + gsk_vulkan_buffer_unmap (buffer); + + return buffer; +} + void gsk_vulkan_render_pass_reserve_descriptor_sets (GskVulkanRenderPass *self, GskVulkanRender *render) diff --git a/gsk/gskvulkanrenderpassprivate.h b/gsk/gskvulkanrenderpassprivate.h index 56bc9ad587..808ea880e1 100644 --- a/gsk/gskvulkanrenderpassprivate.h +++ b/gsk/gskvulkanrenderpassprivate.h @@ -6,10 +6,10 @@ #include "gsk/gskvulkanbufferprivate.h" #include "gsk/gskvulkanrenderprivate.h" +#include "gsk/gskprivate.h" G_BEGIN_DECLS -typedef struct _GskVulkanRenderPass GskVulkanRenderPass; GskVulkanRenderPass * gsk_vulkan_render_pass_new (GdkVulkanContext *context); void gsk_vulkan_render_pass_free (GskVulkanRenderPass *self); @@ -30,6 +30,8 @@ gsize gsk_vulkan_render_pass_collect_vertex_data (GskVulk guchar *data, gsize offset, gsize total); +GskVulkanBuffer * gsk_vulkan_render_pass_get_vertex_data (GskVulkanRenderPass *self, + GskVulkanRender *render); void gsk_vulkan_render_pass_reserve_descriptor_sets (GskVulkanRenderPass *self, GskVulkanRender *render); diff --git a/gsk/gskvulkanrenderprivate.h b/gsk/gskvulkanrenderprivate.h index ed35019c3f..4bd2484d81 100644 --- a/gsk/gskvulkanrenderprivate.h +++ b/gsk/gskvulkanrenderprivate.h @@ -6,6 +6,8 @@ #include "gsk/gskvulkanimageprivate.h" #include "gsk/gskvulkanpipelineprivate.h" +#include "gsk/gskvulkanrenderpassprivate.h" +#include "gsk/gskprivate.h" G_BEGIN_DECLS @@ -50,8 +52,6 @@ typedef enum { GSK_VULKAN_N_PIPELINES } GskVulkanPipelineType; -typedef struct _GskVulkanRender GskVulkanRender; - GskVulkanRender * gsk_vulkan_render_new (GskRenderer *renderer, GdkVulkanContext *context); void gsk_vulkan_render_free (GskVulkanRender *self);