diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-14 20:03:55 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-14 20:03:55 +0100 |
| commit | e6fd0dad80a4d92ea8324bbffac4e1a4e9df87f1 (patch) | |
| tree | 2784349429996bd8c007183a553a322df647a418 /src/vkvg_context.c | |
| parent | 72b8094534faadd7e67a7f512a14468f21f0b1b9 (diff) | |
start implementation of separated buffer for uv created only if showtext is calledseparate_uvbo
Diffstat (limited to 'src/vkvg_context.c')
| -rw-r--r-- | src/vkvg_context.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/vkvg_context.c b/src/vkvg_context.c index f497a54..8198d52 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -157,8 +157,8 @@ VkvgContext vkvg_create(VkvgSurface surf) vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t)ctx->dsFont, "CTX DescSet FONT"); vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t)ctx->dsGrad, "CTX DescSet GRADIENT"); - vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_BUFFER, (uint64_t)ctx->indices.buffer, "CTX Index Buff"); - vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_BUFFER, (uint64_t)ctx->vertices.buffer, "CTX Vertex Buff"); + vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_BUFFER, (uint64_t)ctx->ibo.buffer, "CTX Index Buff"); + vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_BUFFER, (uint64_t)ctx->vbo.buffer, "CTX Vertex Buff"); #endif return ctx; @@ -241,11 +241,15 @@ void vkvg_destroy (VkvgContext ctx) vkDestroyDescriptorPool (dev, ctx->descriptorPool,NULL); vkvg_buffer_destroy (&ctx->uboGrad); - vkvg_buffer_destroy (&ctx->indices); - vkvg_buffer_destroy (&ctx->vertices); + vkvg_buffer_destroy (&ctx->ibo); + vkvg_buffer_destroy (&ctx->vbo); free(ctx->vertexCache); free(ctx->indexCache); + if (ctx->uvCache) { + free(ctx->uvCache); + vkvg_buffer_destroy (&ctx->uvbo); + } //TODO:check this for source counter //vkh_image_destroy (ctx->source); @@ -675,7 +679,7 @@ void _reset_clip (VkvgContext ctx) { //with the loadop clear for stencil ctx->renderPassBeginInfo.renderPass = ctx->pSurf->dev->renderPass_ClearStencil; //force run of one renderpass (even empty) to perform clear load op - _start_cmd_for_render_pass(ctx); + _start_cmd_for_render_pass(ctx, false); return; } vkCmdClearAttachments(ctx->cmd, 1, &clearStencil, 1, &ctx->clearRect); @@ -710,7 +714,7 @@ void vkvg_clear (VkvgContext ctx){ _emit_draw_cmd_undrawn_vertices(ctx); if (!ctx->cmdStarted) { ctx->renderPassBeginInfo.renderPass = ctx->pSurf->dev->renderPass_ClearAll; - _start_cmd_for_render_pass(ctx); + _start_cmd_for_render_pass(ctx, false); return; } VkClearAttachment ca[2] = {clearColorAttach, clearStencil}; @@ -1216,7 +1220,7 @@ void vkvg_save (VkvgContext ctx){ uint8_t curSaveBit = 1 << (ctx->curSavBit % 6 + 2); - _start_cmd_for_render_pass (ctx); + _start_cmd_for_render_pass (ctx, false); #if defined(DEBUG) && defined (VKVG_DBG_UTILS) vkh_cmd_label_start(ctx->cmd, "save rp", DBG_LAB_COLOR_SAV); @@ -1301,7 +1305,7 @@ void vkvg_restore (VkvgContext ctx){ uint8_t curSaveBit = 1 << ((ctx->curSavBit-1) % 6 + 2); - _start_cmd_for_render_pass (ctx); + _start_cmd_for_render_pass (ctx, false); #if defined(DEBUG) && defined (VKVG_DBG_UTILS) vkh_cmd_label_start(ctx->cmd, "restore rp", DBG_LAB_COLOR_SAV); |