mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
GL meminfo for NV.
This commit is contained in:
parent
b1c4c4bbb0
commit
2833ff1c14
2 changed files with 40 additions and 18 deletions
|
@ -2512,11 +2512,13 @@ namespace bgfx
|
|||
if (s_extension[Extension::ATI_meminfo].m_supported)
|
||||
{
|
||||
GLint vboFree[4];
|
||||
GL_CHECK(glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, vboFree) );
|
||||
|
||||
GLint texFree[4];
|
||||
GL_CHECK(glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, texFree) );
|
||||
|
||||
GLint rbfFree[4];
|
||||
glGetIntegerv(GL_VBO_FREE_MEMORY_ATI, vboFree);
|
||||
glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, texFree);
|
||||
glGetIntegerv(GL_RENDERBUFFER_FREE_MEMORY_ATI, rbfFree);
|
||||
GL_CHECK(glGetIntegerv(GL_RENDERBUFFER_FREE_MEMORY_ATI, rbfFree) );
|
||||
|
||||
pos++;
|
||||
tvm.printf(10, pos++, 0x8c, " -------------| free| free b| aux| aux fb");
|
||||
|
@ -2526,6 +2528,26 @@ namespace bgfx
|
|||
}
|
||||
else if (s_extension[Extension::NVX_gpu_memory_info].m_supported)
|
||||
{
|
||||
GLint dedicated;
|
||||
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &dedicated) );
|
||||
|
||||
GLint totalAvail;
|
||||
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &totalAvail) );
|
||||
|
||||
GLint currAvail;
|
||||
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, &currAvail) );
|
||||
|
||||
GLint evictedCount;
|
||||
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX, &evictedCount) );
|
||||
|
||||
GLint evictedMemory;
|
||||
GL_CHECK(glGetIntegerv(GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX, &evictedMemory) );
|
||||
|
||||
pos++;
|
||||
tvm.printf(10, pos++, 0x8c, "----------|");
|
||||
tvm.printf(10, pos++, 0x8e, " Dedicated: %7d", dedicated);
|
||||
tvm.printf(10, pos++, 0x8e, " Available: %7d (%7d)", currAvail, totalAvail);
|
||||
tvm.printf(10, pos++, 0x8e, " Eviction: %7d / %7d", evictedCount, evictedMemory);
|
||||
}
|
||||
#endif // BGFX_CONFIG_RENDERER_OPENGL
|
||||
|
||||
|
|
|
@ -58,25 +58,25 @@
|
|||
# include <gl/glext.h>
|
||||
|
||||
// http://developer.download.nvidia.com/opengl/specs/GL_NVX_gpu_memory_info.txt
|
||||
# ifndef GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
|
||||
# define GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
|
||||
# endif // GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
|
||||
# ifndef GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
|
||||
# define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
|
||||
# endif // GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
|
||||
|
||||
# ifndef GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX
|
||||
# define GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
|
||||
# endif // GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX
|
||||
# ifndef GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX
|
||||
# define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
|
||||
# endif // GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX
|
||||
|
||||
# ifndef GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
|
||||
# define GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
|
||||
# endif // GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
|
||||
# ifndef GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
|
||||
# define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
|
||||
# endif // GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
|
||||
|
||||
# ifndef GPU_MEMORY_INFO_EVICTION_COUNT_NVX
|
||||
# define GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
|
||||
# endif // GPU_MEMORY_INFO_EVICTION_COUNT_NVX
|
||||
# ifndef GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX
|
||||
# define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
|
||||
# endif // GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX
|
||||
|
||||
# ifndef GPU_MEMORY_INFO_EVICTED_MEMORY_NVX
|
||||
# define GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
|
||||
# endif // GPU_MEMORY_INFO_EVICTED_MEMORY_NVX
|
||||
# ifndef GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX
|
||||
# define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
|
||||
# endif // GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX
|
||||
|
||||
#elif BGFX_CONFIG_RENDERER_OPENGLES2
|
||||
# include <GLES2/gl2.h>
|
||||
|
|
Loading…
Reference in a new issue