<div class="gmail_quote">On Sun, Jun 6, 2010 at 10:53 AM, Tom Stellard <span dir="ltr">&lt;<a href="mailto:tstellar@gmail.com">tstellar@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Hi,<br>
<br>
I have just published a branch with loop emulation for the r300<br>
compiler here: <a href="http://cgit.freedesktop.org/%7Etstellar/mesa/" target="_blank">http://cgit.freedesktop.org/~tstellar/mesa/</a><br>
<br>
This adds support for unrolling of loops that have a constant number of<br>
iterations (e.g. for(i=0; i&lt;10; i++) or for(i=10; i&gt;0; i--)<br>
It only handles cases where the counter is either added to or subtracted<br>
from, like the examples above, but I think this covers a majority<br>
of loops.<br>
<br>
Loops that have an unknown number of iterations are unrolled as many<br>
times as possible without going over the instruction limit for the<br>
shader program.<br></blockquote></div><br>If you&#39;re expecting e.g. ENDIF, please check whether the instruction is really there. Also, unrolling loops until the instruction limit is reached seems rather itchy, but still better than my idea of loading dummy shaders. ;)<br>

<br>I haven&#39;t reviewed the commits line by line, but generally it looks good, thanks. If it passes enough tests, I&#39;ll be happy to push it.<br><br>-Marek<br><br>PS: BTW piglit/glsl-fs-loop-const-incr passes even without loop emulation. The simplest loops seem to be unrolled by the GLSL compiler. The &quot;decr&quot; test does need the loop emulation though.<br>