Mem manager for vid memory in openGL

Started by
1 comment, last by NihilisticMystick 20 years ago
ok, so i need to write a video memory manager to keep track of what meshes are currently in video memory (via vertex buffer objects or something similar, i havent decided on a method jsut yet) anyway, i need to know how to get the amount of available video memory that i have to work with so that my video memory manager can select an appropriate amount for vertex buffers and then partition it off into buffers of whatever size (possibly variable size with buffer merging and all that fun stuff), and then i also need to know how much mem my vertex streams are going to take up once they get to video memory, is it the same as in system memory? are there vertex buffer object headers that i need to take into account? do they get compressed in any way? anyway, any information on this sort of thing would be much appreciated. If anyone knows where an article on writing jsut this sort of thing is, that too would be excellent, it thanks you much!
Advertisement
Short answer: not possible. You have no way of knowing the info you need to know. The best you can do is determine if a texture is currently resident through glAreTexturesResident() (or glGetTexParameter() with GL_TEXTURE_RESIDENT), but last I worked with OpenGL you had no way of knowing when your texture flushed, nor did you know anything about vertex buffer at all.

Basically, leave it to the driver, you''ll be flying somewhat blind trying to do it yourself.

------------
- outRider -
Well, I remember a while ago in some discussions i was reading on this forum invovling vertex buffer objects and other ways of speeding up the rate at which you can stream verts to the renderer one person said theyd written some sort of chunked video memory manager that had a whole set of arbitrary buffers and it could allocate a buffer to a vertex stream, up the stream to the video card, and mark that chunk as occupied. figured a similar system would be nice for keep often rendered object data in video memory for a series of frames, which i would think would give a significant speed boost in extremely large scenes which is pretty much what im going for... i dunno... i could allocate buffers until i run out of memory and count up how many i have... but that just sounds retarded. But it'd be really nice if it could be done I'd think, anyway, more suggestions would be much appreciated from anyone.

Ahh yes, it was this post that gave me the idea for the system.. actually i havent read it in a while, i don't think he was actually talking about doing all that in vid mem.. hmm... well.. still i think its a good idea http://www.gamedev.net/community/forums/topic.asp?topic_id=150200

[edited by - NihilisticMystick on April 13, 2004 2:24:02 AM]

[edited by - NihilisticMystick on April 13, 2004 2:31:51 AM]

This topic is closed to new replies.

Advertisement