diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-09-15 16:04:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-09-15 16:56:47 +0300 |
commit | 1af547a22399d2d98034fdbce31846e00574ca97 (patch) | |
tree | e83c1bf24c5845703af4dfe5f75595c51a164d75 | |
parent | 42c17cb7695422fc58ec20676b5199eeb9705bf1 (diff) |
OpenGL render: Add developer option to easily enable time information
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index b6be68ce4d1..6133870847b 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -74,9 +74,15 @@ #include "GPU_compositing.h" #include "GPU_framebuffer.h" - #include "render_intern.h" +/* Define this to get timing information. */ +// #undef DEBUG_TIME + +#ifdef DEBUG_TIME +# include "PIL_time.h" +#endif + typedef struct OGLRender { Main *bmain; Render *re; @@ -123,6 +129,10 @@ typedef struct OGLRender { wmTimer *timer; /* use to check if running modal or not (invoke'd or exec'd)*/ void **movie_ctx_arr; + +#ifdef DEBUG_TIME + double time_start; +#endif } OGLRender; /* added because v3d is not always valid */ @@ -698,6 +708,10 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->mh = NULL; oglrender->movie_ctx_arr = NULL; +#ifdef DEBUG_TIME + oglrender->time_start = PIL_check_seconds_timer(); +#endif + return true; } @@ -707,6 +721,10 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender) Scene *scene = oglrender->scene; int i; +#ifdef DEBUG_TIME + printf("Total render time: %f\n", PIL_check_seconds_timer() - oglrender->time_start); +#endif + if (oglrender->mh) { if (BKE_imtype_is_movie(scene->r.im_format.imtype)) { for (i = 0; i < oglrender->totvideos; i++) { |