mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
get ffb compiling
This commit is contained in:
parent
c11039979c
commit
07851ca039
3 changed files with 6 additions and 69 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue