how to keep textures in video card's memory?

since when i use glTexture2D with client memory pointer, it seems it stores texture in system memory.
maybe i should use buffers to load texture into video card’s memory?

it seems it stores texture in system memory

And makes you think this is the case ?

Typically the GL driver will keep a “backup” copy of the texture in system memory, but it will also be copied to the GPU. Unless you get short on video ram, in this case the texture may be deleted from GPU to free some space. Whenever it is needed again, the driver will re-upload the texture from sys mem to vid mem automatically.

got the idea, but any way to get ‘video-ram-only’ storage?
i like memory device context in windows that allows to keep buffers in video card memory,
dunno if it does always but i was lucky to store big bitmaps without any system memory consumption.

Just be sure to delete the buffer on your application side as soon you did the glTexImage, at least this avoids a third copy.

Do you have a case for this ? Like a constrained system ram and large unused video ram ?

no constrains, i’d just like to have smaller memory consumption.
so i guess buffer objects also have system memory copies?

Yes. When you map the buffer, you application is given a pointer to the driver controlled buffer, this is interesting for regularly updating a texture:
Instead of having to keep the third copy on your side, to resupply the updated texture, you just update the driver one, which then update the gpu once you unmap it.

Explanations here :

thanx, man :slight_smile: