VkCommandBuffer command_buffer)
{
GskVulkanPipeline *current_pipeline = NULL;
- gsize current_draw_index = 0;
GskVulkanOp *op;
guint i, step;
GskVulkanBuffer *vertex_buffer;
vertex_buffer = gsk_vulkan_render_pass_get_vertex_data (self, render);
+ if (vertex_buffer)
+ vkCmdBindVertexBuffers (command_buffer,
+ 0,
+ 1,
+ (VkBuffer[1]) {
+ gsk_vulkan_buffer_get_buffer (vertex_buffer)
+ },
+ (VkDeviceSize[1]) { 0 });
+
for (i = 0; i < self->render_ops->len; i += step)
{
op = &g_array_index (self->render_ops, GskVulkanOp, i);
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
vkCmdBindDescriptorSets (command_buffer,
0,
NULL);
- current_draw_index += gsk_vulkan_texture_pipeline_draw (GSK_VULKAN_TEXTURE_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_texture_pipeline_draw (GSK_VULKAN_TEXTURE_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
case GSK_VULKAN_OP_TEXT:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->text.vertex_offset });
- current_draw_index = 0;
}
vkCmdBindDescriptorSets (command_buffer,
0,
NULL);
- current_draw_index += gsk_vulkan_text_pipeline_draw (GSK_VULKAN_TEXT_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, op->text.num_glyphs);
+ gsk_vulkan_text_pipeline_draw (GSK_VULKAN_TEXT_PIPELINE (current_pipeline),
+ command_buffer,
+ op->text.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ op->text.num_glyphs);
break;
case GSK_VULKAN_OP_COLOR_TEXT:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->text.vertex_offset });
- current_draw_index = 0;
}
vkCmdBindDescriptorSets (command_buffer,
0,
NULL);
- current_draw_index += gsk_vulkan_color_text_pipeline_draw (GSK_VULKAN_COLOR_TEXT_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, op->text.num_glyphs);
+ gsk_vulkan_color_text_pipeline_draw (GSK_VULKAN_COLOR_TEXT_PIPELINE (current_pipeline),
+ command_buffer,
+ op->text.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ op->text.num_glyphs);
break;
case GSK_VULKAN_OP_OPACITY:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
vkCmdBindDescriptorSets (command_buffer,
0,
NULL);
- current_draw_index += gsk_vulkan_effect_pipeline_draw (GSK_VULKAN_EFFECT_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_effect_pipeline_draw (GSK_VULKAN_EFFECT_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
case GSK_VULKAN_OP_BLUR:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
vkCmdBindDescriptorSets (command_buffer,
0,
NULL);
- current_draw_index += gsk_vulkan_blur_pipeline_draw (GSK_VULKAN_BLUR_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_blur_pipeline_draw (GSK_VULKAN_BLUR_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
case GSK_VULKAN_OP_COLOR:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
for (step = 1; step + i < self->render_ops->len; step++)
cmp->render.pipeline != current_pipeline)
break;
}
- current_draw_index += gsk_vulkan_color_pipeline_draw (GSK_VULKAN_COLOR_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, step);
+ gsk_vulkan_color_pipeline_draw (GSK_VULKAN_COLOR_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ step);
break;
case GSK_VULKAN_OP_LINEAR_GRADIENT:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
- current_draw_index += gsk_vulkan_linear_gradient_pipeline_draw (GSK_VULKAN_LINEAR_GRADIENT_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_linear_gradient_pipeline_draw (GSK_VULKAN_LINEAR_GRADIENT_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
case GSK_VULKAN_OP_BORDER:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
- current_draw_index += gsk_vulkan_border_pipeline_draw (GSK_VULKAN_BORDER_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_border_pipeline_draw (GSK_VULKAN_BORDER_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
case GSK_VULKAN_OP_INSET_SHADOW:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
- current_draw_index += gsk_vulkan_box_shadow_pipeline_draw (GSK_VULKAN_BOX_SHADOW_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_box_shadow_pipeline_draw (GSK_VULKAN_BOX_SHADOW_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
case GSK_VULKAN_OP_PUSH_VERTEX_CONSTANTS:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
vkCmdBindDescriptorSets (command_buffer,
0,
NULL);
- current_draw_index += gsk_vulkan_cross_fade_pipeline_draw (GSK_VULKAN_CROSS_FADE_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_cross_fade_pipeline_draw (GSK_VULKAN_CROSS_FADE_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
case GSK_VULKAN_OP_BLEND_MODE:
vkCmdBindPipeline (command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
gsk_vulkan_pipeline_get_pipeline (current_pipeline));
- vkCmdBindVertexBuffers (command_buffer,
- 0,
- 1,
- (VkBuffer[1]) {
- gsk_vulkan_buffer_get_buffer (vertex_buffer)
- },
- (VkDeviceSize[1]) { op->render.vertex_offset });
- current_draw_index = 0;
}
vkCmdBindDescriptorSets (command_buffer,
0,
NULL);
- current_draw_index += gsk_vulkan_blend_mode_pipeline_draw (GSK_VULKAN_BLEND_MODE_PIPELINE (current_pipeline),
- command_buffer,
- current_draw_index, 1);
+ gsk_vulkan_blend_mode_pipeline_draw (GSK_VULKAN_BLEND_MODE_PIPELINE (current_pipeline),
+ command_buffer,
+ op->render.vertex_offset / gsk_vulkan_pipeline_get_vertex_stride (current_pipeline),
+ 1);
break;
default: