diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2010-11-17 08:28:25 +0300 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2010-11-17 08:28:25 +0300 |
commit | 1bb98b41944dadf69645cf3b99bcabd9834f9240 (patch) | |
tree | 5c700ba234517211190bf7865c0ee7a353475b94 /source/gameengine/Ketsji/KX_KetsjiEngine.cpp | |
parent | f791d74f102dcfed69a95d605e3c634f76a070ab (diff) |
Adding monitoring for (approximate) VRAM used by textures. The information is currently only used in the profiling data of the BGE.
Here is a image of it in action:
http://www.pasteall.org/pic/show.php?id=6351
What it monitors:
* VRAM used by textures created via bf_gpu and BL_Textures
What it does not monitor:
* VRAM used by the Blender ui
* VRAM used by 2d filters
* VRAM allocated by the user via KX_Scene.pre_draw and KX_Scene.pre_draw
Diffstat (limited to 'source/gameengine/Ketsji/KX_KetsjiEngine.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index a1c7957dc72..fc43c03df31 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -75,6 +75,8 @@ #include "DNA_world_types.h" #include "DNA_scene_types.h" +#include "GPU_extensions.h" + // If define: little test for Nzc: guarded drawing. If the canvas is // not valid, skip rendering this frame. //#define NZC_GUARDED_OUTPUT @@ -1439,6 +1441,18 @@ void KX_KetsjiEngine::RenderDebugProperties() m_canvas->GetHeight()); ycoord += 14; } + + // Put an extra gap in the printed results + ycoord += 14; + + /* Print texture vram usage */ + debugtxt.Format("Texture VRAM: %.2f MB", GPU_texture_vram_usage()/1048576.f); + m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED, + debugtxt.Ptr(), + xcoord, ycoord, + m_canvas->GetWidth(), + m_canvas->GetHeight()); + ycoord += 14; } /* Property display*/ |