mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
ea7d3b8476
cogl_framebuffer_add_fence creates a synchronisation fence, which will invoke a user-specified callback when the GPU has finished executing all commands provided to it up to that point in time. Support is currently provided for GL 3.x's GL_ARB_sync extension, and EGL's EGL_KHR_fence_sync (when used with OpenGL ES). Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Neil Roberts <neil@linux.intel.com> Reviewed-by: Robert Bragg <robert@linux.intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=691752 (cherry picked from commit e6d37470da9294adc1554c0a8c91aa2af560ed9f)
62 lines
1.5 KiB
C
62 lines
1.5 KiB
C
/*
|
|
* Cogl
|
|
*
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
*
|
|
* Copyright (C) 2012 Collabora Ltd.
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef __COGL_FENCE_PRIVATE_H__
|
|
#define __COGL_FENCE_PRIVATE_H__
|
|
|
|
#include "cogl-fence.h"
|
|
#include "cogl-queue.h"
|
|
#include "cogl-winsys-private.h"
|
|
|
|
COGL_TAILQ_HEAD (CoglFenceList, CoglFenceClosure);
|
|
|
|
typedef enum
|
|
{
|
|
FENCE_TYPE_PENDING,
|
|
#ifdef GL_ARB_sync
|
|
FENCE_TYPE_GL_ARB,
|
|
#endif
|
|
FENCE_TYPE_WINSYS,
|
|
FENCE_TYPE_ERROR
|
|
} CoglFenceType;
|
|
|
|
struct _CoglFenceClosure
|
|
{
|
|
COGL_TAILQ_ENTRY (CoglFenceClosure) list;
|
|
CoglFramebuffer *framebuffer;
|
|
|
|
CoglFenceType type;
|
|
void *fence_obj;
|
|
|
|
CoglFenceCallback callback;
|
|
void *user_data;
|
|
};
|
|
|
|
void
|
|
_cogl_fence_submit (CoglFenceClosure *fence);
|
|
|
|
void
|
|
_cogl_fence_cancel_fences_for_framebuffer (CoglFramebuffer *framebuffer);
|
|
|
|
#endif /* __COGL_FENCE_PRIVATE_H__ */
|