Skip to content

Commit efacb05

Browse files
committed
egl_gbm_render_surface: check we're using at most 3 fbs in debug mode
1 parent 71ece41 commit efacb05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/egl_gbm_render_surface.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,9 @@ static int egl_gbm_render_surface_queue_present(struct render_surface *s, const
759759
goto fail_release_bo;
760760

761761
locked:
762-
/// TODO: Remove this once we're using triple buffering
763-
//ASSERT_MSG(atomic_fetch_add(&render_surface->n_locked_fbs, 1) <= 1, "sanity check failed: too many locked fbs for double-buffered vsync");
762+
#ifdef DEBUG
763+
ASSERT_MSG(atomic_fetch_add(&egl_surface->n_locked_fbs, 1) + 1 <= 3, "Sanity check failed: Too many locked framebuffers for triple buffering.");
764+
#endif
764765
egl_surface->locked_fbs[i].bo = bo;
765766
egl_surface->locked_fbs[i].surface = CAST_THIS(surface_ref(CAST_SURFACE(s)));
766767
egl_surface->locked_fbs[i].n_refs = REFCOUNT_INIT_1;

0 commit comments

Comments
 (0)