]> O.S.I.I.S - jp/vkvg.git/commitdiff
dual command buffers for context, wait and submit queue submission pattern instead...
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 2 Sep 2019 16:09:42 +0000 (18:09 +0200)
committerj-p <jp_bruyere@hotmail.com>
Tue, 3 Sep 2019 18:36:09 +0000 (20:36 +0200)
src/vkvg_context.c
src/vkvg_context_internal.c
src/vkvg_context_internal.h
src/vkvg_device_internal.c
src/vkvg_fonts.c
src/vkvg_internal.h
tests/svg.c
vkh

index 2cdd7cc04e36d3c3a12ae53d22f7da0d06fdb7e6..e877bd42875f29d2541556c825a7feefdba6b00d 100644 (file)
@@ -109,7 +109,7 @@ VkvgContext vkvg_create(VkvgSurface surf)
     ctx->selectedFont.fontFile = (char*)calloc(FONT_FILE_NAME_MAX_SIZE,sizeof(char));
     ctx->currentFont           = NULL;
 
-    ctx->flushFence = vkh_fence_create((VkhDevice)dev);
+    ctx->flushFence = vkh_fence_create_signaled ((VkhDevice)dev);
 
     ctx->points = (vec2*)       malloc (VKVG_VBO_SIZE*sizeof(vec2));
     ctx->pathes = (uint32_t*)   malloc (VKVG_PATHES_SIZE*sizeof(uint32_t));
@@ -128,6 +128,8 @@ VkvgContext vkvg_create(VkvgSurface surf)
 
     _clear_path             (ctx);
 
+    ctx->cmd = ctx->cmdBuffers[0];//current recording buffer
+
     ctx->references = 1;
     ctx->status = VKVG_STATUS_SUCCESS;
     return ctx;
