Search code examples
c++openglmemorytexturesallocation

Can you get the allocated memory for a texture in OpenGL?


Assume you have successfully initialized and used a texture, is there a way to inspect how much VRAM memory it is occupying by querying OpenGL directly? perhaps a call to glIntegerv() with the correct enumerator?


Solution

  • Unextended OpenGL has no mechanism for anything dealing with quantities of memory. Not asking how much memory exists, not asking how much is being used, nothing.

    There are some extensions that do this (ATI_meminfo, NVX_gpu_memory_info, etc), but these will usually be vendor specific.