Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glTexImage2D can't free memory

  1. #1
    Newbie Newbie
    Join Date
    Aug 2017

    glTexImage2D can't free memory

    After I run this function:
    Code :
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, iWidth, iHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)imageData);
    My memory had increase about 2Mb and how can I free it???

    This is my solution:
    (Run as VS2015, platform tool set v140, target platform version: 8.1)
    _tmain function at NewTrainingFramework.cpp line 147, glTexImage2D function at NewTrainingFramework.cpp line 168
    Thanks you very much!!!

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    glTexImage requires to allocate memory in order to store texture data, and because of OpenGL texture completeness rules and the way the old (mutable) texture specification API works textures cannot be validated until draw time, so the driver is more likely to use system memory as temporary storage until it can validate that the texture is complete and can be loaded to the GPU.

    What you're seeing is therefore most likely normal and expected behaviour.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts