Bug 97340 - [radeonsi] POSTAL 2 freezes during shader compilation
Summary: [radeonsi] POSTAL 2 freezes during shader compilation
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Timothy Arceri
QA Contact: Default DRI bug account
Depends on:
Blocks: 77449
  Show dependency treegraph
Reported: 2016-08-14 09:52 UTC by Declan Hoare
Modified: 2017-03-15 13:53 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

GALLIUM_HUD graphs for the scene (507.74 KB, image/jpeg)
2016-08-20 02:20 UTC, Daniel Scharrer

Description Declan Hoare 2016-08-14 09:52:50 UTC
I have a Radeon R7 370 and running Mesa 12.0.1, I get horrible performance in certain areas or events of POSTAL 2, to the point where the game is almost unplayable. 

This issue is easiest to reproduce on the level with the bank. Approaching the bank causes the framerate to get lower and lower, and entering it causes the game to immediately freeze for several seconds. If you rob the bank, the resulting firefight will cause the game to freeze repeatedly.

Using the exact same hardware, I've played the game using fglrx with much better performance. Help would be much appreciated.
Comment 1 Daniel Scharrer 2016-08-20 02:20:45 UTC
Created attachment 125916 [details]
GALLIUM_HUD graphs for the scene

I can reproduce this on VI.

According to GALLIUM_HUD, the frame drops correspond to shader compilations. apitrace profiling shows the slowest calls are glDrawRangeElements, many of which take over 80ms (!). The calls don't use any user shaders so the compilations must be for internal shaders generated by Mesa to implement fixed-function functionality.

 http://constexpr.org/tmp/POSTAL2-radeonsi.2.trace.xz (73 MiB)

Not sure if there is a good way to fix this (besides making the shader compiler faster). Maybe there could be a lighting super-shader that can be used while more optimized variants are compiled.

Kernel: 4.7.0-gentoo
Mesa: git-a73116e
LLVM: r278309
GPU: R9 380X
CPU: FX 8350
Comment 2 Declan Hoare 2016-08-26 23:58:05 UTC
It seems that this situation has been improved somewhat on Mesa Git in the last 12 hours. The freezes are still there, but they're shorter and less frequent.
Comment 3 Samuel Pitoiset 2017-03-15 13:53:53 UTC
Closing. The shader cache definitely improves the situation here.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.