struct {
float mvp[16];
float clip[12];
+ float scale[2];
} common;
};
static void
gsk_vulkan_push_constants_wire_init (GskVulkanPushConstantsWire *wire,
+ const graphene_vec2_t *scale,
const graphene_matrix_t *mvp,
const GskRoundedRect *clip)
{
graphene_matrix_to_float (mvp, wire->common.mvp);
gsk_rounded_rect_to_float (clip, graphene_point_zero (), wire->common.clip);
+ graphene_vec2_to_float (scale, wire->common.scale);
}
void
gsk_vulkan_push_constants_push (VkCommandBuffer command_buffer,
VkPipelineLayout pipeline_layout,
+ const graphene_vec2_t *scale,
const graphene_matrix_t *mvp,
const GskRoundedRect *clip)
{
GskVulkanPushConstantsWire wire;
- gsk_vulkan_push_constants_wire_init (&wire, mvp, clip);
+ gsk_vulkan_push_constants_wire_init (&wire, scale, mvp, clip);
vkCmdPushConstants (command_buffer,
pipeline_layout,
void gsk_vulkan_push_constants_push (VkCommandBuffer command_buffer,
VkPipelineLayout pipeline_layout,
+ const graphene_vec2_t *scale,
const graphene_matrix_t *mvp,
const GskRoundedRect *clip);
{
GskVulkanOpType type;
GskRenderNode *node; /* node that's the source of this op */
+ graphene_vec2_t scale;
graphene_matrix_t mvp;
GskRoundedRect clip;
};
GskVulkanOp op = {
.constants.type = GSK_VULKAN_OP_PUSH_VERTEX_CONSTANTS,
.constants.node = node,
+ .constants.scale= state->scale,
.constants.mvp = state->mvp,
.constants.clip = state->clip.rect,
};
for (int j = 0; j < layout_count; j++)
gsk_vulkan_push_constants_push (command_buffer,
pipeline_layout[j],
+ &op->constants.scale,
&op->constants.mvp,
&op->constants.clip);