[Mesa-dev] RFC: r300 compiler loop emulation

Tom Stellard tstellar at gmail.com
Sun Jun 6 01:53:08 PDT 2010


Hi,

I have just published a branch with loop emulation for the r300
compiler here: http://cgit.freedesktop.org/~tstellar/mesa/ 

This adds support for unrolling of loops that have a constant number of
iterations (e.g. for(i=0; i<10; i++) or for(i=10; i>0; i--)
It only handles cases where the counter is either added to or subtracted
from, like the examples above, but I think this covers a majority
of loops.

Loops that have an unknown number of iterations are unrolled as many
times as possible without going over the instruction limit for the
shader program.

Right now, this is only enabled for fragment shaders, but I am working on
enabling it for vertex shaders.

Any comments/suggestions would be appreciated.  Thanks.

-Tom


More information about the mesa-dev mailing list