Fixed fallback path for drawarrays/_tnl_hard_begin.
Removed disabled debug code.
-# $Id: Makefile.X11,v 1.38 2001/01/05 05:31:42 keithw Exp $
+# $Id: Makefile.X11,v 1.39 2001/01/08 21:55:59 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
ADDITIONAL_OBJ =
OBJECTS = $(ASM_SOURCES:.S=.o) \
- $(CORE_SOURCES:.c=.o) \
$(DRIVER_SOURCES:.c=.o) \
+ $(CORE_SOURCES:.c=.o) \
$(ADDITIONAL_OBJ)
grDrawTriangle( &v[i2].v, &v[i1].v, &v[i].v )
#define TAG(x) fx_##x##_verts
-#define LOCAL_VARS \
- fxVertex *v = FX_CONTEXT(ctx)->verts;
+#define LOCAL_VARS \
+ fxVertex *v = FX_CONTEXT(ctx)->verts; \
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
+ (void) elt;
/* Verts, no clipping.
*/
*/
#undef ELT
#undef TAG
-#undef LOCAL_VARS
#define TAG(x) fx_##x##_elts
#define ELT(x) elt[x]
-#define LOCAL_VARS \
- fxVertex *v = FX_CONTEXT(ctx)->verts; \
- const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
#include "tnl/t_vb_rendertmp.h"
-# $Id: Makefile.X11,v 1.38 2001/01/05 05:31:42 keithw Exp $
+# $Id: Makefile.X11,v 1.39 2001/01/08 21:55:59 keithw Exp $
# Mesa 3-D graphics library
# Version: 3.5
ADDITIONAL_OBJ =
OBJECTS = $(ASM_SOURCES:.S=.o) \
- $(CORE_SOURCES:.c=.o) \
$(DRIVER_SOURCES:.c=.o) \
+ $(CORE_SOURCES:.c=.o) \
$(ADDITIONAL_OBJ)
-/* $Id: mtypes.h,v 1.12 2001/01/08 04:09:41 keithw Exp $ */
+/* $Id: mtypes.h,v 1.13 2001/01/08 21:55:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
/* Dither disable via MESA_NO_DITHER env var */
GLboolean NoDither;
-#ifdef DEBUG
GLboolean Rendering;
-#endif
#if defined(MESA_TRACE)
struct _glapi_table *TraceDispatch;
trace_context_t *TraceCtx;
+#else
+ void *TraceDispatch;
+ void *TraceCtx;
#endif
/* Hooks for module contexts. These will eventually live
-/* $Id: t_array_api.c,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_array_api.c,v 1.2 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
* because the array range is too large to process in a single
* VB. In GL_EXECUTE mode, this introduces two redundant
* operations: producing the flag array and computing the orflag
- * of the flag array.
+ * of the flag array.
*/
-#if 0
+#if 1
if (_tnl_hard_begin( ctx, mode )) {
GLuint j;
for (j = 0 ; j < count ; ) {
#else
/* Simple alternative to above code.
*/
-/* if (_tnl_hard_begin( ctx, mode )) */
- _tnl_begin(ctx,mode);
+ if (_tnl_hard_begin( ctx, mode ))
{
GLuint i;
for (i=start;i<count;i++) {
-/* $Id: t_array_import.c,v 1.5 2001/01/08 04:09:41 keithw Exp $ */
+/* $Id: t_array_import.c,v 1.6 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
struct gl_client_array *tmp;
GLboolean is_writeable = 0;
-/* fprintf(stderr, "%s %d before wr %d ptr %p\n", __FUNCTION__, i, writeable, */
-/* inputs->TexCoord[i].data); */
-
tmp = _ac_import_texcoord(ctx, i, GL_FLOAT,
stride ? 4*sizeof(GLfloat) : 0,
0,
inputs->TexCoord[i].flags |= VEC_BAD_STRIDE;
if (!is_writeable)
inputs->TexCoord[i].flags |= VEC_NOT_WRITEABLE;
-
-/* fprintf(stderr, "%s %d before wr %d ptr %p\n", __FUNCTION__, i, is_writeable, */
-/* inputs->TexCoord[i].data); */
}
-/* $Id: t_context.c,v 1.8 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: t_context.c,v 1.9 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
#include "t_array_api.h"
#include "t_eval_api.h"
#include "t_imm_alloc.h"
+#include "t_imm_api.h"
#include "t_imm_exec.h"
#include "t_imm_dlist.h"
#include "t_pipeline.h"
/* Create the TNLcontext structure
*/
ctx->swtnl_context = tnl = CALLOC( sizeof(TNLcontext) );
+
if (!tnl) {
return GL_FALSE;
}
ctx->Driver.NeedFlush = FLUSH_UPDATE_CURRENT;
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
-
return GL_TRUE;
}
-/* $Id: t_eval_api.c,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_eval_api.c,v 1.2 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->CompileFlag = GL_FALSE;
}
- _tnl_begin( ctx, prim );
+ _tnl_hard_begin( ctx, prim );
for (i=i1;i<=i2;i++,u+=du) {
_tnl_eval_coord1f( ctx, u );
}
switch (mode) {
case GL_POINT:
- _tnl_begin( ctx, GL_POINTS );
+ _tnl_hard_begin( ctx, GL_POINTS );
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
for (u=u1,i=i1;i<=i2;i++,u+=du) {
_tnl_eval_coord2f( ctx, u, v );
break;
case GL_LINE:
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
- _tnl_begin( ctx, GL_LINE_STRIP );
+ _tnl_hard_begin( ctx, GL_LINE_STRIP );
for (u=u1,i=i1;i<=i2;i++,u+=du) {
_tnl_eval_coord2f( ctx, u, v );
}
_tnl_end(ctx);
}
for (u=u1,i=i1;i<=i2;i++,u+=du) {
- _tnl_begin( ctx, GL_LINE_STRIP );
+ _tnl_hard_begin( ctx, GL_LINE_STRIP );
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
_tnl_eval_coord2f( ctx, u, v );
}
break;
case GL_FILL:
for (v=v1,j=j1;j<j2;j++,v+=dv) {
- _tnl_begin( ctx, GL_TRIANGLE_STRIP );
+ _tnl_hard_begin( ctx, GL_TRIANGLE_STRIP );
for (u=u1,i=i1;i<=i2;i++,u+=du) {
_tnl_eval_coord2f( ctx, u, v );
_tnl_eval_coord2f( ctx, u, v+dv );
}
-void
+static void
_tnl_begin( GLcontext *ctx, GLenum p )
{
struct immediate *IM = TNL_CURRENT_IM(ctx);
*/
if (!ctx->CompileFlag) {
_tnl_begin( ctx, p );
+
+ /* Set this for the duration:
+ */
+ ctx->Driver.CurrentExecPrimitive = p;
return GL_TRUE;
}
switch (IM->BeginState & (VERT_BEGIN_0|VERT_BEGIN_1)) {
case VERT_BEGIN_0|VERT_BEGIN_1:
- /* In this case we know for sure that the list is going to be
- * inside a begin/end object at this point when run. Rather
- * than saving the redundant data, compile in an error and
- * return.
+ /* This is an immediate known to be inside a begin/end object.
*/
IM->BeginState |= (VERT_ERROR_1|VERT_ERROR_0);
return GL_FALSE;
case VERT_BEGIN_0:
case VERT_BEGIN_1:
- /* This is a normal (non-hard) immediate, in an unknown
- * begin/end state. Assert it is empty and conviert it to a
- * 'hard' one.
+ /* This is a display-list immediate in an unknown begin/end
+ * state. Assert it is empty and conviert it to a 'hard' one.
*/
ASSERT (IM->SavedBeginState == 0);
/* FALLTHROUGH */
case 0:
+ /* Unless we have fallen through, this is an immediate known to
+ * be outside begin/end objects.
+ */
IM->BeginState |= VERT_BEGIN_0|VERT_BEGIN_1;
* vertices before the next state change.
*/
ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
+
return GL_TRUE;
default:
}
}
+
+
+/* Need to do this to get the correct begin/end error behaviour from
+ * functions like ColorPointerEXT which are still active in
+ * SAVE_AND_EXEC modes.
+ */
+void
+_tnl_save_Begin( GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ if (mode > GL_POLYGON) {
+ _mesa_compile_error( ctx, GL_INVALID_ENUM, "glBegin" );
+ return;
+ }
+
+ if (ctx->ExecuteFlag) {
+ /* Preserve vtxfmt invarient:
+ */
+ if (ctx->NewState)
+ gl_update_state( ctx );
+
+ /* Slot in geomexec: No need to call setdispatch as we know
+ * CurrentDispatch is Save.
+ */
+ ASSERT(ctx->CurrentDispatch == ctx->Save);
+ }
+
+ _tnl_begin( ctx, mode );
+}
+
+
+
+
/* Note the continuation of a partially completed primitive. For
* driver t&l fallbacks between begin/end primitives. Has basically
* the same effects as a primitive wrapping onto a second immediate
IM->BeginState = state;
+ if (!ctx->CompileFlag)
+ ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
+
+
/* You can set this flag to get the old 'flush_vb on glEnd()'
* behaviour.
*/
*/
if (ctx->CompileFlag)
ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- else
- ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
-
-
}
-/* $Id: t_imm_api.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_imm_api.h,v 1.2 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
#include "t_context.h"
+extern void _tnl_save_Begin( GLenum mode );
+
/* TNL-private internal functions for building higher-level operations:
*/
-extern void _tnl_begin( GLcontext *ctx, GLenum p );
extern GLboolean _tnl_hard_begin( GLcontext *ctx, GLenum p );
extern void _tnl_end( GLcontext *ctx );
extern void _tnl_vertex2f( GLcontext *ctx, GLfloat x, GLfloat y );
-/* $Id: t_imm_dlist.c,v 1.4 2000/12/28 22:11:05 keithw Exp $ */
+/* $Id: t_imm_dlist.c,v 1.5 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
return;
node->IM = im; im->ref_count++;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* im->id, im->ref_count); */
node->Start = im->Start;
node->Count = im->Count;
node->BeginState = im->BeginState;
if (!new_im) return;
new_im->ref_count++;
im->ref_count--; /* remove CURRENT_IM reference */
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* im->id, im->ref_count); */
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* new_im->id, new_im->ref_count); */
ASSERT(im->ref_count > 0);
SET_IMMEDIATE( ctx, new_im );
_tnl_reset_input( ctx, IMM_MAX_COPIED_VERTS,
ctx->swtnl_im = 0;
IM->ref_count--;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* IM->id, IM->ref_count); */
if (IM == tnl->ExecCopySource) {
IM->ref_count--;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* IM->id, IM->ref_count); */
} else {
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* tnl->ExecCopySource->id, tnl->ExecCopySource->ref_count-1); */
if ( --tnl->ExecCopySource->ref_count == 0 )
_tnl_free_immediate( tnl->ExecCopySource );
}
tnl->ExecCopySource = IM;
IM->ref_count++;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* IM->id, IM->ref_count); */
SET_IMMEDIATE( ctx, IM );
IM->ref_count++;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* IM->id, IM->ref_count); */
_tnl_reset_input( ctx, IMM_MAX_COPIED_VERTS, 0, 0 );
print_compiled_cassette );
}
-/* Need to do this to get the correct begin/end error behaviour from
- * functions like ColorPointerEXT which are still active in
- * SAVE_AND_EXEC modes.
- */
-void
-_tnl_save_Begin( GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
-
- if (mode > GL_POLYGON) {
- _mesa_compile_error( ctx, GL_INVALID_ENUM, "glBegin" );
- return;
- }
-
- if (ctx->ExecuteFlag) {
- /* Preserve vtxfmt invarient:
- */
- if (ctx->NewState)
- gl_update_state( ctx );
-
- /* Slot in geomexec: No need to call setdispatch as we know
- * CurrentDispatch is Save.
- */
- ASSERT(ctx->CurrentDispatch == ctx->Save);
- }
-
- _tnl_begin( ctx, mode );
-}
-/* $Id: t_imm_dlist.h,v 1.1 2000/12/26 05:09:32 keithw Exp $ */
+/* $Id: t_imm_dlist.h,v 1.2 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
extern void _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM );
extern void _tnl_EndList( GLcontext *ctx );
extern void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode );
-extern void _tnl_save_Begin( GLenum mode );
extern void _tnl_EndCallList( GLcontext *ctx );
extern void _tnl_BeginCallList( GLcontext *ctx, GLuint list );
-/* $Id: t_imm_exec.c,v 1.5 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: t_imm_exec.c,v 1.6 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
ctx->swtnl_im = _tnl_alloc_immediate( ctx );
TNL_CURRENT_IM(ctx)->ref_count++;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* TNL_CURRENT_IM(ctx)->id, TNL_CURRENT_IM(ctx)->ref_count); */
tnl->ExecCopyTexSize = 0;
tnl->ExecCopyCount = 0;
tnl->ExecCopySource = TNL_CURRENT_IM(ctx);
TNL_CURRENT_IM(ctx)->ref_count++;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* TNL_CURRENT_IM(ctx)->id, TNL_CURRENT_IM(ctx)->ref_count); */
+
TNL_CURRENT_IM(ctx)->CopyStart = IMM_MAX_COPIED_VERTS;
gl_vector4f_init( &tmp->Obj, 0, 0 );
-/* $Id: t_imm_fixup.c,v 1.2 2000/12/28 22:11:05 keithw Exp $ */
+/* $Id: t_imm_fixup.c,v 1.3 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
ASSERT(prev == tnl->ExecCopySource);
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* tnl->ExecCopySource->id, tnl->ExecCopySource->ref_count-1); */
-
if (--tnl->ExecCopySource->ref_count == 0)
_tnl_free_immediate( tnl->ExecCopySource );
next->ref_count++;
tnl->ExecCopySource = next;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* next->id, next->ref_count); */
+
tnl->ExecCopyElts[0] = next->Start-3;
tnl->ExecCopyElts[1] = next->Start-2;
tnl->ExecCopyElts[2] = next->Start-1;
if (tnl->ExecCopySource != IM) {
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* tnl->ExecCopySource->id, tnl->ExecCopySource->ref_count-1); */
if (--tnl->ExecCopySource->ref_count == 0)
_tnl_free_immediate( tnl->ExecCopySource );
IM->ref_count++;
tnl->ExecCopySource = IM;
-/* fprintf(stderr, "%s id %d refcount %d\n", __FUNCTION__, */
-/* tnl->ExecCopySource->id, tnl->ExecCopySource->ref_count); */
}
if (prim == GL_POLYGON+1) {
-/* $Id: t_pipeline.c,v 1.7 2000/12/26 05:09:33 keithw Exp $ */
+/* $Id: t_pipeline.c,v 1.8 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
GLuint changed_inputs = pipe->run_input_changes;
GLboolean running = GL_TRUE;
GLuint i;
-
unsigned short __tmp;
/* Done elsewhere.
-/* $Id: t_vb_render.c,v 1.8 2001/01/08 17:41:15 keithw Exp $ */
+/* $Id: t_vb_render.c,v 1.9 2001/01/08 21:56:00 keithw Exp $ */
/*
* Mesa 3-D graphics library
length= VB->PrimitiveLength[i];
ASSERT(length || (flags & PRIM_LAST));
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)
tab[flags & PRIM_MODE_MASK]( ctx, i, i + length, flags );
}