diff options
Diffstat (limited to 'xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h')
-rw-r--r-- | xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h b/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h index 16bd770bb..0fc1a64e2 100644 --- a/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h +++ b/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h @@ -1,8 +1,7 @@ -/* $Id: t_dd_vbtmp.h,v 1.1.1.1 2002/10/22 13:07:00 alanh Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0.3 + * Version: 4.1 * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * @@ -24,7 +23,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Authors: - * Keith Whitwell <keithw@valinux.com> + * Keith Whitwell <keith@tungstengraphics.com> */ @@ -125,7 +124,7 @@ static void TAG(emit)( GLcontext *ctx, { LOCALVARS struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLfloat (*tc0)[4], (*tc1)[4], *fog; + GLfloat (*tc0)[4], (*tc1)[4], (*fog)[4]; GLfloat (*tc2)[4], (*tc3)[4]; GLubyte (*col)[4], (*spec)[4]; GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride; @@ -148,8 +147,8 @@ static void TAG(emit)( GLcontext *ctx, coord_stride = VB->ClipPtr->stride; } else { - coord = VB->ProjectedClipPtr->data; - coord_stride = VB->ProjectedClipPtr->stride; + coord = VB->NdcPtr->data; + coord_stride = VB->NdcPtr->stride; } if (DO_TEX3) { @@ -210,13 +209,13 @@ static void TAG(emit)( GLcontext *ctx, fog_stride = VB->FogCoordPtr->stride; } else { - GLfloat tmp = 0; + static GLfloat tmp[4] = {0, 0, 0, 0}; fog = &tmp; fog_stride = 0; } } - if (VB->importable_data) { + if (VB->importable_data || (DO_SPEC && !spec_stride) || (DO_FOG && !fog_stride)) { /* May have nonstandard strides: */ if (start) { @@ -234,7 +233,8 @@ static void TAG(emit)( GLcontext *ctx, if (DO_SPEC) STRIDE_4UB(spec, start * spec_stride); if (DO_FOG) - STRIDE_F(fog, start * fog_stride); + /*STRIDE_F(fog, start * fog_stride);*/ + fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride); } for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) { @@ -268,8 +268,9 @@ static void TAG(emit)( GLcontext *ctx, STRIDE_4UB(spec, spec_stride); } if (DO_FOG) { - v->v.specular.alpha = fog[0] * 255.0; - STRIDE_F(fog, fog_stride); + v->v.specular.alpha = fog[0][0] * 255.0; + /*STRIDE_F(fog, fog_stride);*/ + fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride); } if (DO_TEX0) { v->v.u0 = tc0[0][0]; @@ -367,7 +368,7 @@ static void TAG(emit)( GLcontext *ctx, v->v.specular.blue = spec[i][2]; } if (DO_FOG) { - v->v.specular.alpha = fog[i] * 255.0; + v->v.specular.alpha = fog[i][0] * 255.0; } if (DO_TEX0) { v->v.u0 = tc0[i][0]; @@ -420,8 +421,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end, struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; GLubyte (*col)[4]; GLuint col_stride; - GLfloat (*coord)[4] = VB->ProjectedClipPtr->data; - GLuint coord_stride = VB->ProjectedClipPtr->stride; + GLfloat (*coord)[4] = VB->NdcPtr->data; + GLuint coord_stride = VB->NdcPtr->stride; GLfloat *v = (GLfloat *)dest; const GLubyte *mask = VB->ClipMask; const GLfloat *s = GET_VIEWPORT_MAT(); @@ -674,8 +675,8 @@ static void TAG(interp)( GLcontext *ctx, INTERP_F( t, dst->pv.v0, out->pv.v0, in->pv.v0 ); INTERP_F( t, dst->pv.q0, out->pv.q0, in->pv.q0 ); } else { - GLfloat wout = VB->ProjectedClipPtr->data[eout][3]; - GLfloat win = VB->ProjectedClipPtr->data[ein][3]; + GLfloat wout = VB->NdcPtr->data[eout][3]; + GLfloat win = VB->NdcPtr->data[ein][3]; GLfloat qout = out->pv.w / wout; GLfloat qin = in->pv.w / win; GLfloat qdst, rqdst; @@ -708,7 +709,7 @@ static void TAG(interp)( GLcontext *ctx, } } else if (DO_PTEX) { - dst->pv.q0 = 0.0; /* must be a valid float on radeon */ + dst->pv.q1 = 0.0; /* must be a valid float on radeon */ } if (DO_TEX2) { if (DO_PTEX) { |