Add some gpu memory info output where possible.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3259 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2010-03-26 17:49:08 +00:00
parent f0b8a7e9e1
commit f14c5628b8
2 changed files with 29 additions and 1 deletions

View File

@ -626,6 +626,31 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
}
MaxTextureUnits = core::min_(MaxTextureUnits,static_cast<u8>(MATERIAL_MAX_TEXTURES));
#ifdef _DEBUG
if (FeatureAvailable[IRR_NVX_gpu_memory_info])
{
// undocumented flags, so use the RAW values
GLint val;
glGetIntegerv(0x9047, &val);
os::Printer::log("Dedicated video memory (kB)", core::stringc(val));
glGetIntegerv(0x9048, &val);
os::Printer::log("Total video memory (kB)", core::stringc(val));
glGetIntegerv(0x9049, &val);
os::Printer::log("Available video memory (kB)", core::stringc(val));
}
#ifdef GL_ATI_meminfo
if (FeatureAvailable[IRR_ATI_meminfo])
{
GLint val[4];
glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, val);
os::Printer::log("Free texture memory (kB)", core::stringc(val[0]));
glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, val);
os::Printer::log("Free VBO memory (kB)", core::stringc(val[0]));
glGetIntegerv(GL_RENDERBUFFER_FREE_MEMORY_ATI, val);
os::Printer::log("Free render buffer memory (kB)", core::stringc(val[0]));
}
#endif
#endif
}
bool COpenGLExtensionHandler::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const

View File

@ -433,7 +433,9 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_SUN_vertex",
"GL_SUNX_constant_data",
"GL_WIN_phong_shading",
"GL_WIN_specular_fog"
"GL_WIN_specular_fog",
// unofficial stuff
"GL_NVX_gpu_memory_info"
};
@ -800,6 +802,7 @@ class COpenGLExtensionHandler
IRR_SUNX_constant_data,
IRR_WIN_phong_shading,
IRR_WIN_specular_fog,
IRR_NVX_gpu_memory_info,
IRR_OpenGL_Feature_Count
};