]> O.S.I.I.S - jp/vkvg.git/commitdiff
remove full screen rectancle no longer needed
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 10 May 2019 01:49:20 +0000 (03:49 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 10 May 2019 01:49:20 +0000 (03:49 +0200)
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 8dc1366bb80f13dddc76196c8ec48818b6b9f4ec..021b4dda564840c5ab96bc1c4da49bd7bc031f3c 100644 (file)
@@ -65,6 +65,10 @@ VkvgContext vkvg_create(VkvgSurface surf)
     ctx->curOperator    = VKVG_OPERATOR_OVER;
     ctx->curFillRule    = VKVG_FILL_RULE_NON_ZERO;
     ctx->curSavBit      = 0x4;
+    ctx->vertCount      = 0;
+    ctx->indCount       = 0;
+    ctx->curIndStart    = 0;
+
 
     push_constants pc = {
             {.height=1},
@@ -117,10 +121,6 @@ VkvgContext vkvg_create(VkvgSurface surf)
     _update_descriptor_set  (ctx, surf->dev->emptyImg, ctx->dsSrc);
     _update_gradient_desc_set(ctx);
 
-    //add full screen quad at the beginning, recurently used
-    _vao_add_rectangle (ctx,0,0,ctx->pSurf->width,ctx->pSurf->height);
-
-    _init_cmd_buff          (ctx);
     _clear_path             (ctx);
 
     ctx->references = 1;
@@ -133,7 +133,6 @@ VkvgContext vkvg_create(VkvgSurface surf)
  */
 void vkvg_flush (VkvgContext ctx){
     _flush_cmd_buff(ctx);
-    _init_cmd_buff(ctx);
 /*
 #ifdef DEBUG
 
index 529761ffc422c434674fc255449e35a95f696973..4375bd47df27f69b393d2c7dd6502e341fae2ce5 100644 (file)
@@ -247,6 +247,10 @@ void _flush_cmd_buff (VkvgContext ctx){
     vkh_cmd_end             (ctx->cmd);
 
     _submit_wait_and_reset_cmd(ctx);
+
+    ctx->vertCount = 0;
+    ctx->indCount = 0;
+    ctx->curIndStart = 0;
 }
 
 //bind correct draw pipeline depending on current OPERATOR
@@ -264,17 +268,6 @@ void _bind_draw_pipeline (VkvgContext ctx) {
         break;
     }
 }
-void _init_cmd_buff (VkvgContext ctx){
-    //full surf quad triangles is at the beginning
-    ctx->vertCount = 4;
-    ctx->indCount = 6;
-    ctx->curIndStart = 6;
-    //VkClearValue clearValues[2];
-    //clearValues[0].color = { { 0.0f, 0.0f, 0.0f, 1.0f } };
-    //clearValues[1].depthStencil = { 1.0f, 0 };
-
-}
-
 
 void _start_cmd_for_render_pass (VkvgContext ctx) {
     vkh_cmd_begin (ctx->cmd,VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
index ff8f89122855869b54275d2e046a9e264de2b7e0..cf400ae1d84f39950c9ffdc017cde350539eb90b 100644 (file)
@@ -171,7 +171,6 @@ void _vao_add_rectangle     (VkvgContext ctx, float x, float y, float width, flo
 
 void _bind_draw_pipeline    (VkvgContext ctx);
 void _create_cmd_buff          (VkvgContext ctx);
-void _init_cmd_buff                    (VkvgContext ctx);
 void _check_cmd_buff_state  (VkvgContext ctx);
 void _flush_cmd_buff           (VkvgContext ctx);
 void _record_draw_cmd          (VkvgContext ctx);
index a4c7b3de1934fd9377d20493172d16f16827612b..5a7b18bf484f19f326da655e00452142c96ca324 100644 (file)
@@ -33,13 +33,6 @@ void _flush_all_contexes (VkvgDevice dev){
         next = next->pPrev;
     }
 }
-void _init_all_contexes (VkvgDevice dev){
-    VkvgContext next = dev->lastCtx;
-    while (next != NULL){
-        _init_cmd_buff (next);
-        next = next->pPrev;
-    }
-}
 
 void _create_pipeline_cache(VkvgDevice dev){
 
index 44060e87976b0d24c4d55c4905b87f38bfd2534e..49f4ffa56007c778ae639c8e4dad5a6397c96f98 100644 (file)
@@ -107,7 +107,6 @@ VkRenderPass _createRenderPassNoResolve(VkvgDevice dev, VkAttachmentLoadOp loadO
 void _setupPipelines            (VkvgDevice dev);
 void _createDescriptorSetLayout (VkvgDevice dev);
 void _flush_all_contexes        (VkvgDevice dev);
-void _init_all_contexes         (VkvgDevice dev);
 void _wait_and_reset_device_fence (VkvgDevice dev);
 void _submit_cmd                (VkvgDevice dev, VkCommandBuffer* cmd, VkFence fence);
 #endif
index dbb34f6766474d9d357a8e564400fb749e41cadd..3b138e77b2d45fa592160b23274f021d118dba9d 100644 (file)
@@ -135,8 +135,6 @@ void _increase_font_tex_array (VkvgDevice dev){
         _update_descriptor_set (next, next->source, next->dsSrc);
         next = next->pPrev;
     }
-
-    _init_all_contexes  (dev);
 }
 ///Start a new line in font cache, increase texture layer count if needed.
 void _init_next_line_in_tex_cache (VkvgDevice dev, _vkvg_font_t* f){