From: Jean-Philippe Bruyère Date: Wed, 29 Dec 2021 19:01:25 +0000 (+0100) Subject: don't flush context on restore if no clipping info is stored X-Git-Tag: v0.3.0-beta~15 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=80e9cd4e91f93df0e53e6fa75af4c2e2f8e388f2;p=jp%2Fvkvg.git don't flush context on restore if no clipping info is stored --- 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);