]> O.S.I.I.S - jp/vkvg.git/commitdiff
don't flush context on restore if no clipping info is stored
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 29 Dec 2021 19:01:25 +0000 (20:01 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 12 Jan 2022 21:20:34 +0000 (22:20 +0100)
src/vkvg_context.c

index 7fd0f954d3f75da18cf356cfb32d435d359af811..a0b6e3ad988454ac14ed6037a686567377d23a52 100644 (file)
@@ -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);