Mesa-3D icon indicating copy to clipboard operation
Mesa-3D copied to clipboard

[R600] Far Cry 2: Benchmark fps drop

Open siro20 opened this issue 8 years ago • 4 comments

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.

siro20 avatar Jul 09 '16 08:07 siro20

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.

iiv3 avatar Jul 09 '16 09:07 iiv3

I've uploaded a trace to FTP that shows the issue

siro20 avatar Aug 13 '16 07:08 siro20

Doesn't happen on nouveau. Seems to be a R600 problem.

siro20 avatar Aug 27 '16 14:08 siro20

Could it be related to #288 ? I'll do a benchmark with latest mesa on r600 and radeonsi.

siro20 avatar Mar 20 '18 21:03 siro20