]> O.S.I.I.S - jp/vkvg.git/commitdiff
add threaded obj->inUse, added vbo and ibo to threaded objs
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 18 Jan 2022 14:11:38 +0000 (15:11 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 18 Jan 2022 14:11:38 +0000 (15:11 +0100)
src/vkvg_context.c
src/vkvg_context_internal.c
src/vkvg_context_internal.h
src/vkvg_device_internal.c
src/vkvg_device_internal.h
src/vkvg_fonts.c

index 2de8908b854d04166bb08524ee649edcae1dcc75..312ed7e6f654225f10e6579d2debf159e98b7839 100644 (file)
@@ -55,8 +55,8 @@ VkvgContext vkvg_create(VkvgSurface surf)
        }
 
        ctx->sizePoints         = VKVG_PTS_SIZE;
-       ctx->sizeVertices       = ctx->sizeVBO = VKVG_VBO_SIZE;
-       ctx->sizeIndices        = ctx->sizeIBO = VKVG_IBO_SIZE;
+       ctx->sizeVertices       = VKVG_VBO_SIZE;
+       ctx->sizeIndices        = VKVG_IBO_SIZE;
        ctx->sizePathes         = VKVG_PATHES_SIZE;
        ctx->lineWidth          = 1;
        ctx->curOperator        = VKVG_OPERATOR_OVER;
@@ -125,7 +125,6 @@ VkvgContext vkvg_create(VkvgSurface surf)
        //for context to be thread safe, command pool and descriptor pool have to be created in the thread of the context.
        ctx->cmdPool = vkh_cmd_pool_create ((VkhDevice)dev, dev->gQueue->familyIndex, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);
 
-       _create_vertices_buff   (ctx);
 
        ctx->th_objs = _get_or_create_threaded_objects(ctx->pSurf->dev, thrd_current());
 
@@ -138,7 +137,7 @@ VkvgContext vkvg_create(VkvgSurface surf)
        ctx->references = 1;
        ctx->status = VKVG_STATUS_SUCCESS;
 
-       LOG(VKVG_LOG_DBG_ARRAYS, "INIT\tctx = %p; pathes:%ju pts:%ju vch:%d vbo:%d ich:%d ibo:%d\n", ctx, (uint64_t)ctx->sizePathes, (uint64_t)ctx->sizePoints, ctx->sizeVertices, ctx->sizeVBO, ctx->sizeIndices, ctx->sizeIBO);
+       LOG(VKVG_LOG_DBG_ARRAYS, "INIT\tctx = %p; pathes:%ju pts:%ju vch:%d vbo:%d ich:%d ibo:%d\n", ctx, (uint64_t)ctx->sizePathes, (uint64_t)ctx->sizePoints, ctx->sizeVertices, ctx->th_objs->sizeVBO, ctx->sizeIndices, ctx->th_objs->sizeIBO);
 
 #if defined(DEBUG) && defined (VKVG_DBG_UTILS)
        vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_COMMAND_POOL, (uint64_t)ctx->cmdPool, "CTX Cmd Pool");
@@ -146,8 +145,6 @@ VkvgContext vkvg_create(VkvgSurface surf)
        vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_COMMAND_BUFFER, (uint64_t)ctx->cmdBuffers[1], "CTX Cmd Buff B");
        vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_FENCE, (uint64_t)ctx->flushFence, "CTX Flush Fence");
 
-       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");
 #endif
 
        return ctx;
@@ -191,7 +188,9 @@ void vkvg_destroy (VkvgContext ctx)
 
        vkvg_flush (ctx);
 
-       LOG(VKVG_LOG_DBG_ARRAYS, "END\tctx = %p; pathes:%d pts:%d vch:%d vbo:%d ich:%d ibo:%d\n", ctx, ctx->sizePathes, ctx->sizePoints, ctx->sizeVertices, ctx->sizeVBO, ctx->sizeIndices, ctx->sizeIBO);
+       _update_descriptor_set          (ctx->th_objs, ctx->pSurf->dev->emptyImg, ctx->th_objs->dsSrc);
+
+       LOG(VKVG_LOG_DBG_ARRAYS, "END\tctx = %p; pathes:%d pts:%d vch:%d vbo:%d ich:%d ibo:%d\n", ctx, ctx->sizePathes, ctx->sizePoints, ctx->sizeVertices, ctx->th_objs->sizeVBO, ctx->sizeIndices, ctx->th_objs->sizeIBO);
 
 #if VKVG_RECORDING
        if (ctx->recording)
