mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
vulkan: Pass values to push directly
Don't require a GskVulkanPushConstants there.
This commit is contained in:
parent
c479f93372
commit
c37171f4d6
@ -80,21 +80,23 @@ gsk_vulkan_push_constants_intersect_rounded (GskVulkanPushConstants *self,
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_vulkan_push_constants_wire_init (GskVulkanPushConstantsWire *wire,
|
||||
const GskVulkanPushConstants *self)
|
||||
gsk_vulkan_push_constants_wire_init (GskVulkanPushConstantsWire *wire,
|
||||
const graphene_matrix_t *mvp,
|
||||
const GskRoundedRect *clip)
|
||||
{
|
||||
graphene_matrix_to_float (&self->mvp, wire->common.mvp);
|
||||
gsk_rounded_rect_to_float (&self->clip.rect, graphene_point_zero (), wire->common.clip);
|
||||
graphene_matrix_to_float (mvp, wire->common.mvp);
|
||||
gsk_rounded_rect_to_float (clip, graphene_point_zero (), wire->common.clip);
|
||||
}
|
||||
|
||||
void
|
||||
gsk_vulkan_push_constants_push (const GskVulkanPushConstants *self,
|
||||
VkCommandBuffer command_buffer,
|
||||
VkPipelineLayout pipeline_layout)
|
||||
gsk_vulkan_push_constants_push (VkCommandBuffer command_buffer,
|
||||
VkPipelineLayout pipeline_layout,
|
||||
const graphene_matrix_t *mvp,
|
||||
const GskRoundedRect *clip)
|
||||
{
|
||||
GskVulkanPushConstantsWire wire;
|
||||
|
||||
gsk_vulkan_push_constants_wire_init (&wire, self);
|
||||
gsk_vulkan_push_constants_wire_init (&wire, mvp, clip);
|
||||
|
||||
vkCmdPushConstants (command_buffer,
|
||||
pipeline_layout,
|
||||
|
@ -35,9 +35,10 @@ gboolean gsk_vulkan_push_constants_intersect_rounded (GskVulk
|
||||
const GskVulkanPushConstants *src,
|
||||
const GskRoundedRect *rect);
|
||||
|
||||
void gsk_vulkan_push_constants_push (const GskVulkanPushConstants *self,
|
||||
VkCommandBuffer command_buffer,
|
||||
VkPipelineLayout pipeline_layout);
|
||||
void gsk_vulkan_push_constants_push (VkCommandBuffer command_buffer,
|
||||
VkPipelineLayout pipeline_layout,
|
||||
const graphene_matrix_t *mvp,
|
||||
const GskRoundedRect *clip);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -2253,9 +2253,11 @@ gsk_vulkan_render_pass_draw_rect (GskVulkanRenderPass *self,
|
||||
|
||||
case GSK_VULKAN_OP_PUSH_VERTEX_CONSTANTS:
|
||||
for (int j = 0; j < layout_count; j++)
|
||||
gsk_vulkan_push_constants_push (&op->constants.constants,
|
||||
command_buffer,
|
||||
pipeline_layout[j]);
|
||||
gsk_vulkan_push_constants_push (command_buffer,
|
||||
pipeline_layout[j],
|
||||
&op->constants.constants.mvp,
|
||||
&op->constants.constants.clip.rect);
|
||||
|
||||
break;
|
||||
|
||||
case GSK_VULKAN_OP_CROSS_FADE:
|
||||
|
Loading…
Reference in New Issue
Block a user