vulkan: Don't store push constants in RenderOp
authorBenjamin Otte <otte@redhat.com>
Thu, 11 May 2023 23:34:52 +0000 (01:34 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 4 Jun 2023 17:42:01 +0000 (19:42 +0200)
Instead, only store the values that are needed.

gsk/vulkan/gskvulkanrenderpass.c

index 2b41fbf00273f2b6e386048f2f199e82344532b0..557582cdb4ca856c0ea28080813ba5ea7bd8be7c 100644 (file)
@@ -97,7 +97,8 @@ struct _GskVulkanOpPushConstants
 {
   GskVulkanOpType         type;
   GskRenderNode          *node; /* node that's the source of this op */
-  GskVulkanPushConstants  constants; /* new constants to push */
+  graphene_matrix_t       mvp;
+  GskRoundedRect          clip;
 };
 
 union _GskVulkanOp
@@ -240,7 +241,8 @@ gsk_vulkan_render_pass_append_push_constants (GskVulkanRenderPass          *self
   GskVulkanOp op = {
     .constants.type = GSK_VULKAN_OP_PUSH_VERTEX_CONSTANTS,
     .constants.node = node,
-    .constants.constants = *constants
+    .constants.mvp = constants->mvp,
+    .constants.clip = constants->clip.rect
   };
 
   g_array_append_val (self->render_ops, op);
@@ -1506,7 +1508,7 @@ gsk_vulkan_render_pass_upload (GskVulkanRenderPass  *self,
           break;
 
         case GSK_VULKAN_OP_PUSH_VERTEX_CONSTANTS:
-          clip = &op->constants.constants.clip.rect.bounds;
+          clip = &op->constants.clip.bounds;
           break;
 
         default:
@@ -2253,8 +2255,8 @@ gsk_vulkan_render_pass_draw_rect (GskVulkanRenderPass     *self,
           for (int j = 0; j < layout_count; j++)
             gsk_vulkan_push_constants_push (command_buffer,
                                             pipeline_layout[j],
-                                            &op->constants.constants.mvp,
-                                            &op->constants.constants.clip.rect);
+                                            &op->constants.mvp,
+                                            &op->constants.clip);
 
           break;