Just thought I’d comment on an earlier post.
@V-man: I don’t think the slowdown you are experiencing is due to the readback and blitting. This demo uses a 400 x 400 RGBA pbuffer. Doing the math you get 640K per frame. I cap the demo at 60 fps, so the required bandwidth is only 38.4M/s, disregarding state change overhead. This is less than 1/4 the AGP 1x theoretical bandwith.
I believe the slowdown in your case is due to fill rate. I noticed this on my GF FX 5200 (notoriously fill limited). It’s easy to miss the fill requirements because the subject is so simple; it just renders some rotating spheres. However, I naively render the spheres without any depth sorting and I don’t render ambience and z first, so I don’t take advantage of early depth rejection. I also calculate all the lighting in the fragment shader, so performance takes a hit there too (on top of using ARB FP1).
I estimate that in the worst case the demo shades around 210K fragments per frame using this metric:
Estimated coverage of the closest plane of spheres when parallel to the view plane: 50% = 400 x 400 x 0.5 = 80,000 fragments.
Estimated coverage of the middle plane when aligned parallel: front coverage - 10K = 70,000 fragments.
Estimated coverage of the farthest plane when aligned parallel: middle plane - 10K = 60,000 fragments.
Leading to a rough estimate of total coverage in the worst case: 80K + 70K + 60K = 210K fragments per frame = 12.6M fragments/s.
I think that the fp shader and fill combination is much more substancial than the meger bandwidth requirements of the blitting, even given the coarseness of my estimation. Also, the demo renders smooth when using only fixed function, even though I bump up the LOD significantly. Perhaps I should add “Use Fixed Function” as an option when fragment hardware is detected.
In the little time I’ve had to clean up the code I fixed the problem on ATI cards where the window doesn’t render on secondary displays. A two character fix, thankfully.
So hopefully I’ll have some nice source for everyone some day soon. I appreciate everyone’s comments thus far and any feedback you provide me.
Regards,
Dude