Created attachment 33968 [details] dmesg output The game Savage 2 causes an immediate GPU hang in the menu. AFAIK not a regression, and not possible to test with the 7.7 branch because of bug #21707. System environment: -- chipset: G45 / ICH10R -- system architecture: 32-bit -- Linux distribution: Debian unstable -- Machine or mobo model: Asus P5Q-EM -- Display connector: DVI -- xf86-video-intel: 318aa9ed799197810e2039dbe3ec51559dcc888c -- xserver: 1.7.5 -- mesa: 644a05c6cb3ebabc600f6d529b54c71fd2c0c84c -- drm: 04fd3872ee8bd8d5e2c27740508c67c2d51dbc11 -- kernel: 2.6.33
This game's shaders are using a ton of temporaries, and loops that aren't getting unrolled so we don't end up optimizing much at all. A workaround at the moment is to increase the loop unrolling limits at the top of src/mesa/shader/slang/slang_codegen.c (MAX_FOR_LOOP_UNROLL_BODY_SIZE = 100, MAX_FOR_LOOP_UNROLL_COMPLEXITY = 2000), which then triggers optimization and gets the program well within the hw limits. Another thing that might fix from the game's side is to clean up the inside of the loops of the fragment shaders to not rely on the compiler doing CSE and do that optimization on its own. For example, float l = length(a); vec4 v = normalize(a); ends up using temps to do the computation of 1/l twice. Also there are multiple dot(n, l) calculations which we use temps for each time. The program was just over the limits for loop unrolling, and optimizing the shaders would probably fix it. If the temporary reclaiming code that's being triggered is broken as I suspect (I haven't investigated), then we should disable it and report failure in compiling the shader. Bad, but better than hanging. I've also started a bit of work that might reduce the number of temporaries used enough to not trigger the reclaim code. But I fear I won't get this done without new compiler infrastructure, which would solve the problem anyway by allowing reasonable CSE.
With master at the moment it doesn't hang, but the character in the menu and the menu buttons are white due to a bug in the preprocessor, distilled down to 087-if-comments.c.
Created attachment 37964 [details] Screenshot I can launch the game now, but the player character seems to be drawn as random triangles.
(In reply to comment #2) > With master at the moment it doesn't hang, but the character in the menu and > the menu buttons are white due to a bug in the preprocessor, distilled down to > 087-if-comments.c. That test seems to produce correct results now. Should this bug be closed, or are we tracking multiple issues with each bug?
(In reply to comment #4) > > That test seems to produce correct results now. Should this bug be closed, or > are we tracking multiple issues with each bug? Well, the GPU no longer hangs, so the initial problem is resolved, the game however still isn't playable. Not sure how you prefer to track this?
To keep things simple, let's close this bug since the original problem (the GPU hang) has been fixed. The game isn't rendering correctly yet, so I have opended bug 30004 about this.
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.