diff options
author | Keith Whitwell <[email protected]> | 2003-10-09 14:45:30 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2003-10-09 14:45:30 +0000 |
commit | d5c9fd383bf4712ddcdc850a70002f4fb0f3a83a (patch) | |
tree | 9500bca7754c312124e0c71566367d31bc28d065 | |
parent | 8ae69294ad3baca78dcb1b306d5fd09505b08e91 (diff) |
Checkpoint -- module compiles. Some issues with strides outstanding.
-rw-r--r-- | src/mesa/swrast_setup/ss_tritmp.h | 12 | ||||
-rw-r--r-- | src/mesa/swrast_setup/ss_vb.c | 22 | ||||
-rw-r--r-- | src/mesa/swrast_setup/ss_vbtmp.h | 28 |
3 files changed, 29 insertions, 33 deletions
diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index aba954bc811..85234ce73e1 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -62,18 +62,18 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (facing == 1) { if (IND & SS_TWOSIDE_BIT) { if (IND & SS_RGBA_BIT) { - GLchan (*vbcolor)[4] = (GLchan (*)[4])VB->ColorPtr[1]->Ptr; + GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; SS_COLOR(v[0]->color, vbcolor[e0]); SS_COLOR(v[1]->color, vbcolor[e1]); SS_COLOR(v[2]->color, vbcolor[e2]); if (VB->SecondaryColorPtr[1]) { - GLchan (*vbspec)[4] = (GLchan (*)[4])VB->SecondaryColorPtr[1]->Ptr; + GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; SS_SPEC(v[0]->specular, vbspec[e0]); SS_SPEC(v[1]->specular, vbspec[e1]); SS_SPEC(v[2]->specular, vbspec[e2]); } } else { - GLfloat *vbindex = VB->IndexPtr[1]->data; + GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; SS_IND(v[0]->index, vbindex[e0]); SS_IND(v[1]->index, vbindex[e1]); SS_IND(v[2]->index, vbindex[e2]); @@ -137,18 +137,18 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & SS_TWOSIDE_BIT) { if (facing == 1) { if (IND & SS_RGBA_BIT) { - GLchan (*vbcolor)[4] = (GLchan (*)[4])VB->ColorPtr[0]->Ptr; + GLfloat (*vbcolor)[4] = VB->ColorPtr[0]->data; SS_COLOR(v[0]->color, vbcolor[e0]); SS_COLOR(v[1]->color, vbcolor[e1]); SS_COLOR(v[2]->color, vbcolor[e2]); if (VB->SecondaryColorPtr[0]) { - GLchan (*vbspec)[4] = (GLchan (*)[4])VB->SecondaryColorPtr[0]->Ptr; + GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[0]->data; SS_SPEC(v[0]->specular, vbspec[e0]); SS_SPEC(v[1]->specular, vbspec[e1]); SS_SPEC(v[2]->specular, vbspec[e2]); } } else { - GLfloat *vbindex = VB->IndexPtr[0]->data; + GLfloat *vbindex = (GLfloat *)VB->IndexPtr[0]->data; SS_IND(v[0]->index, vbindex[e0]); SS_IND(v[1]->index, vbindex[e1]); SS_IND(v[2]->index, vbindex[e2]); diff --git a/src/mesa/swrast_setup/ss_vb.c b/src/mesa/swrast_setup/ss_vb.c index 6e0a9c09b68..bb9819b5b87 100644 --- a/src/mesa/swrast_setup/ss_vb.c +++ b/src/mesa/swrast_setup/ss_vb.c @@ -39,6 +39,8 @@ #include "ss_context.h" #include "ss_vb.h" + +#if 0 static void do_import( struct vertex_buffer *VB, struct gl_client_array *to, struct gl_client_array *from ) @@ -83,7 +85,7 @@ static void import_float_spec_colors( GLcontext *ctx ) do_import( VB, to, VB->SecondaryColorPtr[0] ); VB->SecondaryColorPtr[0] = to; } - +#endif /* Provides a RasterSetup function which prebuilds vertices for the * software rasterizer. This is required for the triangle functions @@ -226,7 +228,7 @@ static copy_pv_func copy_pv_tab[MAX_SETUPFUNC]; * Additional setup and interp for back color and edgeflag. ***********************************************************************/ -#define GET_COLOR(ptr, idx) (((GLchan (*)[4])((ptr)->Ptr))[idx]) +#define GET_COLOR(ptr, idx) (((GLfloat (*)[4])((ptr)->data))[idx]) static void interp_extras( GLcontext *ctx, GLfloat t, @@ -236,22 +238,22 @@ static void interp_extras( GLcontext *ctx, struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (VB->ColorPtr[1]) { - INTERP_4CHAN( t, + INTERP_4F( t, GET_COLOR(VB->ColorPtr[1], dst), GET_COLOR(VB->ColorPtr[1], out), GET_COLOR(VB->ColorPtr[1], in) ); if (VB->SecondaryColorPtr[1]) { - INTERP_3CHAN( t, + INTERP_3F( t, GET_COLOR(VB->SecondaryColorPtr[1], dst), GET_COLOR(VB->SecondaryColorPtr[1], out), GET_COLOR(VB->SecondaryColorPtr[1], in) ); } } else if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst] = LINTERP( t, - VB->IndexPtr[1]->data[out], - VB->IndexPtr[1]->data[in] ); + VB->IndexPtr[1]->data[dst][0] = LINTERP( t, + VB->IndexPtr[1]->data[out][0], + VB->IndexPtr[1]->data[in][0] ); } if (VB->EdgeFlag) { @@ -267,8 +269,8 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (VB->ColorPtr[1]) { - COPY_CHAN4( GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], src) ); + COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), + GET_COLOR(VB->ColorPtr[1], src) ); if (VB->SecondaryColorPtr[1]) { COPY_3V( GET_COLOR(VB->SecondaryColorPtr[1], dst), @@ -276,7 +278,7 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) } } else if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst] = VB->IndexPtr[1]->data[src]; + VB->IndexPtr[1]->data[dst][0] = VB->IndexPtr[1]->data[src][0]; } copy_pv_tab[SWSETUP_CONTEXT(ctx)->SetupIndex](ctx, dst, src); diff --git a/src/mesa/swrast_setup/ss_vbtmp.h b/src/mesa/swrast_setup/ss_vbtmp.h index 049511f47cd..61956f25cee 100644 --- a/src/mesa/swrast_setup/ss_vbtmp.h +++ b/src/mesa/swrast_setup/ss_vbtmp.h @@ -35,8 +35,8 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end, SWvertex *v; const GLfloat *ndc; /* NDC (i.e. projected clip coordinates) */ const GLfloat *tc[MAX_TEXTURE_COORD_UNITS]; - const GLchan *color; - const GLchan *spec; + const GLfloat *color; + const GLfloat *spec; const GLfloat *index; const GLfloat *fog; const GLfloat *pointSize; @@ -80,21 +80,15 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end, fog_stride = VB->FogCoordPtr->stride; } if (IND & COLOR) { - if (VB->ColorPtr[0]->Type != CHAN_TYPE) - import_float_colors( ctx ); - - color = (GLchan *) VB->ColorPtr[0]->Ptr; - color_stride = VB->ColorPtr[0]->StrideB; + color = (GLfloat *) VB->ColorPtr[0]->data; + color_stride = VB->ColorPtr[0]->stride; } if (IND & SPEC) { - if (VB->SecondaryColorPtr[0]->Type != CHAN_TYPE) - import_float_spec_colors( ctx ); - - spec = (GLchan *) VB->SecondaryColorPtr[0]->Ptr; - spec_stride = VB->SecondaryColorPtr[0]->StrideB; + spec = (GLfloat *) VB->SecondaryColorPtr[0]->data; + spec_stride = VB->SecondaryColorPtr[0]->stride; } if (IND & INDEX) { - index = VB->IndexPtr[0]->data; + index = (GLfloat *) VB->IndexPtr[0]->data; index_stride = VB->IndexPtr[0]->stride; } if (IND & POINT) { @@ -128,13 +122,13 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end, } if (IND & COLOR) { - COPY_CHAN4(v->color, color); - STRIDE_CHAN(color, color_stride); + UNCLAMPED_FLOAT_TO_RGBA_CHAN(v->color, color); + STRIDE_F(color, color_stride); } if (IND & SPEC) { - COPY_CHAN4(v->specular, spec); - STRIDE_CHAN(spec, spec_stride); + UNCLAMPED_FLOAT_TO_RGBA_CHAN(v->specular, spec); + STRIDE_F(spec, spec_stride); } if (IND & FOG) { |