View Full Version : PBO improves performance???

09-02-2012, 07:44 AM

I have modified the PBO unpack code supplied in here (http://www.songho.ca/opengl/gl_pbo.html), to have multiple textures all connected to its individual PBO. However when I test the code with and without PBO it turns out that without PBO gives better performance.

My modifications on the code are pretty straight forwards. I only changed these three variables to arrays

GLuint pboIds[numFrames]; // IDs of PBO
GLuint textureId[numFrames]; // ID of texture
GLubyte* imageData[numFrames]; // pointer to texture buffer

and read each PBO to corresponding texture and update PBO s in a for loop. However when you switch off the usage of PBO by pressing 'space' you see the copy time is reduced.

So I wonder why the performance is poor with PBOs. In my project I need to display multiple videos on the screen should I not use PBOs?

My XCode project is in
https://docs.google.com/open?id=0BwYp7k9vQEPrQWJRSVZLSXpaaE0 (https://docs.google.com/open?id=0BwYp7k9vQEPrcFdrS1ROTm5KVEU)

AmI missing some thing.


Bruce Wheaton
09-08-2012, 11:45 AM
Generally what people miss with PBOs is that they free up the CPU to do extra work. If you don't do any extra work, then you won't get the benefit - you're just using a different transfer mechanism.

There's also some pixel format requirements to look at. If you don't have a pixel format that can be transferred without CPU help, you won't get asynchronous transfers either.


Alfonse Reinheart
09-08-2012, 11:54 AM
Note: see the OpenGL Wiki article on the subject (http://www.opengl.org/wiki/Pixel_Buffer_Object) for further details.