Commit b2e30fb6 authored by Benjamin Otte's avatar Benjamin Otte

vulkan: Don't wait until graphics are done computing

We can let the GPU do its stuff without waiting. The GPU knows what it's
doing.

Which means we now get a lot of time to spend on doing CPU things (read:
we're way better in benchmarks).

The old behavior is safer, so we want to keep it around for debugging.
It can be reenabled with GSK_RENDERING_MODE=sync.
parent ac9d4815
......@@ -16,6 +16,8 @@ static const GDebugKey gsk_debug_keys[] = {
static const GDebugKey gsk_rendering_keys[] = {
{ "geometry", GSK_RENDERING_MODE_GEOMETRY },
{ "shaders", GSK_RENDERING_MODE_SHADERS },
{ "sync", GSK_RENDERING_MODE_SYNC },
{ "staging-image", GSK_RENDERING_MODE_STAGING_IMAGE },
};
gboolean
......
......@@ -17,8 +17,10 @@ typedef enum {
} GskDebugFlags;
typedef enum {
GSK_RENDERING_MODE_GEOMETRY = 1 << 0,
GSK_RENDERING_MODE_SHADERS = 1 << 1
GSK_RENDERING_MODE_GEOMETRY = 1 << 0,
GSK_RENDERING_MODE_SHADERS = 1 << 1,
GSK_RENDERING_MODE_SYNC = 1 << 2,
GSK_RENDERING_MODE_STAGING_IMAGE = 1 << 3
} GskRenderingMode;
gboolean gsk_check_debug_flags (GskDebugFlags flags);
......
......@@ -272,11 +272,14 @@ gsk_vulkan_render_submit (GskVulkanRender *self)
},
self->fence);
GSK_VK_CHECK (vkWaitForFences, gdk_vulkan_context_get_device (self->vulkan),
1,
&self->fence,
VK_TRUE,
INT64_MAX);
if (GSK_RENDER_MODE_CHECK (SYNC))
{
GSK_VK_CHECK (vkWaitForFences, gdk_vulkan_context_get_device (self->vulkan),
1,
&self->fence,
VK_TRUE,
INT64_MAX);
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment