PDA

View Full Version : PBO Texture update double vram needed?



Ingrater
04-17-2008, 02:06 AM
If I'm updating a tetxure with an pbo will then the double texture size in vram be neccessary for the update? If not what exactly does the update process then?

songho
04-17-2008, 12:30 PM
In conventional way, the texture source is loaded into the system memory first, before copying it to the texture object in VRAM.
http://songho.ca/opengl/files/gl_pbo02.png
By using PBO, you can load the texture source into a PBO directly. The difference is this PBO is OpenGL managed memory, not by CPU.
(Compare this diagram with the previous.)
http://www.songho.ca/opengl/files/gl_pbo03.png
In order to access PBO from your client application, OpenGL provides a memory mapping mechanism, glMapBuffer()/glUnmapBuffer().

Ingrater
04-17-2008, 12:38 PM
That's a good explanation but I still don't know if the double texture space is needed in vram ^^

akaTONE
04-19-2008, 06:22 AM
Depending upon your usage model, the driver will decided whether it belongs in VRAM or system memory. STATIC_DRAW is a pretty good indicator that things belong in VRAM. Everything else is a toss up as to whether it gets put in VRAM or system memory. So, IF the PBO does get put into VRAM, then it uses up that VRAM at least for the duration of your TexSubImage call and you end up with double VRAM usage.