Add missing cases for viewport transform. Remove INVALIDATE_STORED_VERTICS

macro
This commit is contained in:
Keith Whitwell 2001-03-05 16:41:47 +00:00
parent a11c0bcf97
commit 3c646597cf
2 changed files with 25 additions and 14 deletions

View File

@ -74,11 +74,18 @@ void TAG(translate_vertex)(GLcontext *ctx,
UNVIEWPORT_VARS;
if (format == TINY_VERTEX_FORMAT) {
dst->win[0] = s[0] * src->v.x + s[12];
dst->win[1] = s[5] * src->v.y + s[13];
dst->win[2] = s[10] * src->v.z + s[14];
dst->win[3] = 1.0;
if (HAVE_HW_VIEWPORT) {
dst->win[0] = s[0] * src->v.x + s[12];
dst->win[1] = s[5] * src->v.y + s[13];
dst->win[2] = s[10] * src->v.z + s[14];
dst->win[3] = 1.0;
} else {
dst->win[0] = UNVIEWPORT_X( src->v.x );
dst->win[1] = UNVIEWPORT_Y( src->v.y );
dst->win[2] = UNVIEWPORT_Z( src->v.z );
dst->win[3] = 1.0;
}
dst->color[0] = src->tv.color.red;
dst->color[1] = src->tv.color.green;
dst->color[2] = src->tv.color.blue;
@ -88,10 +95,17 @@ void TAG(translate_vertex)(GLcontext *ctx,
GLfloat oow = (HAVE_HW_DIVIDE) ? 1.0 / src->v.w : src->v.w;
if (HAVE_HW_VIEWPORT) {
dst->win[0] = s[0] * src->v.x * oow + s[12];
dst->win[1] = s[5] * src->v.y * oow + s[13];
dst->win[2] = s[10] * src->v.z * oow + s[14];
dst->win[3] = oow;
if (HAVE_HW_DIVIDE) {
dst->win[0] = s[0] * src->v.x * oow + s[12];
dst->win[1] = s[5] * src->v.y * oow + s[13];
dst->win[2] = s[10] * src->v.z * oow + s[14];
dst->win[3] = oow;
} else {
dst->win[0] = s[0] * src->v.x + s[12];
dst->win[1] = s[5] * src->v.y + s[13];
dst->win[2] = s[10] * src->v.z + s[14];
dst->win[3] = oow;
}
} else {
dst->win[0] = UNVIEWPORT_X( src->v.x );
dst->win[1] = UNVIEWPORT_Y( src->v.y );
@ -111,7 +125,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
dst->fog = src->v.color.alpha/255.0;
if (HAVE_PTEX_VERTICES &&
((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) ||
((HAVE_TEX2_VERTICES && fbormat == PROJ_TEX3_VERTEX_FORMAT) ||
(format == PROJ_TEX1_VERTEX_FORMAT))) {
dst->texcoord[0][0] = src->pv.u0;

View File

@ -103,6 +103,7 @@
#error "can't cope with this combination"
#endif
#if (HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICES)
static void TAG(emit)( GLcontext *ctx,
@ -373,10 +374,6 @@ static void TAG(emit)( GLcontext *ctx,
}
}
}
if (DO_PTEX && !HAVE_PTEX_VERTICES) {
INVALIDATE_STORED_VERTICES();
}
}
#else
#if DO_XYZW