From: Keith Whitwell Date: Mon, 8 Dec 2003 13:33:07 +0000 (+0000) Subject: get ffb compiling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07851ca039a3c9c54a21f8e364e740f918e8b3ec;p=mesa.git get ffb compiling --- diff --git a/src/mesa/drivers/dri/ffb/ffb_context.h b/src/mesa/drivers/dri/ffb/ffb_context.h index 6e68b6dd28f..58fdaf57eb3 100644 --- a/src/mesa/drivers/dri/ffb/ffb_context.h +++ b/src/mesa/drivers/dri/ffb/ffb_context.h @@ -107,10 +107,6 @@ typedef struct ffb_context_t { GLcontext *glCtx; GLframebuffer *glBuffer; - /* Temporaries for translating to float colors. */ - struct gl_client_array FloatColor; - struct gl_client_array FloatSecondaryColor; - ffb_fbcPtr regs; volatile char *sfb32; diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.c b/src/mesa/drivers/dri/ffb/ffb_vb.c index 09c9d041eef..7594c2b1a7e 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vb.c +++ b/src/mesa/drivers/dri/ffb/ffb_vb.c @@ -81,37 +81,6 @@ static struct { interp_func interp; } setup_tab[FFB_VB_MAX]; -static void do_import(struct vertex_buffer *VB, - struct gl_client_array *to, - struct gl_client_array *from) -{ - GLuint count = VB->Count; - - if (!to->Ptr) { - to->Ptr = ALIGN_MALLOC( VB->Size * 4 * sizeof(GLfloat), 32 ); - to->Type = GL_FLOAT; - } - - /* No need to transform the same value 3000 times. */ - if (!from->StrideB) { - to->StrideB = 0; - count = 1; - } else - to->StrideB = 4 * sizeof(GLfloat); - - _math_trans_4f((GLfloat (*)[4]) to->Ptr, - from->Ptr, from->StrideB, - from->Type, from->Size, - 0, count); -} - -static __inline__ void ffbImportColors(ffbContextPtr fmesa, GLcontext *ctx, int index) -{ - struct gl_client_array *to = &fmesa->FloatColor; - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - do_import(VB, to, VB->ColorPtr[index]); - VB->ColorPtr[index] = to; -} #define IND (FFB_VB_XYZ_BIT) #define TAG(x) x##_w @@ -175,7 +144,7 @@ static void ffbDDBuildVertices(GLcontext *ctx, GLuint start, GLuint count, if (!newinputs) return; - if (newinputs & VERT_BIT_CLIP) { + if (newinputs & VERT_BIT_POS) { setup_tab[fmesa->setupindex].emit(ctx, start, count); } else { GLuint ind = 0; diff --git a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h b/src/mesa/drivers/dri/ffb/ffb_vbtmp.h index ac0c6f0a8b3..5baa4eb03e0 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_vbtmp.h @@ -37,21 +37,15 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end) #endif #if (IND & (FFB_VB_RGBA_BIT)) - if (VB->ColorPtr[0]->Type != GL_FLOAT) - ffbImportColors(fmesa, ctx, 0); + col0 = VB->ColorPtr[0]->data; + col0_stride = VB->ColorPtr[0]->stride; #if (IND & (FFB_VB_TWOSIDE_BIT)) - if (VB->ColorPtr[1]->Type != GL_FLOAT) - ffbImportColors(fmesa, ctx, 1); -#endif - col0 = (GLfloat (*)[4]) VB->ColorPtr[0]->Ptr; - col0_stride = VB->ColorPtr[0]->StrideB; -#if (IND & (FFB_VB_TWOSIDE_BIT)) - col1 = (GLfloat (*)[4]) VB->ColorPtr[1]->Ptr; - col1_stride = VB->ColorPtr[1]->StrideB; + col1 = VB->ColorPtr[1]->data; + col1_stride = VB->ColorPtr[1]->stride; #endif #endif - if (VB->importable_data) { + { if (start) { #if (IND & (FFB_VB_XYZ_BIT)) proj = (GLfloat (*)[4])((GLubyte *)proj + start * proj_stride); @@ -85,28 +79,6 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end) v->color[1].blue = CLAMP(col1[0][2], 0.0f, 1.0f); col1 = (GLfloat (*)[4])((GLubyte *)col1 + col1_stride); #endif -#endif - } - } else { - for (i = start; i < end; i++, v++) { -#if (IND & (FFB_VB_XYZ_BIT)) - if (mask[i] == 0) { - v->x = proj[i][0]; - v->y = proj[i][1]; - v->z = proj[i][2]; - } -#endif -#if (IND & (FFB_VB_RGBA_BIT)) - v->color[0].alpha = CLAMP(col0[i][3], 0.0f, 1.0f); - v->color[0].red = CLAMP(col0[i][0], 0.0f, 1.0f); - v->color[0].green = CLAMP(col0[i][1], 0.0f, 1.0f); - v->color[0].blue = CLAMP(col0[i][2], 0.0f, 1.0f); -#if (IND & (FFB_VB_TWOSIDE_BIT)) - v->color[1].alpha = CLAMP(col1[i][3], 0.0f, 1.0f); - v->color[1].red = CLAMP(col1[i][0], 0.0f, 1.0f); - v->color[1].green = CLAMP(col1[i][1], 0.0f, 1.0f); - v->color[1].blue = CLAMP(col1[i][2], 0.0f, 1.0f); -#endif #endif } }