DRW: Move cache time to GPUViewport for profiling
This enables us to average this timer over time like the others.
This commit is contained in:
@@ -1143,7 +1143,11 @@ void DRW_draw_render_loop_ex(
|
||||
drw_engines_cache_finish();
|
||||
|
||||
DRW_render_instance_buffer_finish();
|
||||
PROFILE_END_ACCUM(DST.cache_time, stime);
|
||||
|
||||
#ifdef USE_PROFILE
|
||||
double *cache_time = GPU_viewport_cache_time_get(DST.viewport);
|
||||
PROFILE_END_UPDATE(*cache_time, stime);
|
||||
#endif
|
||||
}
|
||||
|
||||
DRW_stats_begin();
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#ifdef USE_PROFILE
|
||||
# include "PIL_time.h"
|
||||
|
||||
# define PROFILE_TIMER_FALLOFF 0.1
|
||||
# define PROFILE_TIMER_FALLOFF 0.04
|
||||
|
||||
# define PROFILE_START(time_start) \
|
||||
double time_start = PIL_check_seconds_timer();
|
||||
@@ -304,9 +304,6 @@ typedef struct DRWManager {
|
||||
|
||||
bool buffer_finish_called; /* Avoid bad usage of DRW_render_instance_buffer_finish */
|
||||
|
||||
/* Profiling */
|
||||
double cache_time;
|
||||
|
||||
/* View dependant uniforms. */
|
||||
DRWMatrixState original_mat; /* Original rv3d matrices. */
|
||||
int override_mat; /* Bitflag of which matrices are overriden. */
|
||||
|
||||
@@ -286,9 +286,10 @@ void DRW_stats_draw(rcti *rect)
|
||||
v += 2;
|
||||
|
||||
u = 0;
|
||||
double *cache_time = GPU_viewport_cache_time_get(DST.viewport);
|
||||
sprintf(col_label, "Cache Time");
|
||||
draw_stat_5row(rect, u++, v, col_label, sizeof(col_label));
|
||||
sprintf(time_to_txt, "%.2fms", DST.cache_time);
|
||||
sprintf(time_to_txt, "%.2fms", *cache_time);
|
||||
draw_stat_5row(rect, u++, v, time_to_txt, sizeof(time_to_txt));
|
||||
v += 2;
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ typedef struct ViewportEngineData {
|
||||
|
||||
/* Profiling data */
|
||||
double init_time;
|
||||
double cache_time;
|
||||
double render_time;
|
||||
double background_time;
|
||||
} ViewportEngineData;
|
||||
@@ -114,6 +113,9 @@ void *GPU_viewport_texture_list_get(GPUViewport *viewport);
|
||||
void GPU_viewport_size_get(const GPUViewport *viewport, int size[2]);
|
||||
void GPU_viewport_size_set(GPUViewport *viewport, const int size[2]);
|
||||
|
||||
/* Profiling */
|
||||
double *GPU_viewport_cache_time_get(GPUViewport *viewport);
|
||||
|
||||
void GPU_viewport_tag_update(GPUViewport *viewport);
|
||||
bool GPU_viewport_do_update(GPUViewport *viewport);
|
||||
|
||||
|
||||
@@ -87,6 +87,9 @@ struct GPUViewport {
|
||||
struct DRWInstanceDataList *idatalist; /* Used for rendering data structure. */
|
||||
|
||||
ListBase tex_pool; /* ViewportTempTexture list : Temporary textures shared across draw engines */
|
||||
|
||||
/* Profiling data */
|
||||
double cache_time;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -275,6 +278,11 @@ void GPU_viewport_size_set(GPUViewport *viewport, const int size[2])
|
||||
viewport->size[1] = size[1];
|
||||
}
|
||||
|
||||
double *GPU_viewport_cache_time_get(GPUViewport *viewport)
|
||||
{
|
||||
return &viewport->cache_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to find a texture coresponding to params into the texture pool.
|
||||
* If no texture was found, create one and add it to the pool.
|
||||
|
||||
Reference in New Issue
Block a user