2
\$\begingroup\$

When my data (vertices, textures, et cetera) is purged from VRAM, how I can know that?

\$\endgroup\$
1
  • \$\begingroup\$ The question could refer to two different things: either if you can know when your deleted buffers get wiped (you can't), or if you can detect when the OS decides to destroy your buffers due to context switch or such (you can, but it's OS dependent). \$\endgroup\$ Sep 21 '12 at 19:33
3
\$\begingroup\$

You can't. When you destroy your OpenGL resources (textures, VBO, etc) you are telling the graphics card that you don't need that resource anymore and it can do whatever it wants with the space they used; now, the driver can instantly delete them, mark them for purging or just mark the space as available for use. This implementation is transparent to the user and you can't know when or what happens.

\$\endgroup\$
1
\$\begingroup\$

Data in your VRAM won't get erased unless you explicitly call the glDelete* function. Therefore, OpenGL does not contain such notifications.

If you for some reason need such notifications, you'll need to wrap all glDelete* functions in your code into functions that call a notification routine.

\$\endgroup\$
1
  • \$\begingroup\$ -1 wrong answer. Calling glDelete* doesn't mean that the VRAM will be cleared, it just deletes the OGL object reference. It's up to the driver to clear that data or leave it as-is. \$\endgroup\$
    – r2d2rigo
    Sep 30 '11 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.