Strange Video Memory Increase

Started by
15 comments, last by slicer4ever 11 years ago
I suspect that this may be normal behaviour rather than a driver issue. The fact that you're seeing this kind of video RAM usage at all with client arrays indicates that the geometry is being cached in video RAM. So you specify the arrays and draw, all good. Then you change the color array and now you've got two copies cached - the original (which the driver is presumably keeping around in case you need to go back to it) and the new. After a while, if you haven't gone back to the original, the driver decides to throw out it's old copy.

You may be able to control some of this behaviour with some use of GL_EXT_compiled_vertex_array, or you may be better off not using a vertex array for your constant color case (just glColor4f it instead).

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Advertisement

Thanks, I'll check out the GL_EXT_compiled _vertex_array. I get the same problem when I have varied colours

at the vertex and just change the values to say RGB ->RBG. Basically, any change to the colour array causes

the problem.

I appreciate all your comments gentlemen.

mhagain, on 28 Mar 2013 - 12:50, said:
I suspect that this may be normal behaviour rather than a driver issue. The fact that you're seeing this kind of video RAM usage at all with client arrays indicates that the geometry is being cached in video RAM. So you specify the arrays and draw, all good. Then you change the color array and now you've got two copies cached - the original (which the driver is presumably keeping around in case you need to go back to it) and the new. After a while, if you haven't gone back to the original, the driver decides to throw out it's old copy.

You may be able to control some of this behaviour with some use of GL_EXT_compiled_vertex_array, or you may be better off not using a vertex array for your constant color case (just glColor4f it instead).

Pretty much this. For the most part, the driver knows best. If your changing values in your submitted data, it's highly likely the driver is simply caching the data, without releasing the old buffer immediately.

This is not uncommon to see in windows either. In short, i'd recommend not worrying about what the driver is doing, unless it's actually causing a problem.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

Well I think it is a problem for him as he said that when he changes the value, his graphics card's memory usage shoots up from 600M to 1G and then it starts to lag. If the driver is caching the data, then he would need to find a way to remove the values he's editing from the cache.

Some favourite quotes:Never trust a computer you can't throw out a window.
- Steve Wozniak

The best way to prepare [to be a programmer] is to write programs, and to study great programs that other people have written.
- Bill Gates

There's always one more bug.
- Lubarsky's Law of Cybernetic Entomology

Think? Why think! We have computers to do that for us.
- Jean Rostand

Treat your password like your toothbrush. Don't let anybody else use it, and get a new one every six months.
- Clifford Stoll

To err is human - and to blame it on a computer is even more so.
- Robert Orben

Computing is not about computers any more. It is about living.
- Nicholas Negroponte
The problem is in the "idea" to store 600MB in a single vertex array and transfer it in each draw call. That is not the way to go. I guess the performace is terrible if the data is not cached. The driver is probably trying to save performance by caching data and that's the problem. It could be solved by making smaller buffers.
The only real way to handle this that I can think of is to use two different fragment shaders, one with the constant colour as a uniform. From the looks of the OP's sample code he's not using shaders at all, but running on prehistoric hardware shouldnt be a problem here; the kind of hardware that can handle this volume of data will always have shaders available anyway.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Well I think it is a problem for him as he said that when he changes the value, his graphics card's memory usage shoots up from 600M to 1G and then it starts to lag. If the driver is caching the data, then he would need to find a way to remove the values he's editing from the cache.

ah, i missed where he said it was lagging, my bad.
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

This topic is closed to new replies.

Advertisement