From 5f04629e78cbb4fcffde285b93ed8f33124f0b13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Fri, 17 Dec 2021 05:59:40 +0100 Subject: [PATCH] debug, flush ctx if lastpat is not solid color in all case --- src/vkvg_context_internal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index 71fa25b..489e592 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -578,12 +578,10 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) { switch (newPatternType) { case VKVG_PATTERN_TYPE_SOLID: - if (lastPat->type == VKVG_PATTERN_TYPE_SURFACE){ - //unbind current source surface by replacing it with empty texture - _flush_cmd_buff (ctx); - _wait_flush_fence (ctx); + _flush_cmd_buff (ctx); + _wait_flush_fence (ctx); + if (lastPat->type == VKVG_PATTERN_TYPE_SURFACE)//unbind current source surface by replacing it with empty texture _update_descriptor_set (ctx, ctx->pSurf->dev->emptyImg, ctx->dsSrc); - } break; case VKVG_PATTERN_TYPE_SURFACE: { @@ -661,7 +659,7 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) { memcpy (&grad, pat->data, sizeof(vkvg_gradient_t)); vkvg_matrix_transform_point (&ctx->pushConsts.mat, &grad.cp[0].x, &grad.cp[0].y); - vkvg_matrix_transform_point (&ctx->pushConsts.mat, &grad.cp[1].x, &grad.cp[1].y); + vkvg_matrix_transform_point (&ctx->pushConsts.mat, &grad.cp[0].z, &grad.cp[0].w); //to do, scale radial radiuses in cp[2] memcpy (ctx->uboGrad.allocInfo.pMappedData , &grad, sizeof(vkvg_gradient_t)); -- 2.47.3