In my App I do a large number of 2d image operations (composites, blurs etc) on textures. The output of one operation is usually the input for the next. I’ve recently added support for FBOs and I get good performance. Now, there are quite a few different methods to use FBOs to get the same result. I’m wondering what the ‘optimal’ method is.
For example, I could have one FBO for every texture, attach the texture to it’s FBO and then render like this:
I’ve found that this is slow. So instead I do this (which is fast):
So the question is, is there a happy medium between the two of these that I should be striving for? Should I have 1 FBO for 8 bit texture renders, 1 for 16 etc. Or should I have an FBO for each different texture size? Does anyone know what the perferred method the drivers want us to use FBOs?
Also due to the way the code is set up I am usually forced to bindFBO(0) after each render and then bindFBO(1) before the next render (i.e redundant state change). Is this state change expensive enough that I should work to avoid is as much as possible?
I tend to do 20-40 2D passes per frame.