From 80e9cd4e91f93df0e53e6fa75af4c2e2f8e388f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Wed, 29 Dec 2021 20:01:25 +0100 Subject: [PATCH] don't flush context on restore if no clipping info is stored --- src/vkvg_context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vkvg_context.c b/src/vkvg_context.c index 7fd0f95..a0b6e3a 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -1262,14 +1262,11 @@ void vkvg_restore (VkvgContext ctx){ LOG(VKVG_LOG_INFO, "RESTORE CONTEXT: ctx = %p\n", ctx); - _flush_cmd_buff (ctx); - if (!_wait_flush_fence (ctx)) - return; - vkvg_context_save_t* sav = ctx->pSavedCtxs; ctx->pSavedCtxs = sav->pNext; ctx->pushConsts = sav->pushConsts; + ctx->pushCstDirty = true; /*if (sav->pattern) _update_cur_pattern (ctx, sav->pattern);*/ @@ -1278,6 +1275,9 @@ void vkvg_restore (VkvgContext ctx){ if (!ctx->curSavBit) {//no clipping state has been saved, clipping has to be reseted vkvg_reset_clip (ctx); } else { + _flush_cmd_buff (ctx); + if (!_wait_flush_fence (ctx)) + return; uint8_t curSaveBit = 1 << ((ctx->curSavBit-1) % 6 + 2); -- 2.47.3