@@ -224,9 +223,6 @@ void vkvg_destroy (VkvgContext ctx)
        vkFreeCommandBuffers(dev, ctx->cmdPool, 2, ctx->cmdBuffers);
        vkDestroyCommandPool(dev, ctx->cmdPool, NULL);
 
-       vkvg_buffer_destroy (&ctx->indices);
-       vkvg_buffer_destroy (&ctx->vertices);
-
        free(ctx->vertexCache);
        free(ctx->indexCache);
 
@@ -254,6 +250,8 @@ void vkvg_destroy (VkvgContext ctx)
 
        free(ctx->savedStencils);
 
+       ctx->th_objs->inUse = false;
+
        //remove context from double linked list of context in device
        if (ctx->pSurf->dev->lastCtx == ctx){
                ctx->pSurf->dev->lastCtx = ctx->pPrev;
index 0c1bf696d714de1d11869b957014d895a66dabb1..a9905c34d721a045ff4f1178500c94ff36760786 100644 (file)
@@ -246,44 +246,7 @@ float _get_arc_step (VkvgContext ctx, float radius) {
        return fminf(M_PI / 3.f,M_PI / (r * 0.4f));
 }
 
-void _create_vertices_buff (VkvgContext ctx){
-       vkvg_buffer_create (ctx->pSurf->dev,
-               VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
-               VMA_MEMORY_USAGE_CPU_TO_GPU,
-               ctx->sizeVBO * sizeof(Vertex), &ctx->vertices);
-       vkvg_buffer_create (ctx->pSurf->dev,
-               VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
-               VMA_MEMORY_USAGE_CPU_TO_GPU,
-               ctx->sizeIBO * sizeof(VKVG_IBO_INDEX_TYPE), &ctx->indices);
-}
-void _resize_vbo (VkvgContext ctx, uint32_t new_size) {
-       if (!_wait_flush_fence (ctx))//wait previous cmd if not completed
-               return;
-       ctx->sizeVBO = new_size;
-       uint32_t mod = ctx->sizeVBO % VKVG_VBO_SIZE;
-       if (mod > 0)
-               ctx->sizeVBO += VKVG_VBO_SIZE - mod;
-       LOG(VKVG_LOG_DBG_ARRAYS, "resize VBO: new size: %d\n", ctx->sizeVBO);
-       vkvg_buffer_destroy (&ctx->vertices);
-       vkvg_buffer_create (ctx->pSurf->dev,
-               VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
-               VMA_MEMORY_USAGE_CPU_TO_GPU,
-               ctx->sizeVBO * sizeof(Vertex), &ctx->vertices);
-}
-void _resize_ibo (VkvgContext ctx, size_t new_size) {
-       if (!_wait_flush_fence (ctx))//wait previous cmd if not completed
-               return;
-       ctx->sizeIBO = new_size;
-       uint32_t mod = ctx->sizeIBO % VKVG_IBO_SIZE;
-       if (mod > 0)
-               ctx->sizeIBO += VKVG_IBO_SIZE - mod;
-       LOG(VKVG_LOG_DBG_ARRAYS, "resize IBO: new size: %d\n", ctx->sizeIBO);
-       vkvg_buffer_destroy (&ctx->indices);
-       vkvg_buffer_create (ctx->pSurf->dev,
-               VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
-               VMA_MEMORY_USAGE_CPU_TO_GPU,
-               ctx->sizeIBO * sizeof(VKVG_IBO_INDEX_TYPE), &ctx->indices);
-}
+
 void _add_vertexf (VkvgContext ctx, float x, float y){
        Vertex* pVert = &ctx->vertexCache[ctx->vertCount];
        pVert->pos.x = x;
@@ -449,8 +412,8 @@ bool _wait_and_submit_cmd (VkvgContext ctx){
 void _flush_vertices_caches_until_vertex_base (VkvgContext ctx) {
        _wait_flush_fence (ctx);
 
-       memcpy(ctx->vertices.allocInfo.pMappedData, ctx->vertexCache, ctx->curVertOffset * sizeof (Vertex));
-       memcpy(ctx->indices.allocInfo.pMappedData, ctx->indexCache, ctx->curIndStart * sizeof (VKVG_IBO_INDEX_TYPE));
+       memcpy(ctx->th_objs->vertices.allocInfo.pMappedData, ctx->vertexCache, ctx->curVertOffset * sizeof (Vertex));
+       memcpy(ctx->th_objs->indices.allocInfo.pMappedData, ctx->indexCache, ctx->curIndStart * sizeof (VKVG_IBO_INDEX_TYPE));
 
        //copy remaining vertices and indices to caches starts
        ctx->vertCount -= ctx->curVertOffset;
@@ -467,8 +430,8 @@ void _flush_vertices_caches (VkvgContext ctx) {
        if (!_wait_flush_fence (ctx))
                return;
 
-       memcpy(ctx->vertices.allocInfo.pMappedData, ctx->vertexCache, ctx->vertCount * sizeof (Vertex));
-       memcpy(ctx->indices.allocInfo.pMappedData, ctx->indexCache, ctx->indCount * sizeof (VKVG_IBO_INDEX_TYPE));
+       memcpy(ctx->th_objs->vertices.allocInfo.pMappedData, ctx->vertexCache, ctx->vertCount * sizeof (Vertex));
+       memcpy(ctx->th_objs->indices.allocInfo.pMappedData, ctx->indexCache, ctx->indCount * sizeof (VKVG_IBO_INDEX_TYPE));
 
        ctx->vertCount = ctx->indCount = ctx->curIndStart = ctx->curVertOffset = 0;
 }
@@ -483,16 +446,17 @@ void _end_render_pass (VkvgContext ctx) {
 }
 
 void _check_vao_size (VkvgContext ctx) {
-       if (ctx->vertCount > ctx->sizeVBO || ctx->indCount > ctx->sizeIBO){
+       if (ctx->vertCount > ctx->th_objs->sizeVBO || ctx->indCount > ctx->th_objs->sizeIBO){
                //vbo or ibo buffers too small
                if (ctx->cmdStarted)
                        //if cmd is started buffers, are already bound, so no resize is possible
                        //instead we flush, and clear vbo and ibo caches
                        _flush_cmd_until_vx_base (ctx);
-               if (ctx->vertCount > ctx->sizeVBO)              
-                       _resize_vbo(ctx, ctx->sizeVertices);
-               if (ctx->indCount > ctx->sizeIBO)
-                       _resize_ibo(ctx, ctx->sizeIndices);
+               _wait_flush_fence (ctx);
+               if (ctx->vertCount > ctx->th_objs->sizeVBO)
+                       _resize_vbo(ctx->th_objs, ctx->sizeVertices);
+               if (ctx->indCount > ctx->th_objs->sizeIBO)
+                       _resize_ibo(ctx->th_objs, ctx->sizeIndices);
        }
 }
 
@@ -606,8 +570,8 @@ void _start_cmd_for_render_pass (VkvgContext ctx) {
                                                        0, 3, dss, 0, NULL);
 
        VkDeviceSize offsets[1] = { 0 };
-       CmdBindVertexBuffers(ctx->cmd, 0, 1, &ctx->vertices.buffer, offsets);
-       CmdBindIndexBuffer(ctx->cmd, ctx->indices.buffer, 0, VKVG_VK_INDEX_TYPE);
+       CmdBindVertexBuffers(ctx->cmd, 0, 1, &ctx->th_objs->vertices.buffer, offsets);
+       CmdBindIndexBuffer(ctx->cmd, ctx->th_objs->indices.buffer, 0, VKVG_VK_INDEX_TYPE);
 
        _update_push_constants  (ctx);
 
@@ -1472,19 +1436,21 @@ void _elliptic_arc (VkvgContext ctx, float x1, float y1, float x2, float y2, boo
 //Even-Odd inside test with stencil buffer implementation.
 void _poly_fill (VkvgContext ctx){
        //we anticipate the check for vbo buffer size, ibo is not used in poly_fill
-       if (ctx->vertCount + ctx->pointCount < ctx->sizeVBO) {
+       if (ctx->vertCount + ctx->pointCount < ctx->th_objs->sizeVBO) {
                if (ctx->cmdStarted) {
                        _end_render_pass(ctx);
                        _flush_vertices_caches(ctx);
                        vkh_cmd_end(ctx->cmd);
                        _wait_and_submit_cmd(ctx);//the extra wait here is not useful.
-                       if (ctx->vertCount + ctx->pointCount > ctx->sizeVBO){
+                       if (ctx->vertCount + ctx->pointCount > ctx->th_objs->sizeVBO){
                                //_resize_vertex_cache(ctx, ctx->vertCount + ctx->pointCount);
-                               _resize_vbo(ctx, ctx->vertCount + ctx->pointCount);
+                               _wait_flush_fence (ctx);
+                               _resize_vbo(ctx->th_objs, ctx->vertCount + ctx->pointCount);
                        }
                }else{
                        //_resize_vertex_cache(ctx, ctx->vertCount + ctx->pointCount);
-                       _resize_vbo(ctx, ctx->vertCount + ctx->pointCount);
+                       _wait_flush_fence (ctx);
+                       _resize_vbo(ctx->th_objs, ctx->vertCount + ctx->pointCount);
                }
 
                _start_cmd_for_render_pass(ctx);
index 675ba3e03410a70abf3ed8b7f629f345601a0fa2..34d3990f20df790643491dd3e6d02ad747b4c2e4 100644 (file)
@@ -160,17 +160,13 @@ typedef struct _vkvg_context_t {
 
        vkvg_device_thread_items_t* th_objs;
 
-       //vk buffers, holds data until flush
-       vkvg_buff       indices;                //index buffer with persistent map memory
-       uint32_t        sizeIBO;                //size of vk ibo
-       uint32_t        sizeIndices;    //reserved size
-       uint32_t        indCount;               //current indice count
 
        uint32_t        curIndStart;    //last index recorded in cmd buff
        VKVG_IBO_INDEX_TYPE     curVertOffset;  //vertex offset in draw indexed command
 
-       vkvg_buff       vertices;               //vertex buffer with persistent mapped memory
-       uint32_t        sizeVBO;                //size of vk vbo size
+       uint32_t        sizeIndices;    //reserved size
+       uint32_t        indCount;               //current indice count
+
        uint32_t        sizeVertices;   //reserved size
        uint32_t        vertCount;              //effective vertices count
 
@@ -276,7 +272,6 @@ void _poly_fill                             (VkvgContext ctx);
 void _fill_non_zero                    (VkvgContext ctx);
 void _draw_full_screen_quad (VkvgContext ctx, bool useScissor);
 
-void _create_vertices_buff     (VkvgContext ctx);
 void _add_vertex                       (VkvgContext ctx, Vertex v);
 void _add_vertexf                      (VkvgContext ctx, float x, float y);
 void _set_vertex                       (VkvgContext ctx, uint32_t idx, Vertex v);
index a94c44161f83d23dfbeb404a724215c653e993ed..10492309bede066c0599a2c536a056aa8d92e687 100644 (file)
@@ -56,8 +56,45 @@ PFN_vkWaitForFences                          WaitForFences;
 PFN_vkResetFences                              ResetFences;
 PFN_vkResetCommandBuffer               ResetCommandBuffer;
 
+void _create_vertices_buff (vkvg_device_thread_items_t* ctx){
+       vkvg_buffer_create (ctx->dev,
+               VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
+               VMA_MEMORY_USAGE_CPU_TO_GPU,
+               ctx->sizeVBO * sizeof(Vertex), &ctx->vertices);
+       vkvg_buffer_create (ctx->dev,
+               VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
+               VMA_MEMORY_USAGE_CPU_TO_GPU,
+               ctx->sizeIBO * sizeof(VKVG_IBO_INDEX_TYPE), &ctx->indices);
+}
+void _resize_vbo (vkvg_device_thread_items_t* ctx, uint32_t new_size) {
+       ctx->sizeVBO = new_size;
+       uint32_t mod = ctx->sizeVBO % VKVG_VBO_SIZE;
+       if (mod > 0)
+               ctx->sizeVBO += VKVG_VBO_SIZE - mod;
+       LOG(VKVG_LOG_DBG_ARRAYS, "resize VBO: new size: %d\n", ctx->sizeVBO);
+       vkvg_buffer_destroy (&ctx->vertices);
+       vkvg_buffer_create (ctx->dev,
+               VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
+               VMA_MEMORY_USAGE_CPU_TO_GPU,
+               ctx->sizeVBO * sizeof(Vertex), &ctx->vertices);
+}
+void _resize_ibo (vkvg_device_thread_items_t* ctx, size_t new_size) {
+       ctx->sizeIBO = new_size;
+       uint32_t mod = ctx->sizeIBO % VKVG_IBO_SIZE;
+       if (mod > 0)
+               ctx->sizeIBO += VKVG_IBO_SIZE - mod;
+       LOG(VKVG_LOG_DBG_ARRAYS, "resize IBO: new size: %d\n", ctx->sizeIBO);
+       vkvg_buffer_destroy (&ctx->indices);
+       vkvg_buffer_create (ctx->dev,
+               VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
+               VMA_MEMORY_USAGE_CPU_TO_GPU,
+               ctx->sizeIBO * sizeof(VKVG_IBO_INDEX_TYPE), &ctx->indices);
+}
+
 void _delete_threaded_object (VkvgDevice dev, vkvg_device_thread_items_t* throbjs) {
        vkvg_buffer_destroy (&throbjs->uboGrad);
+       vkvg_buffer_destroy (&throbjs->vertices);
+       vkvg_buffer_destroy (&throbjs->indices);
 
        /*VkDescriptorSet dss[] = {throbjs->dsFont, throbjs->dsSrc};
        vkFreeDescriptorSets    (dev->vkDev, throbjs->descriptorPool, 2, dss);*/
@@ -80,13 +117,17 @@ void _add_threaded_objects (VkvgDevice dev, vkvg_device_thread_items_t* throbjs)
 vkvg_device_thread_items_t* _get_or_create_threaded_objects (VkvgDevice dev, thrd_t id) {
        vkvg_device_thread_items_t* tmp = dev->threaded_objects;
        while (tmp) {
-               if (thrd_equal(tmp->id, id))
+               if (thrd_equal(tmp->id, id) && !tmp->inUse) {
+                       tmp->inUse = true;
                        return tmp;
+               }
                tmp = tmp->next;
        }
        tmp = (vkvg_device_thread_items_t*)calloc(1, sizeof(vkvg_device_thread_items_t));
        tmp->id = thrd_current();
-       tmp->dev = dev->vkDev;
+       tmp->dev = dev;
+       tmp->sizeVBO = VKVG_VBO_SIZE;
+       tmp->sizeIBO = VKVG_IBO_SIZE;
 
        const VkDescriptorPoolSize descriptorPoolSize[] = {
                {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2 },
@@ -128,15 +169,23 @@ vkvg_device_thread_items_t* _get_or_create_threaded_objects (VkvgDevice dev, thr
        _update_descriptor_set  (tmp, dev->fontCache->texture, tmp->dsFont);
        _update_descriptor_set  (tmp, dev->emptyImg, tmp->dsSrc);
 
+       _create_vertices_buff   (tmp);
+
 #if defined(DEBUG) && defined (VKVG_DBG_UTILS)
        vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (uint64_t)tmp->descriptorPool, "CTX Descriptor Pool");
        vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t)tmp->dsSrc, "CTX DescSet SOURCE");
        vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t)tmp->dsFont, "CTX DescSet FONT");
        vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_DESCRIPTOR_SET, (uint64_t)tmp->dsGrad, "CTX DescSet GRADIENT");
+
+       vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_BUFFER, (uint64_t)tmp->indices.buffer, "CTX Index Buff");
+       vkh_device_set_object_name((VkhDevice)dev, VK_OBJECT_TYPE_BUFFER, (uint64_t)tmp->vertices.buffer, "CTX Vertex Buff");
 #endif
 
+
        _add_threaded_objects(dev, tmp);
 
+       tmp->inUse = true;
+
        return tmp;
 }
 void _update_descriptor_set (vkvg_device_thread_items_t* ctx, VkhImage img, VkDescriptorSet ds){
@@ -149,7 +198,7 @@ void _update_descriptor_set (vkvg_device_thread_items_t* ctx, VkhImage img, VkDe
                        .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
                        .pImageInfo = &descSrcTex
        };
-       vkUpdateDescriptorSets(ctx->dev, 1, &writeDescriptorSet, 0, NULL);
+       vkUpdateDescriptorSets(ctx->dev->vkDev, 1, &writeDescriptorSet, 0, NULL);
 }
 bool _try_get_phyinfo (VkhPhyInfo* phys, uint32_t phyCount, VkPhysicalDeviceType gpuType, VkhPhyInfo* phy) {
        for (uint32_t i=0; i<phyCount; i++){
index bc18e28b6c9a7efe42e702a54a6a7f802cebd794..647ce22b37c0b047ee536470bcf4920dcda6ca33 100644 (file)
@@ -54,7 +54,8 @@ extern PFN_vkResetCommandBuffer                       ResetCommandBuffer;
 //per thread vulkan object used in contexts
 typedef struct _vkvg_device_thread_items_t {
        thrd_t                          id;
-       VkDevice                        dev;
+       bool                            inUse;
+       VkvgDevice                      dev;
        VkDescriptorPool        descriptorPool;         //one pool per thread
        VkDescriptorSet         dsGrad;         //gradient uniform buffer
        VkDescriptorSet         dsFont;         //fonts glyphs texture atlas descriptor (local for thread safety)
@@ -62,6 +63,13 @@ typedef struct _vkvg_device_thread_items_t {
 
        vkvg_buff                       uboGrad;                        //uniform buff obj holdings gradient infos
 
+       //vk buffers, holds data until flush
+       vkvg_buff       indices;                //index buffer with persistent map memory
+       uint32_t        sizeIBO;                //size of vk ibo
+       vkvg_buff       vertices;               //vertex buffer with persistent mapped memory
+       uint32_t        sizeVBO;                //size of vk vbo size
+
+
        struct _vkvg_device_thread_items_t* next;
 }vkvg_device_thread_items_t;
 
@@ -148,4 +156,7 @@ void _layers_check_release ();
 vkvg_device_thread_items_t* _get_or_create_threaded_objects (VkvgDevice dev, thrd_t id);
 void _delete_threaded_object (VkvgDevice dev, vkvg_device_thread_items_t* throbjs);
 void _update_descriptor_set (vkvg_device_thread_items_t*, VkhImage img, VkDescriptorSet ds);
+
+void _resize_vbo (vkvg_device_thread_items_t* ctx, uint32_t new_size);
+void _resize_ibo (vkvg_device_thread_items_t* ctx, size_t new_size);
 #endif
index 8abc23fd268c02c93c2123984066d215b09a62d4..485cd96561a22be3708122c25bad0760a0c61ace 100644 (file)
@@ -151,6 +151,7 @@ void _increase_font_tex_array (VkvgDevice dev){
 
        VkvgContext next = dev->lastCtx;
        while (next != NULL){
+               _wait_flush_fence (next);
                _update_descriptor_set  (next->th_objs, cache->texture, next->th_objs->dsFont);
                next = next->pPrev;
        }