diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-04-26 12:03:41 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-04-26 12:03:41 +0200 |
commit | 39c5c5a561014632469704113661124a42764d04 (patch) | |
tree | 07be6bc5d9352f29cd8b7c75038e6516d0790e44 | |
parent | 69a0d4c7d758418d8ad448a6b9764e9da20e42cd (diff) | |
download | gtk+-matthiasc/texture-sync.tar.gz |
gsk: Only use fences when supportedmatthiasc/texture-sync
-rw-r--r-- | gsk/gl/gskgldriver.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gsk/gl/gskgldriver.c b/gsk/gl/gskgldriver.c index faea458469..84a8937412 100644 --- a/gsk/gl/gskgldriver.c +++ b/gsk/gl/gskgldriver.c @@ -1576,7 +1576,8 @@ create_texture_from_texture_destroy (gpointer data) gdk_gl_context_make_current (state->context); glDeleteTextures (1, &state->texture_id); - glDeleteSync (state->sync); + if (state->sync) + glDeleteSync (state->sync); g_clear_object (&state->context); g_free (state); } @@ -1603,7 +1604,8 @@ gsk_gl_driver_create_gdk_texture (GskGLDriver *self, state = g_new0 (GskGLTextureState, 1); state->texture_id = texture_id; state->context = g_object_ref (self->command_queue->context); - state->sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0); + if (gdk_gl_context_has_fence_sync (self->command_queue->context)) + state->sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0); g_hash_table_steal (self->textures, GUINT_TO_POINTER (texture_id)); |