<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:imirkin@alum.mit.edu" title="Ilia Mirkin <imirkin@alum.mit.edu>"> <span class="fn">Ilia Mirkin</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - triangle clipping causes wrong interpolation of non-perspective corrected attributes"
href="https://bugs.freedesktop.org/show_bug.cgi?id=98851">bug 98851</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Summary</td>
<td>triangle clipping causes wrong ... something
</td>
<td>triangle clipping causes wrong interpolation of non-perspective corrected attributes
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - triangle clipping causes wrong interpolation of non-perspective corrected attributes"
href="https://bugs.freedesktop.org/show_bug.cgi?id=98851#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - triangle clipping causes wrong interpolation of non-perspective corrected attributes"
href="https://bugs.freedesktop.org/show_bug.cgi?id=98851">bug 98851</a>
from <span class="vcard"><a class="email" href="mailto:imirkin@alum.mit.edu" title="Ilia Mirkin <imirkin@alum.mit.edu>"> <span class="fn">Ilia Mirkin</span></a>
</span></b>
<pre>Ah yeah, looks like that's exactly what's going on -
src/gallium/auxiliary/draw/draw_pipe_clip.c:interp has the following logic:
/**
* Compute the t in screen-space instead of 3d space to use
* for noperspective interpolation.
*
* The points can be aligned with the X axis, so in that case try
* the Y. When both points are at the same screen position, we can
* pick whatever value (the interpolated point won't be in front
* anyway), so just use the 3d t.
*/
if (clip->num_linear_attribs) {
int k;
t_nopersp = t;
/* find either in.x != out.x or in.y != out.y */
for (k = 0; k < 2; k++) {
if (in->clip_pos[k] != out->clip_pos[k]) {
/* do divide by W, then compute linear interpolation factor */
float in_coord = in->clip_pos[k] / in->clip_pos[3];
float out_coord = out->clip_pos[k] / out->clip_pos[3];
float dst_coord = dst->clip_pos[k] / dst->clip_pos[3];
t_nopersp = (dst_coord - out_coord) / (in_coord - out_coord);
break;
}
}
for (j = 0; j < clip->num_linear_attribs; j++) {
const unsigned attr = clip->linear_attribs[j];
interp_attr(dst->data[attr], t_nopersp, in->data[attr],
out->data[attr]);
}
}
swr needs to grow a linear-interpolated attribute mask and incorporate the
above logic for those.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>