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.
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.
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.
Created attachment 105964 [details] [review]
hopeful fix to the issue
Attached patch fixes the issue for me.
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
forget about comment #4 though, even read only variables have a single assignment, I think the fix is correct after all.
(In reply to comment #3)
> Attached patch fixes the issue for me.
For me as well, thanks.
Tested-by: Michel Dänzer <email@example.com>
fix pushed to master
on Feb 26, 2017 at 07:44:22.
(provided by the Example extension).