Bug 35257 - r300_fragprog_emit.c::emit_alu(): Too many ALU instructions
Summary: r300_fragprog_emit.c::emit_alu(): Too many ALU instructions
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r300 (show other bugs)
Version: 7.10
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-12 11:24 UTC by Ionut Biru
Modified: 2011-03-14 21:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
xorg log (65.40 KB, text/plain)
2011-03-12 11:24 UTC, Ionut Biru
Details
preview of the bug (301.85 KB, image/png)
2011-03-12 11:25 UTC, Ionut Biru
Details
log generated using RADEON_DEBUG=fp when using gnome-shell (182.78 KB, text/plain)
2011-03-12 11:49 UTC, Ionut Biru
Details
The shader in question before and after our suggestions (1.79 KB, text/plain)
2011-03-14 17:29 UTC, Tom Stellard
Details

Description Ionut Biru 2011-03-12 11:24:31 UTC
Created attachment 44402 [details]
xorg log

when using gnome shell 2.91.91, clicking on Applications, in the location where the icons should be listed,i have a big black square. Clicking on the other categories the icons are show normally, only the All category has this problem

.xsession-errors has


r300 FP: Compiler Error:
r300_fragprog_emit.c::emit_alu(): Too many ALU instructions
Using a dummy shader instead.


mesa 7.10.1
clutter 1.6.8
Comment 1 Ionut Biru 2011-03-12 11:25:17 UTC
Created attachment 44403 [details]
preview of the bug
Comment 2 Tom Stellard 2011-03-12 11:49:08 UTC
Can you set the environment variable RADEON_DEBUG=fp and post the .xsession-errors file?
Comment 3 Ionut Biru 2011-03-12 11:49:50 UTC
Created attachment 44404 [details]
log generated using RADEON_DEBUG=fp when using gnome-shell
Comment 4 Tom Stellard 2011-03-12 12:10:48 UTC
Like Marek said, this isn't a bug it is a hardware limitation.  The only way this could work is with changes to Gnome Shell, so you should contact the Gnome Shell developers, although they might tell your hardware is unsupported.
Comment 5 Ian Romanick 2011-03-14 14:08:08 UTC
(In reply to comment #4)
> Like Marek said, this isn't a bug it is a hardware limitation.  The only way
> this could work is with changes to Gnome Shell, so you should contact the Gnome
> Shell developers, although they might tell your hardware is unsupported.

Since we know there's a lot of work still to be done in the compiler's higher level optimization passes, I always feel like this is a bit of a cop out answer.  The TGSI input is 125 instructions, and it looks like a nightmare of lowered if-statements.  There are way more CMP/SEQ/MUL sequences than any program should generate.  Unsurprisingly, the driver chokes on it.  I'm sure the i915 driver, which has limitations similar to r300, would choke even worse.

Comparing the GLSL to the generated TGSI might reveal some high-level optimization opportunities that we're missing.  It may also help us give some suggestions to the gnome-shell folks to make the shader more friendly to older hardware.  There are, after all, a lot of i915s and r300s out there.

Just for giggles, could we get the output of MESA_GLSL=dump too?  Use the same procedure as for RADEON_DEBUG=fp.
Comment 6 Ionut Biru 2011-03-14 14:14:05 UTC
@Ian (In reply to comment #5)
> (In reply to comment #4)
> > Like Marek said, this isn't a bug it is a hardware limitation.  The only way
> > this could work is with changes to Gnome Shell, so you should contact the Gnome
> > Shell developers, although they might tell your hardware is unsupported.
> 

my problem was fixed by gnome-shell developers by reducing the number of shader. http://git.gnome.org/browse/gnome-shell/commit/?id=43cf60f5636e7883bd5012e4c89ed5d57e28200c

> Since we know there's a lot of work still to be done in the compiler's higher
> level optimization passes, I always feel like this is a bit of a cop out
> answer.  The TGSI input is 125 instructions, and it looks like a nightmare of
> lowered if-statements.  There are way more CMP/SEQ/MUL sequences than any
> program should generate.  Unsurprisingly, the driver chokes on it.  I'm sure
> the i915 driver, which has limitations similar to r300, would choke even worse.
> 
> Comparing the GLSL to the generated TGSI might reveal some high-level
> optimization opportunities that we're missing.  It may also help us give some
> suggestions to the gnome-shell folks to make the shader more friendly to older
> hardware.  There are, after all, a lot of i915s and r300s out there.
> 
> Just for giggles, could we get the output of MESA_GLSL=dump too?  Use the same
> procedure as for RADEON_DEBUG=fp.

sure. i would do it
Comment 7 Tom Stellard 2011-03-14 17:28:24 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Like Marek said, this isn't a bug it is a hardware limitation.  The only way
> > this could work is with changes to Gnome Shell, so you should contact the Gnome
> > Shell developers, although they might tell your hardware is unsupported.
> 
> Since we know there's a lot of work still to be done in the compiler's higher
> level optimization passes, I always feel like this is a bit of a cop out
> answer.  The TGSI input is 125 instructions, and it looks like a nightmare of
> lowered if-statements.  There are way more CMP/SEQ/MUL sequences than any
> program should generate.  Unsurprisingly, the driver chokes on it.  I'm sure
> the i915 driver, which has limitations similar to r300, would choke even worse.
> 
> Comparing the GLSL to the generated TGSI might reveal some high-level
> optimization opportunities that we're missing.  It may also help us give some
> suggestions to the gnome-shell folks to make the shader more friendly to older
> hardware.  There are, after all, a lot of i915s and r300s out there.
> 
> Just for giggles, could we get the output of MESA_GLSL=dump too?  Use the same
> procedure as for RADEON_DEBUG=fp.

We were able to give some suggestions to the gnome shell developers to get the shader to fit.  The optimization that is missing is pre-computing of equivalent
expressions (not sure what the technical term is).  In this shader there was a
four clause conditional that was being used in two different IF statements.
I've attached the before and after versions of the shader if you're interested
Comment 8 Tom Stellard 2011-03-14 17:29:19 UTC
Created attachment 44454 [details]
The shader in question before and after our suggestions
Comment 9 Matt Turner 2011-03-14 21:26:25 UTC
(In reply to comment #7)
> We were able to give some suggestions to the gnome shell developers to get the
> shader to fit.  The optimization that is missing is pre-computing of equivalent
> expressions (not sure what the technical term is).

Common subexpression elimination.


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.