[Bf-blender-cvs] [b30cba57025] lineart-shadow: LineArt: Performance measurement of shadow stages.
Yiming Wu
noreply at git.blender.org
Thu Jun 2 05:17:20 CEST 2022
Commit: b30cba5702511fa9864af3ec37e92f7b5d55120c
Author: Yiming Wu
Date: Thu Jun 2 09:30:13 2022 +0800
Branches: lineart-shadow
https://developer.blender.org/rBb30cba5702511fa9864af3ec37e92f7b5d55120c
LineArt: Performance measurement of shadow stages.
===================================================================
M source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
===================================================================
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
index ea30badcc8a..936c9c80601 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c
@@ -973,6 +973,11 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph,
return false;
}
+ double t_start;
+ if (G.debug_value == 4000) {
+ t_start = PIL_check_seconds_timer();
+ }
+
bool is_persp = true;
if (lmd->light_contour_object->type == OB_LAMP) {
@@ -1096,6 +1101,13 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph,
MEM_freeN(rb);
}
+ if (G.debug_value == 4000) {
+ lineart_count_and_print_render_buffer_memory(rb);
+
+ double t_elapsed = PIL_check_seconds_timer() - t_start;
+ printf("Line art shadow stage 1 time: %f\n", t_elapsed);
+ }
+
return any_generated;
}
@@ -1117,6 +1129,11 @@ void lineart_main_transform_and_add_shadow(LineartRenderBuffer *rb,
void lineart_main_make_enclosed_shapes(LineartRenderBuffer *rb, LineartRenderBuffer *shadow_rb)
{
+ double t_start;
+ if (G.debug_value == 4000) {
+ t_start = PIL_check_seconds_timer();
+ }
+
if (shadow_rb || rb->shadow_use_silhouette) {
lineart_shadow_cast(rb, false, shadow_rb ? true : false);
if (rb->shadow_use_silhouette) {
@@ -1124,6 +1141,13 @@ void lineart_main_make_enclosed_shapes(LineartRenderBuffer *rb, LineartRenderBuf
}
}
+ if (G.debug_value == 4000) {
+ lineart_count_and_print_render_buffer_memory(rb);
+
+ double t_elapsed = PIL_check_seconds_timer() - t_start;
+ printf("Line art shadow stage 2 cast and silhouette time: %f\n", t_elapsed);
+ }
+
if (!shadow_rb) {
return;
}
@@ -1167,4 +1191,11 @@ void lineart_main_make_enclosed_shapes(LineartRenderBuffer *rb, LineartRenderBuf
lineart_main_occlusion_begin(shadow_rb);
lineart_shadow_register_enclosed_shapes(rb, shadow_rb);
+
+ if (G.debug_value == 4000) {
+ lineart_count_and_print_render_buffer_memory(rb);
+
+ double t_elapsed = PIL_check_seconds_timer() - t_start;
+ printf("Line art shadow stage 2 total time: %f\n", t_elapsed);
+ }
}
More information about the Bf-blender-cvs
mailing list