Hi,<br><br>the attached patch fixes this gl_FragCoord madness. It uses a fragment shader constant to do the transformation and the constant is set transparently with other STATE_* constants in Mesa core. The changes are quite small. Please review.<br>

<br>Best regards<br>Marek<br><br><div class="gmail_quote">On Mon, Nov 15, 2010 at 10:28 AM, Keith Whitwell <span dir="ltr">&lt;<a href="mailto:keithw@vmware.com">keithw@vmware.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;">

<div class="im">On Sun, 2010-11-14 at 20:18 -0800, Dave Airlie wrote:<br>
&gt; Eric just checked in a test into piglit that tests that the<br>
&gt; gl_FragCoord works the right way up for FBOs,<br>
&gt;<br>
&gt; Now all the gallium drivers fail this currently and fixing it creates<br>
&gt; an ugly linkage between the currently bound buffer and the fragment<br>
&gt; shader, since if you swap from an FBO to rendering to the front<br>
&gt; buffer, you need recompile the fragment shader to emit a proper wpos<br>
&gt; manipulation. Just wondering if anyone sees a nicer way to do this,<br>
&gt; than caching frag shaders with some sort of key in the state tracker,<br>
&gt; (which is pretty much what 965 has done.).<br>
<br>
</div>I guess the other possibility would be to have a couple of constants in<br>
the constant buffer which get factored into the fragcood calculation in<br>
such a way as to effect a flip based on their value, eg:<br>
<br>
   fc&#39; = fc * const[0].x + const[0].y<br>
<br>
where const[0] is either<br>
-&gt; {1, 0} for non-flipped<br>
-&gt; {-1, fb_height} for flipped<br>
<font color="#888888"><br>
Keith<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br>