mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 09:40:10 +00:00
gpu: Add an internal is_clean() check
If no ops are recorded, then we don't need to wait for any ops to finish. Also fix the initial fence creation on Vulkan - we no longer need to create it fixed because of the random cleanup() call at startup does no longer happen.
This commit is contained in:
parent
3286d9f1b5
commit
8f78a0f809
@ -95,9 +95,20 @@ gsk_gpu_frame_default_end (GskGpuFrame *self,
|
||||
gdk_draw_context_end_frame_full (context);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gsk_gpu_frame_is_clean (GskGpuFrame *self)
|
||||
{
|
||||
GskGpuFramePrivate *priv = gsk_gpu_frame_get_instance_private (self);
|
||||
|
||||
return gsk_gpu_ops_get_size (&priv->ops) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_gpu_frame_cleanup (GskGpuFrame *self)
|
||||
{
|
||||
if (gsk_gpu_frame_is_clean (self))
|
||||
return;
|
||||
|
||||
GSK_GPU_FRAME_GET_CLASS (self)->cleanup (self);
|
||||
}
|
||||
|
||||
@ -615,12 +626,18 @@ gsk_gpu_frame_write_storage_buffer (GskGpuFrame *self,
|
||||
gboolean
|
||||
gsk_gpu_frame_is_busy (GskGpuFrame *self)
|
||||
{
|
||||
if (gsk_gpu_frame_is_clean (self))
|
||||
return FALSE;
|
||||
|
||||
return GSK_GPU_FRAME_GET_CLASS (self)->is_busy (self);
|
||||
}
|
||||
|
||||
void
|
||||
gsk_gpu_frame_wait (GskGpuFrame *self)
|
||||
{
|
||||
if (gsk_gpu_frame_is_clean (self))
|
||||
return;
|
||||
|
||||
GSK_GPU_FRAME_GET_CLASS (self)->wait (self);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,6 @@ gsk_vulkan_frame_setup (GskGpuFrame *frame)
|
||||
GSK_VK_CHECK (vkCreateFence, vk_device,
|
||||
&(VkFenceCreateInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
|
||||
.flags = VK_FENCE_CREATE_SIGNALED_BIT
|
||||
},
|
||||
NULL,
|
||||
&self->vk_fence);
|
||||
|
Loading…
Reference in New Issue
Block a user