On 2 July 2012 13:45, Vadim Girlin <span dir="ltr"><<a href="mailto:vadimgirlin@gmail.com" target="_blank">vadimgirlin@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Mon, 2012-07-02 at 10:08 -0700, Paul Berry wrote:<br>
> On 2 July 2012 08:04, Vadim Girlin <<a href="mailto:vadimgirlin@gmail.com">vadimgirlin@gmail.com</a>> wrote:<br>
>         On Sun, 2012-06-24 at 11:18 +0200, Olivier Galibert wrote:<br>
>         > That old bug was hidden but the clipper always interpolating<br>
>         in 3d<br>
>         > space no matter what it should have been doing.  Now that<br>
>         the<br>
>         > interpolation has been fixed, the bug shows up.<br>
>         ><br>
>         > Fixes bugzilla 51364.<br>
>         ><br>
>         > Signed-off-by: Olivier Galibert <<a href="mailto:galibert@pobox.com">galibert@pobox.com</a>><br>
>         ><br>
>         > diff --git a/src/mesa/state_tracker/st_program.c<br>
>         b/src/mesa/state_tracker/st_program.c<br>
>         > index e6664fb..9f98298 100644<br>
>         > --- a/src/mesa/state_tracker/st_program.c<br>
>         > +++ b/src/mesa/state_tracker/st_program.c<br>
>         > @@ -569,12 +569,12 @@ st_translate_fragment_program(struct<br>
>         st_context *st,<br>
>         >           case FRAG_ATTRIB_CLIP_DIST0:<br>
>         >              input_semantic_name[slot] =<br>
>         TGSI_SEMANTIC_CLIPDIST;<br>
>         >              input_semantic_index[slot] = 0;<br>
>         > -            interpMode[slot] = TGSI_INTERPOLATE_LINEAR;<br>
>         > +            interpMode[slot] =<br>
>         TGSI_INTERPOLATE_PERSPECTIVE;<br>
>         >              break;<br>
>         >           case FRAG_ATTRIB_CLIP_DIST1:<br>
>         >              input_semantic_name[slot] =<br>
>         TGSI_SEMANTIC_CLIPDIST;<br>
>         >              input_semantic_index[slot] = 1;<br>
>         > -            interpMode[slot] = TGSI_INTERPOLATE_LINEAR;<br>
>         > +            interpMode[slot] =<br>
>         TGSI_INTERPOLATE_PERSPECTIVE;<br>
><br>
><br>
>         At first glance this change doesn't seem correct, GLSL 1.30<br>
>         spec says<br>
>         that clip distances are interpolated linearly. Am I missing<br>
>         something?<br>
><br>
> I think when the spec says "The clip distances will be linearly<br>
> interpolated across the primitive...", they mean "linear in 3D space".<br>
> Interpolating clip distances in screen space would produce really bad<br>
> artifacts, IMHO.<br>
<br>
</div></div>Looking into it, I think you are right, sorry for the noise.<br>
<br>
Though then I have some doubts about the "fs-clip-distance-interpolated"<br>
test. AFAICS r600g in fact uses different interpolation for ClipDistance<br>
inputs with and without the patch, but the test does pass in both<br>
cases.<br></blockquote><div><br>Yeah, fs-clip-distance-interpolated only checks that the fragment shader sees properly interpolated values for gl_ClipDistance.  It doesn't check that the implementation uses the correct form of interpolation to decide where to clip the primitive.  I suspect that's the reason the test passes in both cases.  I wasn't thinking carefully enough when I wrote the test to realize that these two things ought to be tested separately.<br>
<br>If you would like to add a piglit test to cover the case I missed, I would be delighted :)<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
Vadim<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
><br>
>         Vadim<br>
><br>
>         >              break;<br>
>         >              /* In most cases, there is nothing special<br>
>         about these<br>
>         >               * inputs, so adopt a convention to use the<br>
>         generic<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>
><br>
><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>
><br>
><br>
<br>
<br>
<br>
</div></div></blockquote></div><br>