This is mostly the same as the previous version.
On Wednesday 27 April 2011 01:16:27 Henri Verbeet wrote:
This is mostly the same as the previous version.
I'll add my 2 cents and one crappy patch to this discussion. It is fairly similar to Adam's patch, but attempts to avoid redundant FBO work at a higher level.
The patch is pretty quick and dirty, a few things need improvement:
*) Integrate clears better. We can avoid redundant application in the clears itself, and reapplication after clearing the currently bound render target *) Marking the FBO dirty in context_bind_fbo is ugly. This should be done by the caller(s), mainly the blitting functions. I'm also not sure about context_apply_fbo_state_blit *) There are probably more places where the FBO has to be marked dirty, especially various surface operations *) There are some rendering bugs. Specifically, the flashlight in HL2 flickers when multicore rendering is enabled. This may be unrelated to the patch, but I don't think it is caused by the occlusion query problem.
The patch has some debug code that prints out the number of FBO applications and the number of draws where nothing was done. In my testing the FBO is dirty between 2% and 10% of all draws, depending on the game. This is higher than expected, but I don't know yet if that's because apps change the render targets that often or because of clears.
Anyway, Some performance results: game old new cubetest 101.06 114.21 TF2 78.79 79.21 hl2 145.24 146.87 nfs:shift main menu 16.83 17.07 tmnations 48.0 48.8
cubetest is my own draw overhead tester. For comparison, Windows 7 runs this app at 730 fps. It doesn't use offscreen rendering. The other apps use offscreen to some extent, in tmnations the FBO is dirty 2% of the time, in HL2 and TF2 around 8%. NFS:Shift does a lot of blitting in the main menu and at the moment falls back to software blitting, so this result is fairly uninteresting.