From dd4424821918f2e12d6e61dd265be11c669efeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 17 Mar 2018 04:47:26 +0100 Subject: DRW: Move cache time to GPUViewport for profiling This enables us to average this timer over time like the others. --- source/blender/gpu/intern/gpu_viewport.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/gpu/intern/gpu_viewport.c') 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. -- cgit v1.2.3