mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
draw: fix non-perspective interpolation in interp()
This fixes a regression fromab74fee5e1. When we use the clip coordinate to compute the screen-space interpolation factor, we need to first apply the divide-by-W step to the clip coordinate. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60938 Note: This is a candidate for the 9.1 branch. (cherry picked from commit5da967aff5)
This commit is contained in:
parent
9071c094e8
commit
475548f6c9
1 changed files with 8 additions and 3 deletions
|
|
@ -167,12 +167,17 @@ static void interp( const struct clip_stage *clip,
|
|||
{
|
||||
int k;
|
||||
t_nopersp = t;
|
||||
for (k = 0; k < 2; k++)
|
||||
/* find either in.x != out.x or in.y != out.y */
|
||||
for (k = 0; k < 2; k++) {
|
||||
if (in->clip[k] != out->clip[k]) {
|
||||
t_nopersp = (dst->clip[k] - out->clip[k]) /
|
||||
(in->clip[k] - out->clip[k]);
|
||||
/* do divide by W, then compute linear interpolation factor */
|
||||
float in_coord = in->clip[k] / in->clip[3];
|
||||
float out_coord = out->clip[k] / out->clip[3];
|
||||
float dst_coord = dst->clip[k] / dst->clip[3];
|
||||
t_nopersp = (dst_coord - out_coord) / (in_coord - out_coord);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Other attributes
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue