diff options
author | Hans Goudey <h.goudey@me.com> | 2022-11-11 04:14:48 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-11-11 04:41:13 +0300 |
commit | 9465b109af0b70244a36f9e68493e316d9f8b56f (patch) | |
tree | c4d933bf09f8313071556063156538ec3356b24c /source/blender/draw/intern/draw_manager_profiling.c | |
parent | 026d21a225521670c6b5083da9da61227da69e65 (diff) | |
parent | ca1642cd0c5cdf634fe2022c955d93983de95934 (diff) |
Merge branch 'master' into refactor-mesh-position-genericrefactor-mesh-position-generic
Diffstat (limited to 'source/blender/draw/intern/draw_manager_profiling.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager_profiling.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/source/blender/draw/intern/draw_manager_profiling.c b/source/blender/draw/intern/draw_manager_profiling.c index d14f5c7f125..92cb3e008b9 100644 --- a/source/blender/draw/intern/draw_manager_profiling.c +++ b/source/blender/draw/intern/draw_manager_profiling.c @@ -225,15 +225,15 @@ void DRW_stats_draw(const rcti *rect) /* ------------------------------------------ */ /* Label row */ char col_label[32]; - sprintf(col_label, "Engine"); + BLI_snprintf(col_label, sizeof(col_label), "Engine"); draw_stat_5row(rect, u++, v, col_label, sizeof(col_label)); - sprintf(col_label, "Init"); + BLI_snprintf(col_label, sizeof(col_label), "Init"); draw_stat_5row(rect, u++, v, col_label, sizeof(col_label)); - sprintf(col_label, "Background"); + BLI_snprintf(col_label, sizeof(col_label), "Background"); draw_stat_5row(rect, u++, v, col_label, sizeof(col_label)); - sprintf(col_label, "Render"); + BLI_snprintf(col_label, sizeof(col_label), "Render"); draw_stat_5row(rect, u++, v, col_label, sizeof(col_label)); - sprintf(col_label, "Total (w/o cache)"); + BLI_snprintf(col_label, sizeof(col_label), "Total (w/o cache)"); draw_stat_5row(rect, u++, v, col_label, sizeof(col_label)); v++; @@ -245,42 +245,45 @@ void DRW_stats_draw(const rcti *rect) draw_stat_5row(rect, u++, v, engine->idname, sizeof(engine->idname)); init_tot_time += data->init_time; - sprintf(time_to_txt, "%.2fms", data->init_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", data->init_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); background_tot_time += data->background_time; - sprintf(time_to_txt, "%.2fms", data->background_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", data->background_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); render_tot_time += data->render_time; - sprintf(time_to_txt, "%.2fms", data->render_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", data->render_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); tot_time += data->init_time + data->background_time + data->render_time; - sprintf(time_to_txt, "%.2fms", data->init_time + data->background_time + data->render_time); + BLI_snprintf(time_to_txt, + sizeof(time_to_txt), + "%.2fms", + data->init_time + data->background_time + data->render_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); v++; } /* Totals row */ u = 0; - sprintf(col_label, "Sub Total"); + BLI_snprintf(col_label, sizeof(col_label), "Sub Total"); draw_stat_5row(rect, u++, v, col_label, sizeof(col_label)); - sprintf(time_to_txt, "%.2fms", init_tot_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", init_tot_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); - sprintf(time_to_txt, "%.2fms", background_tot_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", background_tot_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); - sprintf(time_to_txt, "%.2fms", render_tot_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", render_tot_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); - sprintf(time_to_txt, "%.2fms", tot_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", tot_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); v += 2; u = 0; double *cache_time = DRW_view_data_cache_time_get(DST.view_data_active); - sprintf(col_label, "Cache Time"); + BLI_snprintf(col_label, sizeof(col_label), "Cache Time"); draw_stat_5row(rect, u++, v, col_label, sizeof(col_label)); - sprintf(time_to_txt, "%.2fms", *cache_time); + BLI_snprintf(time_to_txt, sizeof(time_to_txt), "%.2fms", *cache_time); draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt)); v += 2; @@ -292,17 +295,18 @@ void DRW_stats_draw(const rcti *rect) uint tex_mem = GPU_texture_memory_usage_get(); uint vbo_mem = GPU_vertbuf_get_memory_usage(); - sprintf(stat_string, "GPU Memory"); + BLI_snprintf(stat_string, sizeof(stat_string), "GPU Memory"); draw_stat(rect, 0, v, stat_string, sizeof(stat_string)); - sprintf(stat_string, "%.2fMB", (double)(tex_mem + vbo_mem) / 1000000.0); + BLI_snprintf( + stat_string, sizeof(stat_string), "%.2fMB", (double)(tex_mem + vbo_mem) / 1000000.0); draw_stat_5row(rect, 1, v++, stat_string, sizeof(stat_string)); - sprintf(stat_string, "Textures"); + BLI_snprintf(stat_string, sizeof(stat_string), "Textures"); draw_stat(rect, 1, v, stat_string, sizeof(stat_string)); - sprintf(stat_string, "%.2fMB", (double)tex_mem / 1000000.0); + BLI_snprintf(stat_string, sizeof(stat_string), "%.2fMB", (double)tex_mem / 1000000.0); draw_stat_5row(rect, 1, v++, stat_string, sizeof(stat_string)); - sprintf(stat_string, "Meshes"); + BLI_snprintf(stat_string, sizeof(stat_string), "Meshes"); draw_stat(rect, 1, v, stat_string, sizeof(stat_string)); - sprintf(stat_string, "%.2fMB", (double)vbo_mem / 1000000.0); + BLI_snprintf(stat_string, sizeof(stat_string), "%.2fMB", (double)vbo_mem / 1000000.0); draw_stat_5row(rect, 1, v++, stat_string, sizeof(stat_string)); v += 1; |