Bug 82537 - Stunt Rally GLSL compiler assertion failure
Summary: Stunt Rally GLSL compiler assertion failure
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Tapani Pälli
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-13 00:52 UTC by Michel Dänzer
Modified: 2014-09-11 07:12 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Output of MESA_GLSL=dump stuntrally (108.19 KB, text/plain)
2014-08-13 00:52 UTC, Michel Dänzer
Details
workaround for the problem (551 bytes, patch)
2014-08-18 08:28 UTC, Tapani Pälli
Details | Splinter Review
hopeful fix to the issue (1.33 KB, patch)
2014-09-09 10:34 UTC, Tapani Pälli
Details | Splinter Review

Description Michel Dänzer 2014-08-13 00:52:42 UTC
Created attachment 104538 [details]
Output of MESA_GLSL=dump stuntrally

Stunt Rally fails to start up on the radeonsi driver with this assertion failure:

stuntrally: ../../../src/glsl/loop_analysis.h:222: bool loop_variable::is_loop_constant() const: Assertion `!this->var->data.read_only || (this->var->data.read_only && is_const)' failed.

I'm attaching the MESA_GLSL=dump output.

This doesn't seem to happen with Mesa 10.2.4.
Comment 1 Tapani Pälli 2014-08-18 08:12:14 UTC
I took a brief look. Assertion happens because bool 'rhs_clean' is not true for a particular variable but num_assignments is 1, it looks like 'rhs_clean' cannot be true because it would only get set after the call to is_loop_constant() (variable causing the trouble is named "C" in the dump). If I skip 'rhs_clean' check game gets started (it has other issues though). Will try to understand a bit more if this is problem with loop analysis or not.
Comment 2 Tapani Pälli 2014-08-18 08:28:16 UTC
Created attachment 104804 [details] [review]
workaround for the problem

Attached patch loosens the requirements for determining if variable is a constant in 'is_loop_constant'. This hopefully explains better what I meant in my previous comment.
Comment 3 Tapani Pälli 2014-09-09 10:34:45 UTC
Created attachment 105964 [details] [review]
hopeful fix to the issue

Attached patch fixes the issue for me.
Comment 4 Tapani Pälli 2014-09-09 11:17:21 UTC
but yep, the fix might be actually a workaround to a bug happening elsewhere (as there seems to be a assignment to read only variable), I will continue hunting this
Comment 5 Tapani Pälli 2014-09-09 11:48:53 UTC
forget about comment #4 though, even read only variables have a single assignment, I think the fix is correct after all.
Comment 6 Michel Dänzer 2014-09-10 02:38:13 UTC
(In reply to comment #3)
> Attached patch fixes the issue for me.

For me as well, thanks.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Comment 7 Tapani Pälli 2014-09-11 07:12:36 UTC
fix pushed to master


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.