]> O.S.I.I.S - jp/vkvg.git/commitdiff
log messages
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 10 May 2019 03:45:45 +0000 (05:45 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 10 May 2019 03:45:45 +0000 (05:45 +0200)
include/vkvg.h
src/vkvg_context_internal.c
tests/common/test.c

index 1fbf8ab165fa2becda2d4590263b74928e584dec..5cfdff052852b58f547546e8b4a9d657daf8f985 100644 (file)
@@ -43,7 +43,7 @@ extern "C" {
 #define LOG_FULL               0xff
 
 #ifdef DEBUG
-static uint8_t log_level       = LOG_ERR;// | LOG_INFO | LOG_DEBUG;
+static uint8_t log_level       = LOG_ERR;// | LOG_INFO | LOG_DEBUG | LOG_INFO_PATH;
 #define LOG(level,...) (log_level & level) ? fprintf (stdout, __VA_ARGS__):true;
 #else
 #define LOG
index 4375bd47df27f69b393d2c7dd6502e341fae2ce5..5fd74d7eade3dea9e5c715a5bf4259ee8886e7cd 100644 (file)
@@ -178,9 +178,9 @@ void _create_cmd_buff (VkvgContext ctx){
     ctx->cmd = vkh_cmd_buff_create((VkhDevice)ctx->pSurf->dev, ctx->cmdPool,VK_COMMAND_BUFFER_LEVEL_PRIMARY);
 }
 void _record_draw_cmd (VkvgContext ctx){
-    LOG(LOG_INFO, "RECORD DRAW CMD: ctx = %lu; vert cpt = %d; ind cpt = %d; ind drawn = %d\n", (ulong)ctx, ctx->vertCount - 4, ctx->indCount - 6, ctx->indCount - ctx->curIndStart);
     if (ctx->indCount == ctx->curIndStart)
         return;
+    LOG(LOG_INFO, "RECORD DRAW CMD: ctx = %lu; vertices = %d; indices = %d\n", (ulong)ctx, ctx->vertCount - *((uint32_t*)(ctx->indices.allocInfo.pMappedData + (ctx->curIndStart * sizeof(uint32_t)))), ctx->indCount - ctx->curIndStart);
     _check_cmd_buff_state(ctx);
     CmdDrawIndexed(ctx->cmd, ctx->indCount - ctx->curIndStart, 1, ctx->curIndStart, 0, 1);
 
@@ -235,8 +235,8 @@ inline void _submit_wait_and_reset_cmd (VkvgContext ctx){
 }*/
 
 void _end_render_pass (VkvgContext ctx) {
-    LOG(LOG_INFO, "END RENDER PASS: ctx = %lu; vert cpt = %d; ind cpt = %d\n", ctx, ctx->vertCount -4, ctx->indCount - 6);
     _record_draw_cmd        (ctx);
+    LOG(LOG_INFO, "END RENDER PASS: ctx = %lu;\n", ctx);
     CmdEndRenderPass      (ctx->cmd);
     ctx->renderPassBeginInfo.renderPass = ctx->pSurf->dev->renderPass;
 }
@@ -246,6 +246,7 @@ void _flush_cmd_buff (VkvgContext ctx){
     _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);
 
     ctx->vertCount = 0;
@@ -270,6 +271,7 @@ void _bind_draw_pipeline (VkvgContext ctx) {
 }
 
 void _start_cmd_for_render_pass (VkvgContext ctx) {
+    LOG(LOG_INFO, "START RENDER PASS: ctx = %lu\n", ctx);
     vkh_cmd_begin (ctx->cmd,VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
 
     if (ctx->pSurf->img->layout == VK_IMAGE_LAYOUT_UNDEFINED){
index 3f6e0b480d3fe57fd58443580206bf0a4ad127fb..98b2ca72462e4a4c3e98fa6f12338c40fadfa0de 100644 (file)
@@ -166,6 +166,7 @@ void perform_test (void(*testfunc)(void),uint width, uint height) {
 
         frameTimeAccum += time_diff(before , after);
         frameCount++;
+        fflush(stdout);
     }
 
     frameTime = frameTimeAccum / frameCount;