@@ -138,6 +140,7 @@ VkvgContext vkvg_create(VkvgSurface surf)
  */
 void vkvg_flush (VkvgContext ctx){
     _flush_cmd_buff(ctx);
+    _wait_flush_fence(ctx);
 /*
 #ifdef DEBUG
 
@@ -174,6 +177,8 @@ void vkvg_destroy (VkvgContext ctx)
 
     _flush_cmd_buff(ctx);
 
+    vkWaitForFences (ctx->pSurf->dev->vkDev, 1, &ctx->flushFence, VK_TRUE, VKVG_FENCE_TIMEOUT);
+
     LOG(LOG_INFO, "DESTROY Context: ctx = %lu; surf = %lu\n", (ulong)ctx, (ulong)ctx->pSurf);
 
     if (ctx->pattern)
@@ -182,7 +187,7 @@ void vkvg_destroy (VkvgContext ctx)
     VkDevice dev = ctx->pSurf->dev->vkDev;
 
     vkDestroyFence      (dev, ctx->flushFence,NULL);
-    vkFreeCommandBuffers(dev, ctx->cmdPool, 1, &ctx->cmd);
+    vkFreeCommandBuffers(dev, ctx->cmdPool, 2, ctx->cmdBuffers);
     vkDestroyCommandPool(dev, ctx->cmdPool, NULL);
 
     VkDescriptorSet dss[] = {ctx->dsFont, ctx->dsSrc, ctx->dsGrad};
@@ -495,30 +500,30 @@ void vkvg_clip_preserve (VkvgContext ctx){
     LOG(LOG_INFO, "CLIP: ctx = %lu; path cpt = %d;\n", ctx, ctx->pathPtr / 2);
 
     if (ctx->pointCount * 4 > ctx->sizeIndices - ctx->indCount)//flush if vk buff is full
-        vkvg_flush(ctx);
+        _flush_cmd_buff(ctx);
 
     if (ctx->curFillRule == VKVG_FILL_RULE_EVEN_ODD){
         _check_cmd_buff_state(ctx);
         _poly_fill (ctx);
-        CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
-        CmdSetStencilReference(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
+        CmdBindPipeline         (ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
+        CmdSetStencilReference  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
         CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
-        CmdSetStencilWriteMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_ALL_BIT);
+        CmdSetStencilWriteMask  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_ALL_BIT);
     }else{
         _check_cmd_buff_state(ctx);
-        CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
-        CmdSetStencilReference (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
+        CmdBindPipeline         (ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
+        CmdSetStencilReference  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
         CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
-        CmdSetStencilWriteMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
+        CmdSetStencilWriteMask  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
         _fill_ec(ctx);
-        CmdSetStencilReference(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
+        CmdSetStencilReference  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
         CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
-        CmdSetStencilWriteMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_ALL_BIT);
+        CmdSetStencilWriteMask  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_ALL_BIT);
     }
-    _draw_full_screen_quad(ctx,false);
+    _draw_full_screen_quad (ctx, false);
     //should test current operator to bind correct pipeline
     _bind_draw_pipeline (ctx);
-    CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
+    CmdSetStencilCompareMask (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
 }
 void vkvg_fill_preserve (VkvgContext ctx){
     if (ctx->pathPtr == 0)      //nothing to fill
@@ -528,7 +533,7 @@ void vkvg_fill_preserve (VkvgContext ctx){
     LOG(LOG_INFO, "FILL: ctx = %lu; path cpt = %d;\n", ctx, ctx->pathPtr / 2);
 
     if (ctx->pointCount * 4 > ctx->sizeIndices - ctx->indCount)//flush if vk buff is full
-        vkvg_flush(ctx);
+        _flush_cmd_buff(ctx);
 
     _check_cmd_buff_state(ctx);
 
@@ -539,7 +544,6 @@ void vkvg_fill_preserve (VkvgContext ctx){
         _draw_full_screen_quad(ctx,true);
         CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
     }else{
-        //CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
         CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
         _fill_ec(ctx);
     }
@@ -553,7 +557,7 @@ void vkvg_stroke_preserve (VkvgContext ctx)
     LOG(LOG_INFO, "STROKE: ctx = %lu; path cpt = %d;\n", ctx, ctx->pathPtr / 2);
 
     if (ctx->pointCount * 4 > ctx->sizeIndices - ctx->indCount)
-        vkvg_flush(ctx);
+        _flush_cmd_buff(ctx);
 
     Vertex v = {};
     v.uv.z = -1;
@@ -794,7 +798,8 @@ void vkvg_font_extents (VkvgContext ctx, vkvg_font_extents_t* extents) {
 void vkvg_save (VkvgContext ctx){
     LOG(LOG_INFO, "SAVE CONTEXT: ctx = %lu\n", (ulong)ctx);
 
-    _flush_cmd_buff(ctx);
+    _flush_cmd_buff (ctx);
+    _wait_flush_fence (ctx);
 
     VkvgDevice dev = ctx->pSurf->dev;
     vkvg_context_save_t* sav = (vkvg_context_save_t*)calloc(1,sizeof(vkvg_context_save_t));
@@ -830,20 +835,20 @@ void vkvg_save (VkvgContext ctx){
                               VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT);
 
         VK_CHECK_RESULT(vkEndCommandBuffer(ctx->cmd));
-        _submit_wait_and_reset_cmd(ctx);
+        _wait_and_submit_cmd(ctx);
     }
 
     uint8_t curSaveBit = 1 << (ctx->curSavBit % 6 + 2);
 
-    _start_cmd_for_render_pass(ctx);
+    _start_cmd_for_render_pass (ctx);
 
-    CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
+    CmdBindPipeline         (ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
 
-    CmdSetStencilReference(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT|curSaveBit);
+    CmdSetStencilReference  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT|curSaveBit);
     CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
-    CmdSetStencilWriteMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, curSaveBit);
+    CmdSetStencilWriteMask  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, curSaveBit);
 
-    _draw_full_screen_quad(ctx,false);
+    _draw_full_screen_quad (ctx, false);
 
     _bind_draw_pipeline (ctx);
     CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
@@ -885,28 +890,29 @@ void vkvg_restore (VkvgContext ctx){
     ctx->pushConsts   = sav->pushConsts;
 
     if (sav->pattern)
-        _update_cur_pattern(ctx, sav->pattern);
+        _update_cur_pattern (ctx, sav->pattern);
 
-    _flush_cmd_buff(ctx);
+    _flush_cmd_buff (ctx);
+    _wait_flush_fence (ctx);
 
     ctx->curSavBit--;
 
     uint8_t curSaveBit = 1 << (ctx->curSavBit % 6 + 2);
 
-    _start_cmd_for_render_pass(ctx);
+    _start_cmd_for_render_pass (ctx);
 
-    CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
+    CmdBindPipeline         (ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping);
 
-    CmdSetStencilReference(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT|curSaveBit);
+    CmdSetStencilReference  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT|curSaveBit);
     CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, curSaveBit);
-    CmdSetStencilWriteMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
+    CmdSetStencilWriteMask  (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
 
-    _draw_full_screen_quad(ctx,false);
+    _draw_full_screen_quad (ctx, false);
 
     _bind_draw_pipeline (ctx);
-    CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
+    CmdSetStencilCompareMask (ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_CLIP_BIT);
 
-    _flush_cmd_buff(ctx);
+    _flush_cmd_buff (ctx);
 
     uint8_t curSaveStencil = ctx->curSavBit / 6;
     if (ctx->curSavBit > 0 && ctx->curSavBit % 6 == 0){//addtional save/restore stencil image have to be copied back to surf stencil first
@@ -934,9 +940,9 @@ void vkvg_restore (VkvgContext ctx){
                               VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT);
 
         VK_CHECK_RESULT(vkEndCommandBuffer(ctx->cmd));
-        _submit_wait_and_reset_cmd(ctx);
+        _wait_and_submit_cmd (ctx);
 
-        vkh_image_destroy(savStencil);
+        vkh_image_destroy (savStencil);
     }
 
     ctx->lineWidth  = sav->lineWidth;
index bd9c30df3b6752e48ebcf58b36823730a0952f3c..cdf025c74cf9a2b1fa89c8fd4f557a682f65d589 100644 (file)
@@ -202,7 +202,7 @@ void _vao_add_rectangle (VkvgContext ctx, float x, float y, float width, float h
 
 
 void _create_cmd_buff (VkvgContext ctx){
-    ctx->cmd = vkh_cmd_buff_create((VkhDevice)ctx->pSurf->dev, ctx->cmdPool,VK_COMMAND_BUFFER_LEVEL_PRIMARY);
+    vkh_cmd_buffs_create((VkhDevice)ctx->pSurf->dev, ctx->cmdPool,VK_COMMAND_BUFFER_LEVEL_PRIMARY, 2, ctx->cmdBuffers);
 #if defined(DEBUG) && defined(ENABLE_VALIDATION)
     vkh_device_set_object_name((VkhDevice)ctx->pSurf->dev, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)ctx->cmd, "vkvgCtxCmd");
 #endif
@@ -225,21 +225,25 @@ void _record_draw_cmd (VkvgContext ctx){
 void _clear_attachment (VkvgContext ctx) {
 
 }
-inline void _submit_ctx_cmd(VkvgContext ctx){
-    _submit_cmd (ctx->pSurf->dev, &ctx->cmd, ctx->flushFence);
+inline void _wait_flush_fence (VkvgContext ctx) {
+    vkWaitForFences (ctx->pSurf->dev->vkDev, 1, &ctx->flushFence, VK_TRUE, VKVG_FENCE_TIMEOUT);
 }
-void _wait_and_reset_ctx_cmd (VkvgContext ctx){
+void _wait_and_submit_cmd (VkvgContext ctx){
     if (!ctx->cmdStarted)
         return;
-    vkWaitForFences(ctx->pSurf->dev->vkDev,1,&ctx->flushFence,VK_TRUE,UINT64_MAX);
-    vkResetFences(ctx->pSurf->dev->vkDev,1,&ctx->flushFence);
-    vkResetCommandBuffer(ctx->cmd,0);
-    ctx->cmdStarted = false;
-}
 
-inline void _submit_wait_and_reset_cmd (VkvgContext ctx){
-    _submit_ctx_cmd(ctx);
-    _wait_and_reset_ctx_cmd(ctx);
+    _wait_flush_fence (ctx);
+    vkResetFences   (ctx->pSurf->dev->vkDev, 1, &ctx->flushFence);
+
+    _submit_cmd (ctx->pSurf->dev, &ctx->cmd, ctx->flushFence);
+
+    if (ctx->cmd == ctx->cmdBuffers[0])
+        ctx->cmd = ctx->cmdBuffers[1];
+    else
+        ctx->cmd = ctx->cmdBuffers[0];
+
+    vkResetCommandBuffer (ctx->cmd, 0);
+    ctx->cmdStarted = false;
 }
 /*void _explicit_ms_resolve (VkvgContext ctx){//should init cmd before calling this (unused, using automatic resolve by renderpass)
     vkh_image_set_layout (ctx->cmd, ctx->pSurf->imgMS, VK_IMAGE_ASPECT_COLOR_BIT,
@@ -271,17 +275,17 @@ void _end_render_pass (VkvgContext ctx) {
     ctx->renderPassBeginInfo.renderPass = ctx->pSurf->dev->renderPass;
 }
 void _flush_cmd_buff (VkvgContext ctx){
+    if (!ctx->cmdStarted)
+        return;
 
     memcpy(ctx->vertices.allocInfo.pMappedData, ctx->vertexCache, ctx->vertCount * sizeof (Vertex));
     memcpy(ctx->indices.allocInfo.pMappedData, ctx->indexCache, ctx->indCount * sizeof (uint32_t));
 
-    if (!ctx->cmdStarted)
-        return;
     _end_render_pass        (ctx);
     vkh_cmd_end             (ctx->cmd);
 
     LOG(LOG_INFO, "FLUSH CTX: ctx = %lu; vertices = %d; indices = %d\n", ctx, ctx->vertCount, ctx->indCount);
-    _submit_wait_and_reset_cmd(ctx);
+    _wait_and_submit_cmd(ctx);
 
     ctx->vertCount = 0;
     ctx->indCount = 0;
@@ -379,7 +383,7 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) {
 
         //flush ctx in two steps to add the src transitioning in the cmd buff
         if (ctx->cmdStarted)//transition of img without appropriate dependencies in subpass must be done outside renderpass.
-            _end_render_pass    (ctx);
+            _end_render_pass (ctx);
         else {
             vkh_cmd_begin (ctx->cmd,VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
             ctx->cmdStarted = true;
@@ -390,8 +394,8 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) {
                               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
                               VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
 
-        vkh_cmd_end             (ctx->cmd);
-        _submit_wait_and_reset_cmd(ctx);
+        vkh_cmd_end (ctx->cmd);
+        _wait_and_submit_cmd (ctx);
 
         ctx->source = surf->img;
 
@@ -467,6 +471,7 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) {
         vkvg_pattern_destroy    (lastPat);
 }
 void _update_descriptor_set (VkvgContext ctx, VkhImage img, VkDescriptorSet ds){
+    _wait_flush_fence(ctx);//descriptorSet update invalidate cmd buffs
     VkDescriptorImageInfo descSrcTex = vkh_image_get_descriptor (img, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
     VkWriteDescriptorSet writeDescriptorSet = {
             .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET,
@@ -842,11 +847,11 @@ void _recursive_bezier (VkvgContext ctx,
 
     // Continue subdivision
     //----------------------
-    _recursive_bezier(ctx, x1, y1, x12, y12, x123, y123, x1234, y1234, level + 1);
-    _recursive_bezier(ctx, x1234, y1234, x234, y234, x34, y34, x4, y4, level + 1);
+    _recursive_bezier (ctx, x1, y1, x12, y12, x123, y123, x1234, y1234, level + 1);
+    _recursive_bezier (ctx, x1234, y1234, x234, y234, x34, y34, x4, y4, level + 1);
 }
 void _poly_fill (VkvgContext ctx){
-    CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelinePolyFill);
+    CmdBindPipeline (ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelinePolyFill);
 
     uint32_t ptrPath = 0;
     Vertex v = {};
@@ -860,14 +865,14 @@ void _poly_fill (VkvgContext ctx){
         //close path
         ctx->pathes[ptrPath] |= PATH_CLOSED_BIT;// ctx->pathes[ptrPath];//close path by setting start and end equal
 
-        uint32_t firstPtIdx = ctx->pathes[ptrPath]&PATH_ELT_MASK;
-        uint32_t lastPtIdx =   ctx->pathes[ptrPath+1]&PATH_ELT_MASK;//_get_last_point_of_closed_path (ctx, ptrPath);
+        uint32_t firstPtIdx = ctx->pathes [ptrPath] & PATH_ELT_MASK;
+        uint32_t lastPtIdx  = ctx->pathes [ptrPath+1] & PATH_ELT_MASK;//_get_last_point_of_closed_path (ctx, ptrPath);
         uint32_t pathPointCount = lastPtIdx - firstPtIdx + 1;
         uint32_t firstVertIdx = ctx->vertCount;
 
         for (uint i = 0; i < pathPointCount; i++) {
-            v.pos = ctx->points[i+firstPtIdx];
-            _add_vertex(ctx, v);
+            v.pos = ctx->points [i+firstPtIdx];
+            _add_vertex (ctx, v);
         }
 
         LOG(LOG_INFO_PATH, "\tpoly fill: point count = %d; 1st vert = %d; vert count = %d\n", pathPointCount, firstVertIdx, ctx->vertCount - firstVertIdx);
index d844741e746f904bfb2fafd22688fcf3dc0e8312..720ccfc5ea21ec93e38c8300b2bf46b0831e7de3 100644 (file)
@@ -76,7 +76,8 @@ typedef struct _vkvg_context_t {
     VkhImage            source;     //source of painting operation
 
     VkCommandPool              cmdPool;    //local pools ensure thread safety
-    VkCommandBuffer     cmd;        //single cmd buff for context operations
+    VkCommandBuffer     cmdBuffers[2];//double cmd buff for context operations
+    VkCommandBuffer     cmd;        //current recording buffer
     bool                cmdStarted; //prevent flushing empty renderpass
     bool                pushCstDirty;//prevent pushing to gpu if not requested
     VkDescriptorPool   descriptorPool;//one pool per thread
@@ -192,9 +193,8 @@ void _create_cmd_buff               (VkvgContext ctx);
 void _check_cmd_buff_state  (VkvgContext ctx);
 void _flush_cmd_buff           (VkvgContext ctx);
 void _record_draw_cmd          (VkvgContext ctx);
-void _submit_wait_and_reset_cmd(VkvgContext ctx);
-void _submit_ctx_cmd        (VkvgContext ctx);
-void _wait_and_reset_ctx_cmd(VkvgContext ctx);
+void _wait_flush_fence      (VkvgContext ctx);
+void _wait_and_submit_cmd   (VkvgContext ctx);
 void _update_push_constants (VkvgContext ctx);
 void _update_cur_pattern    (VkvgContext ctx, VkvgPattern pat);
 void _set_mat_inv_and_vkCmdPush (VkvgContext ctx);
index 98c7eba926f8815e110f406cc1aca73b2b405454..d7daeca94c483e2d4cdd09e9d24e1fc1fae2c6e7 100644 (file)
@@ -103,7 +103,7 @@ VkRenderPass _createRenderPassMS(VkvgDevice dev, VkAttachmentLoadOp loadOp, VkAt
                     .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
                     .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
                     .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,
-                    .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED,
+                    .initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
                     .finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
     VkAttachmentDescription attColorResolve = {
                     .format = FB_COLOR_FORMAT,
index 772b575551650629212fe3d7e89e400b172767ab..c670f0f6712b30041f19edb962f0454d8ce173e3 100644 (file)
@@ -128,7 +128,7 @@ void _increase_font_tex_array (VkvgDevice dev){
 
     vkh_image_destroy   (cache->texture);
     cache->texLength   = newSize;
-    cache->texture         = newImg;
+    cache->texture     = newImg;
 
     VkvgContext next = dev->lastCtx;
     while (next != NULL){
index 8b035ad0b4b55cd7ad79e6ca40aea8e32c5572d4..39f4a00807c820b754f8caaa1c0e2ba448429b82 100644 (file)
@@ -51,5 +51,5 @@
 //used to store clipping bit on context saving. 8 bit stencil will allow 6 save/restore layer
 #define FB_STENCIL_FORMAT VK_FORMAT_S8_UINT
 #define FB_COLOR_FORMAT VK_FORMAT_B8G8R8A8_UNORM
-
+#define VKVG_FENCE_TIMEOUT UINT64_MAX
 #endif
index adda1673d3014abd664de0cd632b8542aacef40d..3827f1c5333e552f322689bf28c82e9771669006 100644 (file)
@@ -13,9 +13,9 @@
 }*/
 
 static float rotation = 0.f;
-//static const char* path = "data/tiger.svg";
+static const char* path = "data/tiger.svg";
 //static const char* path = "data/vkvg.svg";
-static const char* path = "data/testPiece.svg";
+//static const char* path = "data/testPiece.svg";
 
 void test_svg_surface() {
     VkvgSurface svgSurf = vkvg_surface_create_from_svg(device, path);
diff --git a/vkh b/vkh
index 38ec67de2972f9d4734980a7a83bd4baf9784aa5..5d84e42590eff42cdb02a3c10227de0c1ca1737a 160000 (submodule)
--- a/vkh
+++ b/vkh
@@ -1 +1 @@
-Subproject commit 38ec67de2972f9d4734980a7a83bd4baf9784aa5
+Subproject commit 5d84e42590eff42cdb02a3c10227de0c1ca1737a