Original Post
I have found serveral good pages and threads about how to manage memory on the video card (and even adapt those techniques to managing RAM), but I haven't found anyone mention how they determine how much memory to manage. Lets just say a simple slot structure, where you have slots of 512k memory. For a 32meg video card, you could allocate x number of these slots. But for a 256meg video card, you could allocate 8x of these slots. It seems like some people just always allocate x number of slots, and if the video card has room for it, then great. If it doesn't, then it will fall back to system memory itself. But that seems to be the worst idea, when all you have to do is take memory management a step further and handle swapping yourself! It would be very to easy to say, all of the slots are full on this card, delete one, and then upload the new data. Obviously with lower memory cards, more swapping would go on, but that's obvious, and it would happen transparently anyway. That way, you know exactly where everything is in memory. You could also adapt it to RAM, instead of letting the system swap things on virtual RAM, allocate enough memory that's sure to be held in RAM, and swap against the HDD yourself when the blocks start getting full. Now to my main question: to do this, I have to be able to query the size of the video card's ram. How do I do this? I'm using OpenGL. I've been able to query the system ram. Or is there a reason why I haven't heard it mentioned? Probably because it was obvious- but I still can't figure out how to query how much vram I have to work with. Thanks!