From: Jean-Philippe Bruyère Date: Fri, 17 Dec 2021 04:59:40 +0000 (+0100) Subject: debug, flush ctx if lastpat is not solid color in all case X-Git-Tag: v0.2.0~14 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=5f04629e78cbb4fcffde285b93ed8f33124f0b13;p=jp%2Fvkvg.git debug, flush ctx if lastpat is not solid color in all case --- 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));