diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-03-17 06:47:26 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-03-17 19:02:07 +0300 |
commit | dd4424821918f2e12d6e61dd265be11c669efeb0 (patch) | |
tree | 2fbd09d38f55e6a53249e59ab4be2bca022ab86b /source/blender/gpu/intern | |
parent | 9ed7093aa639f31e9ba5b146d2d88bae942ab424 (diff) |
DRW: Move cache time to GPUViewport for profiling
This enables us to average this timer over time like the others.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_viewport.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index d123368f6ff..2ad89bd1345 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -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. |