Mesa-3D
Mesa-3D copied to clipboard
[R600] Far Cry 2: Benchmark fps drop
The benchmark shows a huge fps drop in some scenes when setting shadows to "Ultra High". There's no performance drop when set to "Very High" . GPU-Load goes to 100% and CPU-load drops to 10%. fps drop to about 10% of the regular fps. Reproducable on every run. The performance drop isn't visible on wine using the same card.
What is your videocard? If it is using r600 driver, then the most likely reason is missing loop unrolling.
E.g. in a game I have, when showing the map I get huge fps drop, despite scene been much simpler than the game and despite that same map shows massive fps boost in wined3d. It turned out that a single shader that implements 7x7 blur is responsible for the drop. That shader have two intertwined loops. Since the loops are control flow instructions, they execute as scalar instead of vector, making it about 64 times slower.
I used helix mod
to extract that shader and then replace it with hand edited variants. I tried less "loops" and more loops, manually unrolling one or both loops. Unrolling just the inner loop gave me massive improvement, but it was still slower than fully unrolled version.
When using opengl, loops are unrolled in the glsl parser, but Nine bypasses that. For newer cards LLVM may unroll loops, so that's less of an issue.
I've uploaded a trace to FTP that shows the issue
Doesn't happen on nouveau. Seems to be a R600 problem.
Could it be related to #288 ? I'll do a benchmark with latest mesa on r600 and radeonsi.