From: Keith Whitwell Date: Fri, 1 Jun 2001 12:07:15 +0000 (+0000) Subject: apply David Miller's quad/backcolor patch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=741c2e6434f2c4f273c7cdecb227514bacd3cc8a;p=mesa.git apply David Miller's quad/backcolor patch --- diff --git a/src/mesa/drivers/common/t_dd_tritmp.h b/src/mesa/drivers/common/t_dd_tritmp.h index 87800929e68..ce63e0c50db 100644 --- a/src/mesa/drivers/common/t_dd_tritmp.h +++ b/src/mesa/drivers/common/t_dd_tritmp.h @@ -1,4 +1,4 @@ -/* $Id: t_dd_tritmp.h,v 1.10 2001/04/28 15:47:48 keithw Exp $ */ +/* $Id: t_dd_tritmp.h,v 1.11 2001/06/01 12:07:15 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -388,31 +388,57 @@ static void TAG(quad)( GLcontext *ctx, GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->Ptr; (void)vbcolor; - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_SAVE_RGBA( 2 ); - VERT_SET_RGBA( v[0], vbcolor[e0] ); - VERT_SET_RGBA( v[1], vbcolor[e1] ); - VERT_SET_RGBA( v[2], vbcolor[e2] ); + if (HAVE_BACK_COLORS) { + if (!DO_FLAT) { + VERT_SAVE_RGBA( 0 ); + VERT_SAVE_RGBA( 1 ); + VERT_SAVE_RGBA( 2 ); + VERT_COPY_RGBA1( v[0] ); + VERT_COPY_RGBA1( v[1] ); + VERT_COPY_RGBA1( v[2] ); + } + VERT_SAVE_RGBA( 3 ); + VERT_COPY_RGBA1( v[3] ); + if (HAVE_SPEC) { + if (!DO_FLAT) { + VERT_SAVE_SPEC( 0 ); + VERT_SAVE_SPEC( 1 ); + VERT_SAVE_SPEC( 2 ); + VERT_COPY_SPEC1( v[0] ); + VERT_COPY_SPEC1( v[1] ); + VERT_COPY_SPEC1( v[2] ); + } + VERT_SAVE_SPEC( 3 ); + VERT_COPY_SPEC1( v[3] ); + } } - VERT_SAVE_RGBA( 3 ); - VERT_SET_RGBA( v[3], vbcolor[e3] ); + else { + if (!DO_FLAT) { + VERT_SAVE_RGBA( 0 ); + VERT_SAVE_RGBA( 1 ); + VERT_SAVE_RGBA( 2 ); + VERT_SET_RGBA( v[0], vbcolor[e0] ); + VERT_SET_RGBA( v[1], vbcolor[e1] ); + VERT_SET_RGBA( v[2], vbcolor[e2] ); + } + VERT_SAVE_RGBA( 3 ); + VERT_SET_RGBA( v[3], vbcolor[e3] ); - if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { - GLchan (*vbspec)[4] = VB->SecondaryColorPtr[1]->Ptr; - ASSERT(VB->SecondaryColorPtr[1]->StrideB==4*sizeof(GLfloat)); + if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { + GLchan (*vbspec)[4] = VB->SecondaryColorPtr[1]->Ptr; + ASSERT(VB->SecondaryColorPtr[1]->StrideB==4*sizeof(GLfloat)); - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SAVE_SPEC( 2 ); - VERT_SET_SPEC( v[0], vbspec[e0] ); - VERT_SET_SPEC( v[1], vbspec[e1] ); - VERT_SET_SPEC( v[2], vbspec[e2] ); - } - VERT_SAVE_SPEC( 3 ); - VERT_SET_SPEC( v[3], vbspec[e3] ); + if (!DO_FLAT) { + VERT_SAVE_SPEC( 0 ); + VERT_SAVE_SPEC( 1 ); + VERT_SAVE_SPEC( 2 ); + VERT_SET_SPEC( v[0], vbspec[e0] ); + VERT_SET_SPEC( v[1], vbspec[e1] ); + VERT_SET_SPEC( v[2], vbspec[e2] ); + } + VERT_SAVE_SPEC( 3 ); + VERT_SET_SPEC( v[3], vbspec[e3] ); + } } } else {