cogl: Update latest sync fd also from cogl_gl_framebuffer_flush/finish
This ensures that any drawing for screen casting is reflected in the sync fd. Fixes:99209958b9
("cogl: Store latest GPU work completed sync fd") Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3946> (cherry picked from commit61ae9eedb6
)
This commit is contained in:
parent
dec5ffdadf
commit
a60ba34264
2 changed files with 8 additions and 3 deletions
|
@ -335,11 +335,10 @@ cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
||||||
|
|
||||||
_cogl_framebuffer_flush_journal (framebuffer);
|
_cogl_framebuffer_flush_journal (framebuffer);
|
||||||
|
|
||||||
/* Update our "latest" sync fd to contain all previous work */
|
|
||||||
_cogl_context_update_sync (context);
|
|
||||||
|
|
||||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_SYNC_FRAME)))
|
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_SYNC_FRAME)))
|
||||||
cogl_framebuffer_finish (framebuffer);
|
cogl_framebuffer_finish (framebuffer);
|
||||||
|
else
|
||||||
|
_cogl_context_update_sync (context);
|
||||||
|
|
||||||
cogl_framebuffer_discard_buffers (framebuffer,
|
cogl_framebuffer_discard_buffers (framebuffer,
|
||||||
COGL_BUFFER_BIT_DEPTH |
|
COGL_BUFFER_BIT_DEPTH |
|
||||||
|
|
|
@ -305,6 +305,9 @@ cogl_gl_framebuffer_finish (CoglFramebufferDriver *driver)
|
||||||
{
|
{
|
||||||
CoglContext *ctx = context_from_driver (driver);
|
CoglContext *ctx = context_from_driver (driver);
|
||||||
|
|
||||||
|
/* Update our "latest" sync fd to contain all previous work */
|
||||||
|
_cogl_context_update_sync (ctx);
|
||||||
|
|
||||||
ctx->glFinish ();
|
ctx->glFinish ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,6 +316,9 @@ cogl_gl_framebuffer_flush (CoglFramebufferDriver *driver)
|
||||||
{
|
{
|
||||||
CoglContext *ctx = context_from_driver (driver);
|
CoglContext *ctx = context_from_driver (driver);
|
||||||
|
|
||||||
|
/* Update our "latest" sync fd to contain all previous work */
|
||||||
|
_cogl_context_update_sync (ctx);
|
||||||
|
|
||||||
ctx->glFlush ();
|
ctx->glFlush ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue