vulkan: Initialize ops differently
authorBenjamin Otte <otte@redhat.com>
Wed, 28 Jun 2023 02:30:35 +0000 (04:30 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Jul 2023 10:12:36 +0000 (12:12 +0200)
Instead of creating the op manually, just pass in the renderpass and
have the op created from there.

This way ops aren't really initialized anymore, they are more appended
to the queue, so instead of foo_op_init() we can just call the function
foo_op().

16 files changed:
gsk/vulkan/gskvulkancolormatrixop.c
gsk/vulkan/gskvulkancolormatrixopprivate.h
gsk/vulkan/gskvulkanoffscreenop.c
gsk/vulkan/gskvulkanoffscreenopprivate.h
gsk/vulkan/gskvulkanop.c
gsk/vulkan/gskvulkanopprivate.h
gsk/vulkan/gskvulkanrenderpass.c
gsk/vulkan/gskvulkanrenderpassprivate.h
gsk/vulkan/gskvulkanscissorop.c
gsk/vulkan/gskvulkanscissoropprivate.h
gsk/vulkan/gskvulkantextureop.c
gsk/vulkan/gskvulkantextureopprivate.h
gsk/vulkan/gskvulkanuploadcairoop.c
gsk/vulkan/gskvulkanuploadcairoopprivate.h
gsk/vulkan/gskvulkanuploadop.c
gsk/vulkan/gskvulkanuploadopprivate.h

index fdf00f3f21e75903b1176a1050e61138be6a036b..2fcd151f1d94f382e058a3fc5b5d64a60a3bf1d2 100644 (file)
@@ -124,25 +124,19 @@ static const GskVulkanOpClass GSK_VULKAN_COLOR_MATRIX_OP_CLASS = {
   gsk_vulkan_color_matrix_op_command
 };
 
-gsize
-gsk_vulkan_color_matrix_op_size (void)
-{
-  return GSK_VULKAN_COLOR_MATRIX_OP_CLASS.size;
-}
-
 void
-gsk_vulkan_color_matrix_op_init (GskVulkanOp             *op,
-                                 GskVulkanPipeline       *pipeline,
-                                 GskVulkanImage          *image,
-                                 const graphene_rect_t   *rect,
-                                 const graphene_point_t  *offset,
-                                 const graphene_rect_t   *tex_rect,
-                                 const graphene_matrix_t *color_matrix,
-                                 const graphene_vec4_t   *color_offset)
+gsk_vulkan_color_matrix_op (GskVulkanRenderPass     *render_pass,
+                            GskVulkanPipeline       *pipeline,
+                            GskVulkanImage          *image,
+                            const graphene_rect_t   *rect,
+                            const graphene_point_t  *offset,
+                            const graphene_rect_t   *tex_rect,
+                            const graphene_matrix_t *color_matrix,
+                            const graphene_vec4_t   *color_offset)
 {
-  GskVulkanColorMatrixOp *self = (GskVulkanColorMatrixOp *) op;
+  GskVulkanColorMatrixOp *self;
 
-  gsk_vulkan_op_init (op, &GSK_VULKAN_COLOR_MATRIX_OP_CLASS);
+  self = (GskVulkanColorMatrixOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_COLOR_MATRIX_OP_CLASS);
 
   self->pipeline = pipeline;
   self->image = g_object_ref (image);
index 3e6f104b768e69714fe9150f8d6d9c4d0d78dbc8..0304ad21e86876c6f74e78a131e747227d1760c9 100644 (file)
@@ -4,9 +4,7 @@
 
 G_BEGIN_DECLS
 
-gsize                   gsk_vulkan_color_matrix_op_size                 (void) G_GNUC_CONST;
-
-void                    gsk_vulkan_color_matrix_op_init                 (GskVulkanOp                    *op,
+void                    gsk_vulkan_color_matrix_op                      (GskVulkanRenderPass            *render_pass,
                                                                          GskVulkanPipeline              *pipeline,
                                                                          GskVulkanImage                 *image,
                                                                          const graphene_rect_t          *rect,
index 8bf4e7181da349a43cccc86bedbcebb49b301874..67125802663aa18026d2b6f76541f8a1a87a4a2f 100644 (file)
@@ -90,22 +90,16 @@ static const GskVulkanOpClass GSK_VULKAN_OFFSCREEN_OP_CLASS = {
   gsk_vulkan_offscreen_op_command
 };
 
-gsize
-gsk_vulkan_offscreen_op_size (void)
-{
-  return GSK_VULKAN_OFFSCREEN_OP_CLASS.size;
-}
-
 GskVulkanImage *
-gsk_vulkan_offscreen_op_init (GskVulkanOp           *op,
-                              GdkVulkanContext      *context,
-                              GskVulkanRender       *render,
-                              const graphene_vec2_t *scale,
-                              const graphene_rect_t *viewport,
-                              VkSemaphore            signal_semaphore,
-                              GskRenderNode         *node)
+gsk_vulkan_offscreen_op (GskVulkanRenderPass   *render_pass,
+                         GdkVulkanContext      *context,
+                         GskVulkanRender       *render,
+                         const graphene_vec2_t *scale,
+                         const graphene_rect_t *viewport,
+                         VkSemaphore            signal_semaphore,
+                         GskRenderNode         *node)
 {
-  GskVulkanOffscreenOp *self = (GskVulkanOffscreenOp *) op;
+  GskVulkanOffscreenOp *self;
   graphene_rect_t view;
   cairo_region_t *clip;
   float scale_x, scale_y;
@@ -117,7 +111,7 @@ gsk_vulkan_offscreen_op_init (GskVulkanOp           *op,
                              ceil (scale_x * viewport->size.width),
                              ceil (scale_y * viewport->size.height));
 
-  gsk_vulkan_op_init (op, &GSK_VULKAN_OFFSCREEN_OP_CLASS);
+  self = (GskVulkanOffscreenOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_OFFSCREEN_OP_CLASS);
 
   self->image = gsk_vulkan_image_new_for_offscreen (context,
                                                     gdk_vulkan_context_get_offscreen_format (context,
index 16687ead352564d34492a33d018b77c474163b16..bb43dfb075623e699e6881591f7388b07bb83d02 100644 (file)
@@ -4,9 +4,7 @@
 
 G_BEGIN_DECLS
 
-gsize                   gsk_vulkan_offscreen_op_size                    (void) G_GNUC_CONST;
-
-GskVulkanImage *        gsk_vulkan_offscreen_op_init                    (GskVulkanOp                    *op,
+GskVulkanImage *        gsk_vulkan_offscreen_op                         (GskVulkanRenderPass            *render_pass,
                                                                          GdkVulkanContext               *context,
                                                                          GskVulkanRender                *render,
                                                                          const graphene_vec2_t          *scale,
index d0e38fad772a2154f66d016d66fc22b1f6825a00..a8e304d13ff053356aea3fa9d9e6ced918f31bfe 100644 (file)
@@ -2,11 +2,17 @@
 
 #include "gskvulkanopprivate.h"
 
-void
-gsk_vulkan_op_init (GskVulkanOp            *op,
-                    const GskVulkanOpClass *op_class)
+GskVulkanOp *
+gsk_vulkan_op_alloc (GskVulkanRenderPass    *render_pass,
+                     const GskVulkanOpClass *op_class)
 {
+  GskVulkanOp *op;
+
+  op = gsk_vulkan_render_pass_alloc_op (render_pass,
+                                        op_class->size);
   op->op_class = op_class;
+
+  return op;
 }
 
 void
index f99a90a2174d5e4a21197495a367223aeaa18d15..e943e9c46630207acfdd6d9d56c41f55d0b6652d 100644 (file)
@@ -12,6 +12,8 @@ typedef struct _GskVulkanOpClass GskVulkanOpClass;
 struct _GskVulkanOp
 {
   const GskVulkanOpClass *op_class;
+
+  VkPipeline            pipeline;
 };
 
 struct _GskVulkanOpClass
@@ -44,7 +46,7 @@ struct _GskVulkanOpClass
 /* 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,
+GskVulkanOp *           gsk_vulkan_op_alloc                             (GskVulkanRenderPass    *render_pass,
                                                                          const GskVulkanOpClass *op_class);
 void                    gsk_vulkan_op_finish                            (GskVulkanOp            *op);
 
index 9ef656eaefef582f4d3f15892e2169fe6ec1d947..0f6a236ea9d6f493283169b7906ccff0a978efeb 100644 (file)
@@ -290,7 +290,7 @@ round_up (gsize number, gsize divisor)
   return (number + divisor - 1) / divisor * divisor;
 }
 
-static gpointer
+gpointer
 gsk_vulkan_render_pass_alloc_op (GskVulkanRenderPass *self,
                                  gsize                size)
 {
@@ -316,8 +316,7 @@ gsk_vulkan_render_pass_append_scissor (GskVulkanRenderPass       *self,
                                        GskRenderNode             *node,
                                        const GskVulkanParseState *state)
 {
-  gsk_vulkan_scissor_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_scissor_op_size ()),
-                              &state->scissor);
+  gsk_vulkan_scissor_op (self, &state->scissor);
 }
 
 static void
@@ -377,9 +376,7 @@ gsk_vulkan_render_pass_get_node_as_image (GskVulkanRenderPass       *self,
         result = gsk_vulkan_renderer_get_texture_image (renderer, texture);
         if (result == NULL)
           {
-            result = gsk_vulkan_upload_op_init_texture (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_op_size ()),
-                                                        self->vulkan,
-                                                        texture);
+            result = gsk_vulkan_upload_op (self, self->vulkan, texture);
             gsk_vulkan_renderer_add_texture_image (renderer, texture, result);
           }
 
@@ -397,11 +394,11 @@ gsk_vulkan_render_pass_get_node_as_image (GskVulkanRenderPass       *self,
         if (clipped.size.width == 0 || clipped.size.height == 0)
           return NULL;
 
-        result = gsk_vulkan_upload_cairo_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_cairo_op_size ()),
-                                                  self->vulkan,
-                                                  node,
-                                                  &state->scale,
-                                                  &clipped);
+        result = gsk_vulkan_upload_cairo_op (self,
+                                             self->vulkan,
+                                             node,
+                                             &state->scale,
+                                             &clipped);
 
         *tex_bounds = clipped;
         return result;
@@ -432,13 +429,13 @@ gsk_vulkan_render_pass_get_node_as_image (GskVulkanRenderPass       *self,
                            &semaphore);
         g_array_append_val (self->wait_semaphores, semaphore);
 
-        result = gsk_vulkan_offscreen_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_offscreen_op_size ()),
-                                               self->vulkan,
-                                               render,
-                                               &state->scale,
-                                               &clipped,
-                                               semaphore,
-                                               node);
+        result = gsk_vulkan_offscreen_op (self,
+                                          self->vulkan,
+                                          render,
+                                          &state->scale,
+                                          &clipped,
+                                          semaphore,
+                                          node);
 
         return result;
       }
@@ -467,11 +464,11 @@ gsk_vulkan_render_pass_add_fallback_node (GskVulkanRenderPass       *self,
   if (clipped.size.width == 0 || clipped.size.height == 0)
     return TRUE;
 
-  image = gsk_vulkan_upload_cairo_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_cairo_op_size ()),
-                                           self->vulkan,
-                                           node,
-                                           &state->scale,
-                                           &clipped);
+  image = gsk_vulkan_upload_cairo_op (self,
+                                      self->vulkan,
+                                      node,
+                                      &state->scale,
+                                      &clipped);
 
   if (gsk_vulkan_clip_contains_rect (&state->clip, &state->offset, &node->bounds))
     pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE;
@@ -480,13 +477,13 @@ gsk_vulkan_render_pass_add_fallback_node (GskVulkanRenderPass       *self,
   else
     pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE_CLIP_ROUNDED;
 
-  gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()),
-                              gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
-                              image,
-                              GSK_VULKAN_SAMPLER_DEFAULT,
-                              &node->bounds,
-                              &state->offset,
-                              &clipped);
+  gsk_vulkan_texture_op (self,
+                         gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
+                         image,
+                         GSK_VULKAN_SAMPLER_DEFAULT,
+                         &node->bounds,
+                         &state->offset,
+                         &clipped);
 
   return TRUE;
 }
@@ -630,19 +627,17 @@ gsk_vulkan_render_pass_add_texture_node (GskVulkanRenderPass       *self,
   image = gsk_vulkan_renderer_get_texture_image (renderer, texture);
   if (image == NULL)
     {
-      image = gsk_vulkan_upload_op_init_texture (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_op_size ()),
-                                                 self->vulkan,
-                                                 texture);
+      image = gsk_vulkan_upload_op (self, self->vulkan, texture);
       gsk_vulkan_renderer_add_texture_image (renderer, texture, image);
     }
 
-  gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()),
-                              gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
-                              image,
-                              GSK_VULKAN_SAMPLER_DEFAULT,
-                              &node->bounds,
-                              &state->offset,
-                              &node->bounds);
+  gsk_vulkan_texture_op (self,
+                         gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
+                         image,
+                         GSK_VULKAN_SAMPLER_DEFAULT,
+                         &node->bounds,
+                         &state->offset,
+                         &node->bounds);
 
   return TRUE;
 }
@@ -683,19 +678,17 @@ gsk_vulkan_render_pass_add_texture_scale_node (GskVulkanRenderPass       *self,
   image = gsk_vulkan_renderer_get_texture_image (renderer, texture);
   if (image == NULL)
     {
-      image = gsk_vulkan_upload_op_init_texture (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_upload_op_size ()),
-                                                 self->vulkan,
-                                                 texture);
+      image = gsk_vulkan_upload_op (self, self->vulkan, texture);
       gsk_vulkan_renderer_add_texture_image (renderer, texture, image);
     }
 
-  gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()),
-                              gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
-                              image,
-                              sampler,
-                              &node->bounds,
-                              &state->offset,
-                              &node->bounds);
+  gsk_vulkan_texture_op (self,
+                         gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
+                         image,
+                         sampler,
+                         &node->bounds,
+                         &state->offset,
+                         &node->bounds);
 
   return TRUE;
 }
@@ -946,14 +939,14 @@ gsk_vulkan_render_pass_add_opacity_node (GskVulkanRenderPass       *self,
                                    });
   graphene_vec4_init (&color_offset, 0.0, 0.0, 0.0, 0.0);
 
-  gsk_vulkan_color_matrix_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_color_matrix_op_size ()),
-                                   gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
-                                   image,
-                                   &node->bounds,
-                                   &state->offset,
-                                   &tex_rect,
-                                   &color_matrix,
-                                   &color_offset);
+  gsk_vulkan_color_matrix_op (self,
+                              gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
+                              image,
+                              &node->bounds,
+                              &state->offset,
+                              &tex_rect,
+                              &color_matrix,
+                              &color_offset);
 
   return TRUE;
 }
@@ -983,14 +976,14 @@ gsk_vulkan_render_pass_add_color_matrix_node (GskVulkanRenderPass       *self,
   else
     pipeline_type = GSK_VULKAN_PIPELINE_COLOR_MATRIX_CLIP_ROUNDED;
 
-  gsk_vulkan_color_matrix_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_color_matrix_op_size ()),
-                                   gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
-                                   image,
-                                   &node->bounds,
-                                   &state->offset,
-                                   &tex_rect,
-                                   gsk_color_matrix_node_get_color_matrix (node),
-                                   gsk_color_matrix_node_get_color_offset (node));
+  gsk_vulkan_color_matrix_op (self,
+                              gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
+                              image,
+                              &node->bounds,
+                              &state->offset,
+                              &tex_rect,
+                              gsk_color_matrix_node_get_color_matrix (node),
+                              gsk_color_matrix_node_get_color_offset (node));
 
   return TRUE;
 }
@@ -1166,13 +1159,13 @@ gsk_vulkan_render_pass_add_repeat_node (GskVulkanRenderPass       *self,
 
   g_array_append_val (self->wait_semaphores, semaphore);
 
-  image = gsk_vulkan_offscreen_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_offscreen_op_size ()),
-                                        self->vulkan,
-                                        render,
-                                        &state->scale,
-                                        child_bounds,
-                                        semaphore,
-                                        gsk_repeat_node_get_child (node));
+  image = gsk_vulkan_offscreen_op (self,
+                                   self->vulkan,
+                                   render,
+                                   &state->scale,
+                                   child_bounds,
+                                   semaphore,
+                                   gsk_repeat_node_get_child (node));
 
   if (gsk_vulkan_clip_contains_rect (&state->clip, &state->offset, &node->bounds))
     pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE;
@@ -1181,13 +1174,13 @@ gsk_vulkan_render_pass_add_repeat_node (GskVulkanRenderPass       *self,
   else
     pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE_CLIP_ROUNDED;
 
-  gsk_vulkan_texture_op_init (gsk_vulkan_render_pass_alloc_op (self, gsk_vulkan_texture_op_size ()),
-                              gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
-                              image,
-                              GSK_VULKAN_SAMPLER_REPEAT,
-                              &node->bounds,
-                              &state->offset,
-                              child_bounds);
+  gsk_vulkan_texture_op (self,
+                         gsk_vulkan_render_pass_get_pipeline (self, render, pipeline_type),
+                         image,
+                         GSK_VULKAN_SAMPLER_REPEAT,
+                         &node->bounds,
+                         &state->offset,
+                         child_bounds);
 
   return TRUE;
 }
index 18b1be1b40cefd9111f39092f07950b057281f45..cd5bb678c64219cbafd03582e899cc7b5424440b 100644 (file)
@@ -23,6 +23,9 @@ void                    gsk_vulkan_render_pass_add                      (GskVulk
                                                                          GskVulkanRender        *render,
                                                                          GskRenderNode          *node);
 
+gpointer                gsk_vulkan_render_pass_alloc_op                 (GskVulkanRenderPass    *self,
+                                                                         gsize                   size);
+
 void                    gsk_vulkan_render_pass_upload                   (GskVulkanRenderPass    *self,
                                                                          GskVulkanRender        *render,
                                                                          GskVulkanUploader      *uploader);
index c8f792f7caeec594add3da240df8b4b26806cac1..7f9c9e6f6b7a39b97d4c4c8ec98d435a998353a1 100644 (file)
@@ -81,19 +81,13 @@ static const GskVulkanOpClass GSK_VULKAN_SCISSOR_OP_CLASS = {
   gsk_vulkan_scissor_op_command
 };
 
-gsize
-gsk_vulkan_scissor_op_size (void)
-{
-  return GSK_VULKAN_SCISSOR_OP_CLASS.size;
-}
-
 void
-gsk_vulkan_scissor_op_init (GskVulkanOp                 *op,
-                            const cairo_rectangle_int_t *rect)
+gsk_vulkan_scissor_op (GskVulkanRenderPass         *render_pass,
+                       const cairo_rectangle_int_t *rect)
 {
-  GskVulkanScissorOp *self = (GskVulkanScissorOp *) op;
+  GskVulkanScissorOp *self;
 
-  gsk_vulkan_op_init (op, &GSK_VULKAN_SCISSOR_OP_CLASS);
+  self = (GskVulkanScissorOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_SCISSOR_OP_CLASS);
 
   self->rect = *rect;
 }
index 6e46512cf94a3f6e6290a4c8e9c1d9beeb2111c1..a4f637d8ccc557bf394b00c4e2d121437aee7a14 100644 (file)
@@ -4,9 +4,7 @@
 
 G_BEGIN_DECLS
 
-gsize                   gsk_vulkan_scissor_op_size                      (void) G_GNUC_CONST;
-
-void                    gsk_vulkan_scissor_op_init                      (GskVulkanOp                    *op,
+void                    gsk_vulkan_scissor_op                           (GskVulkanRenderPass            *render_pass,
                                                                          const cairo_rectangle_int_t    *rect);
 
 
index 873f524567e142bb7ae9db21cbc4fa7a5544a3ec..e798d85619c4cae39116aab1b652d7456511b977 100644 (file)
@@ -121,24 +121,18 @@ static const GskVulkanOpClass GSK_VULKAN_TEXTURE_OP_CLASS = {
   gsk_vulkan_texture_op_command
 };
 
-gsize
-gsk_vulkan_texture_op_size (void)
-{
-  return GSK_VULKAN_TEXTURE_OP_CLASS.size;
-}
-
 void
-gsk_vulkan_texture_op_init (GskVulkanOp            *op,
-                            GskVulkanPipeline      *pipeline,
-                            GskVulkanImage         *image,
-                            GskVulkanRenderSampler  sampler,
-                            const graphene_rect_t  *rect,
-                            const graphene_point_t *offset,
-                            const graphene_rect_t  *tex_rect)
+gsk_vulkan_texture_op (GskVulkanRenderPass    *render_pass,
+                       GskVulkanPipeline      *pipeline,
+                       GskVulkanImage         *image,
+                       GskVulkanRenderSampler  sampler,
+                       const graphene_rect_t  *rect,
+                       const graphene_point_t *offset,
+                       const graphene_rect_t  *tex_rect)
 {
-  GskVulkanTextureOp *self = (GskVulkanTextureOp *) op;
+  GskVulkanTextureOp *self;
 
-  gsk_vulkan_op_init (op, &GSK_VULKAN_TEXTURE_OP_CLASS);
+  self = (GskVulkanTextureOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_TEXTURE_OP_CLASS);
 
   self->pipeline = pipeline;
   self->image = g_object_ref (image);
index eb8e9f283ff03dee0ebe2e339e10c534b53ce909..2ca73066c156884a65573b7fb7c2cb8c7b2d53a5 100644 (file)
@@ -4,9 +4,7 @@
 
 G_BEGIN_DECLS
 
-gsize                   gsk_vulkan_texture_op_size                      (void) G_GNUC_CONST;
-
-void                    gsk_vulkan_texture_op_init                      (GskVulkanOp                    *op,
+void                    gsk_vulkan_texture_op                           (GskVulkanRenderPass            *render_pass,
                                                                          GskVulkanPipeline              *pipeline,
                                                                          GskVulkanImage                 *image,
                                                                          GskVulkanRenderSampler          sampler,
index 962714c289154b90a12ca0ec8d288b888b8a44d9..ad84df6a771f0a74b94aec0ae7934f5382dda8e9 100644 (file)
@@ -106,22 +106,16 @@ static const GskVulkanOpClass GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS = {
   gsk_vulkan_upload_cairo_op_command
 };
 
-gsize
-gsk_vulkan_upload_cairo_op_size (void)
-{
-  return GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS.size;
-}
-
 GskVulkanImage *
-gsk_vulkan_upload_cairo_op_init (GskVulkanOp           *op,
-                                 GdkVulkanContext      *context,
-                                 GskRenderNode         *node,
-                                 const graphene_vec2_t *scale,
-                                 const graphene_rect_t *viewport)
+gsk_vulkan_upload_cairo_op (GskVulkanRenderPass   *render_pass,
+                            GdkVulkanContext      *context,
+                            GskRenderNode         *node,
+                            const graphene_vec2_t *scale,
+                            const graphene_rect_t *viewport)
 {
-  GskVulkanUploadCairoOp *self = (GskVulkanUploadCairoOp *) op;
+  GskVulkanUploadCairoOp *self;
 
-  gsk_vulkan_op_init (op, &GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS);
+  self = (GskVulkanUploadCairoOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_UPLOAD_CAIRO_OP_CLASS);
 
   self->node = gsk_render_node_ref (node);
   self->image = gsk_vulkan_image_new_for_upload (context,
index 398f854fb364863be2fb166ba4e68391300e893e..5dc55413a2a6d930081211494f474a7fd6425b47 100644 (file)
@@ -4,9 +4,7 @@
 
 G_BEGIN_DECLS
 
-gsize                   gsk_vulkan_upload_cairo_op_size                 (void) G_GNUC_CONST;
-
-GskVulkanImage *        gsk_vulkan_upload_cairo_op_init                 (GskVulkanOp                    *op,
+GskVulkanImage *        gsk_vulkan_upload_cairo_op                      (GskVulkanRenderPass            *render_pass,
                                                                          GdkVulkanContext               *context,
                                                                          GskRenderNode                  *node,
                                                                          const graphene_vec2_t          *scale,
index 52e159ad8736dba5ea00256d73a386a329a27c8c..b01621c881a610d7009a5f3e562395b1285cc02d 100644 (file)
@@ -87,20 +87,14 @@ static const GskVulkanOpClass GSK_VULKAN_UPLOAD_OP_CLASS = {
   gsk_vulkan_upload_op_command
 };
 
-gsize
-gsk_vulkan_upload_op_size (void)
-{
-  return GSK_VULKAN_UPLOAD_OP_CLASS.size;
-}
-
 GskVulkanImage *
-gsk_vulkan_upload_op_init_texture (GskVulkanOp      *op,
-                                   GdkVulkanContext *context,
-                                   GdkTexture       *texture)
+gsk_vulkan_upload_op (GskVulkanRenderPass *render_pass,
+                      GdkVulkanContext    *context,
+                      GdkTexture          *texture)
 {
-  GskVulkanUploadOp *self = (GskVulkanUploadOp *) op;
+  GskVulkanUploadOp *self;
 
-  gsk_vulkan_op_init (op, &GSK_VULKAN_UPLOAD_OP_CLASS);
+  self = (GskVulkanUploadOp *) gsk_vulkan_op_alloc (render_pass, &GSK_VULKAN_UPLOAD_OP_CLASS);
 
   self->texture = g_object_ref (texture);
   self->image = gsk_vulkan_image_new_for_upload (context,
index 4e72bc62ea3c4903a61966d0967a2758baf34470..fb683b23358260b2b9aa930e287b44f5de76e3e4 100644 (file)
@@ -4,9 +4,7 @@
 
 G_BEGIN_DECLS
 
-gsize                   gsk_vulkan_upload_op_size                       (void) G_GNUC_CONST;
-
-GskVulkanImage *        gsk_vulkan_upload_op_init_texture               (GskVulkanOp                    *op,
+GskVulkanImage *        gsk_vulkan_upload_op                            (GskVulkanRenderPass            *render_pass,
                                                                          GdkVulkanContext               *context,
                                                                          GdkTexture                     *texture);