/* $Id: t_imm_dlist.c,v 1.2 2000/12/26 07:41:32 keithw Exp $ */ | |||||
/* $Id: t_imm_dlist.c,v 1.3 2000/12/27 21:49:40 keithw Exp $ */ | |||||
/* | /* | ||||
* Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
TNLvertexcassette *node = (TNLvertexcassette *)data; | TNLvertexcassette *node = (TNLvertexcassette *)data; | ||||
struct immediate *IM = node->IM; | struct immediate *IM = node->IM; | ||||
/* FLUSH_VERTICES( ctx, 0 ); */ | |||||
if (ctx->NewState) | if (ctx->NewState) | ||||
gl_update_state(ctx); | gl_update_state(ctx); | ||||
fprintf(stderr, "Run cassette %d, rows %d..%d, beginstate %x ", | fprintf(stderr, "Run cassette %d, rows %d..%d, beginstate %x ", | ||||
IM->id, | IM->id, | ||||
IM->Start, IM->Count, IM->BeginState); | IM->Start, IM->Count, IM->BeginState); | ||||
/* _tnl_print_vert_flags("orflag", IM->OrFlag); */ | |||||
_tnl_print_vert_flags("orflag", IM->OrFlag); | |||||
} | |||||
if (IM->Count == IM->Start) { | |||||
_tnl_run_empty_cassette( ctx, IM ); | |||||
return; | |||||
} | } | ||||
if (IM->SavedBeginState) { | if (IM->SavedBeginState) { | ||||
} | } | ||||
/* Lazy optimization of the cassette. | /* Lazy optimization of the cassette. | ||||
*/ | */ | ||||
/* if (ctx->Transform.Normalize && !node->have_normal_lengths) { */ | /* if (ctx->Transform.Normalize && !node->have_normal_lengths) { */ |
/* $Id: t_imm_exec.c,v 1.1 2000/12/26 05:09:32 keithw Exp $ */ | |||||
/* $Id: t_imm_exec.c,v 1.2 2000/12/27 21:49:40 keithw Exp $ */ | |||||
/* | /* | ||||
* Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
/* Called for cassettes where CopyStart == Count -- no need to run the | /* Called for cassettes where CopyStart == Count -- no need to run the | ||||
* pipeline. | * pipeline. | ||||
*/ | */ | ||||
static void exec_empty_cassette( GLcontext *ctx, struct immediate *IM ) | |||||
void _tnl_run_empty_cassette( GLcontext *ctx, struct immediate *IM ) | |||||
{ | { | ||||
GLuint start = IM->CopyStart; | GLuint start = IM->CopyStart; | ||||
if (IM->OrFlag & VERT_ELT) | |||||
_tnl_translate_array_elts( ctx, IM, start, start ); | |||||
_tnl_fixup_input( ctx, IM ); /* shouldn't be needed? (demos/fire) */ | |||||
copy_to_current( ctx, IM, IM->OrFlag ); | copy_to_current( ctx, IM, IM->OrFlag ); | ||||
if (IM->OrFlag & VERT_MATERIAL) | if (IM->OrFlag & VERT_MATERIAL) | ||||
_tnl_get_exec_copy_verts( ctx, IM ); | _tnl_get_exec_copy_verts( ctx, IM ); | ||||
if (IM->CopyStart == IM->Count) { | if (IM->CopyStart == IM->Count) { | ||||
exec_empty_cassette( ctx, IM ); | |||||
if (IM->OrFlag & VERT_ELT) | |||||
_tnl_translate_array_elts( ctx, IM, IM->CopyStart, IM->CopyStart ); | |||||
_tnl_fixup_input( ctx, IM ); /* shouldn't be needed? (demos/fire) */ | |||||
_tnl_run_empty_cassette( ctx, IM ); | |||||
} | } | ||||
else if ((IM->OrFlag & VERT_DATA) == VERT_ELT && | else if ((IM->OrFlag & VERT_DATA) == VERT_ELT && | ||||
ctx->Array.LockCount && | ctx->Array.LockCount && |
/* $Id: t_imm_exec.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */ | |||||
/* $Id: t_imm_exec.h,v 1.2 2000/12/27 21:49:40 keithw Exp $ */ | |||||
/* | /* | ||||
* Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
/* Called from imm_dlist.c and _tnl_flush_immediate: | /* Called from imm_dlist.c and _tnl_flush_immediate: | ||||
*/ | */ | ||||
extern void _tnl_run_cassette( GLcontext *ctx, struct immediate *IM ); | extern void _tnl_run_cassette( GLcontext *ctx, struct immediate *IM ); | ||||
extern void _tnl_run_empty_cassette( GLcontext *ctx, struct immediate *IM ); | |||||
/* Initialize some stuff: | /* Initialize some stuff: | ||||
*/ | */ |
/* $Id: t_vb_cliptmp.h,v 1.2 2000/12/27 19:57:37 keithw Exp $ */ | |||||
/* $Id: t_vb_cliptmp.h,v 1.3 2000/12/27 21:49:40 keithw Exp $ */ | |||||
/* | /* | ||||
* Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
*/ | */ | ||||
GLfloat t = dp / (dp - dpPrev); | GLfloat t = dp / (dp - dpPrev); | ||||
newvert = interp( ctx, t, idx, idxPrev, GL_TRUE ); | newvert = interp( ctx, t, idx, idxPrev, GL_TRUE ); | ||||
/* fprintf(stderr,"Goint out: in: %d/%d out: %d/%d new: %d/%d\n", */ | |||||
/* idxPrev, VB->EdgeFlagPtr->data[idxPrev], */ | |||||
/* idx, VB->EdgeFlagPtr->data[idx], */ | |||||
/* newvert, VB->EdgeFlagPtr->data[newvert]); */ | |||||
} else { | } else { | ||||
/* Coming back in. | /* Coming back in. | ||||
*/ | */ | ||||
GLfloat t = dpPrev / (dpPrev - dp); | GLfloat t = dpPrev / (dpPrev - dp); | ||||
newvert = interp( ctx, t, idxPrev, idx, GL_FALSE ); | newvert = interp( ctx, t, idxPrev, idx, GL_FALSE ); | ||||
/* fprintf(stderr,"coming in: in: %d/%d out: %d/%d new: %d/%d\n", */ | |||||
/* idx, VB->EdgeFlagPtr->data[idx], */ | |||||
/* idxPrev, VB->EdgeFlagPtr->data[idxPrev], */ | |||||
/* newvert, VB->EdgeFlagPtr->data[newvert]); */ | |||||
} | } | ||||
clipmask[newvert] = 0; | clipmask[newvert] = 0; | ||||
outlist[outcount++] = newvert; | outlist[outcount++] = newvert; | ||||
vlist[i] = inlist[i]; | vlist[i] = inlist[i]; | ||||
} | } | ||||
/* fprintf(stderr, "%s: finally:\n", __FUNCTION__); */ | |||||
/* for (i = 0 ; i < n ; i++) */ | |||||
/* fprintf(stderr, "%d: %d\n", vlist[i], VB->EdgeFlagPtr->data[vlist[i]]); */ | |||||
return n; | return n; | ||||
} | } | ||||
/* $Id: t_vb_render.c,v 1.2 2000/12/27 19:57:37 keithw Exp $ */ | |||||
/* $Id: t_vb_render.c,v 1.3 2000/12/27 21:49:40 keithw Exp $ */ | |||||
/* | /* | ||||
* Mesa 3-D graphics library | * Mesa 3-D graphics library | ||||
length= VB->PrimitiveLength[i]; | length= VB->PrimitiveLength[i]; | ||||
ASSERT(length || (flags & PRIM_LAST)); | ASSERT(length || (flags & PRIM_LAST)); | ||||
ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); | ASSERT((flags & PRIM_MODE_MASK) <= GL_POLYGON+1); | ||||
/* fprintf(stderr, "render %s %d..%d\n", */ | |||||
/* _mesa_prim_name[flags & PRIM_MODE_MASK], */ | |||||
/* i, i+length); */ | |||||
if (length) | if (length) | ||||
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); | tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags ); | ||||
} | } |