Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question
    
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). –  Jari Komppa Sep 21 '12 at 19:33
add comment

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
    
-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. –  r2d2rigo Sep 30 '11 at 11:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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