vulkan: Split out a function

Making that function externally usable allows having render passes
managed externally.

Also remove a nonexisting function from the header.
This commit is contained in:
Benjamin Otte 2023-06-25 05:02:48 +02:00
parent 1d9ad55c54
commit 0946b0b333
2 changed files with 33 additions and 23 deletions

View File

@ -649,20 +649,10 @@ gsk_vulkan_render_prepare_descriptor_sets (GskVulkanRender *self)
}
void
gsk_vulkan_render_draw (GskVulkanRender *self)
gsk_vulkan_render_draw_pass (GskVulkanRender *self,
GskVulkanRenderPass *pass,
VkFence fence)
{
GList *l;
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (self->renderer, SYNC))
gsk_profiler_timer_begin (gsk_renderer_get_profiler (self->renderer), self->gpu_time_timer);
#endif
gsk_vulkan_render_prepare_descriptor_sets (self);
for (l = self->render_passes; l; l = l->next)
{
GskVulkanRenderPass *pass = l->data;
VkCommandBuffer command_buffer;
gsize wait_semaphore_count;
gsize signal_semaphore_count;
@ -682,6 +672,25 @@ gsk_vulkan_render_draw (GskVulkanRender *self)
wait_semaphores,
signal_semaphore_count,
signal_semaphores,
fence);
}
void
gsk_vulkan_render_draw (GskVulkanRender *self)
{
GList *l;
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (self->renderer, SYNC))
gsk_profiler_timer_begin (gsk_renderer_get_profiler (self->renderer), self->gpu_time_timer);
#endif
gsk_vulkan_render_prepare_descriptor_sets (self);
for (l = self->render_passes; l; l = l->next)
{
gsk_vulkan_render_draw_pass (self,
l->data,
l->next != NULL ? VK_NULL_HANDLE : self->fence);
}

View File

@ -97,8 +97,9 @@ void gsk_vulkan_render_bind_descriptor_sets (GskVulk
VkCommandBuffer command_buffer);
void gsk_vulkan_render_draw (GskVulkanRender *self);
void gsk_vulkan_render_submit (GskVulkanRender *self);
void gsk_vulkan_render_draw_pass (GskVulkanRender *self,
GskVulkanRenderPass *pass,
VkFence fence);
GdkTexture * gsk_vulkan_render_download_target (GskVulkanRender *self);
VkFramebuffer gsk_vulkan_render_get_framebuffer (GskVulkanRender *self,