PDA

View Full Version : What is faster:multiple FBO or multiple attachment



jam_mer
11-08-2010, 07:19 AM
Hi,
I'm doing GPGPU application which uses rectangular data textures. Computation runs in multiple passes and currently, I'm using only one FBO and changing attachments in each step.

Now I'm thinking whether is faster to have multiple FBO's with attachment or using only one FBO and changing attachment.
So is changing attachments faster than switching FBO's or not?

Thanks.

Dark Photon
11-08-2010, 07:26 AM
Try both and see. At least used to be on NVidia that there was a significant overhead to switching the size of the target attached to an FBO, with NVidia recommending having a separate FBO to use per size/format combo. Haven't retested that in a while though. Best to test your usage pattern on the vendor drivers you need to support.

jam_mer
11-08-2010, 07:54 AM
All my attachments I'm using have the same size internal format, so I guessed there's no need to use multiple FBO's.

But before rewriting serious amount of code I'm gonna ask again if someone has more information about this ;)

BionicBytes
11-08-2010, 11:16 AM
I have not measured for a while...but the last time I did switching between FBOs was not as efficient as switching target textures.
However, the best way to switch between attachments is using the glreadbuffer and glDrawBuffers to specify the targets rather than rebind different textures to the FBO attachment points.