Skip to content

Commit

Permalink
[OpenGL] Use GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Nov 1, 2023
1 parent 4e6d0fc commit ba48a45
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/ivis_opengl/gfx_api_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2725,10 +2725,10 @@ uint64_t gl_context::get_estimated_vram_mb()
{
if (GLAD_GL_NVX_gpu_memory_info)
{
// If GL_NVX_gpu_memory_info is available, get the total graphics memory
// If GL_NVX_gpu_memory_info is available, get the total dedicated graphics memory
GLint total_graphics_mem_kb = 0;
glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: %d", total_graphics_mem_kb);
glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: %d", total_graphics_mem_kb);

if (total_graphics_mem_kb > 0)
{
Expand Down Expand Up @@ -3055,10 +3055,10 @@ uint32_t gl_context::getSuggestedDefaultDepthBufferResolution() const
// Use a (very simple) heuristic, that may or may not be useful - but basically try to find graphics cards that have lots of memory...
if (GLAD_GL_NVX_gpu_memory_info)
{
// If GL_NVX_gpu_memory_info is available, get the total graphics memory (in kB)
// If GL_NVX_gpu_memory_info is available, get the total dedicated graphics memory
GLint total_graphics_mem_kb = 0;
glGetIntegerv(GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX: %d", total_graphics_mem_kb);
glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &total_graphics_mem_kb);
debug(LOG_3D, "GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX: %d", total_graphics_mem_kb);

if ((total_graphics_mem_kb / 1024) >= 8192) // If >= 8 GiB graphics memory
{
Expand Down

0 comments on commit ba48a45

Please sign in to comment.