From 3fd01320f1ce3b78584c1fec9b1d6805e8ee6786 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sun, 14 Jan 2001 06:14:21 +0000 Subject: Fixed conform feedback and drawelements tests. Use correct pv when rasterizing unfilled polys. --- src/mesa/main/feedback.c | 7 +++---- src/mesa/main/lines.c | 3 +-- src/mesa/main/points.c | 3 +-- src/mesa/swrast_setup/ss_triangle.c | 4 ++-- src/mesa/swrast_setup/ss_vbtmp.h | 2 +- src/mesa/tnl/t_array_api.c | 18 +++++++++++------- src/mesa/tnl/t_context.h | 4 ++-- src/mesa/tnl/t_imm_exec.c | 6 +++--- src/mesa/tnl/t_pipeline.c | 3 ++- src/mesa/tnl/t_vb_rendertmp.h | 6 +++--- 10 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 4d6941a576..b67e8146c3 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -1,4 +1,4 @@ -/* $Id: feedback.c,v 1.19 2001/01/08 04:09:41 keithw Exp $ */ +/* $Id: feedback.c,v 1.20 2001/01/14 06:14:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -58,14 +58,13 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) gl_error( ctx, GL_INVALID_OPERATION, "glFeedbackBuffer" ); return; } - if (size<0) { gl_error( ctx, GL_INVALID_VALUE, "glFeedbackBuffer(size<0)" ); return; } if (!buffer) { gl_error( ctx, GL_INVALID_VALUE, "glFeedbackBuffer(buffer==NULL)" ); - ctx->Feedback.BufferSize = 0; /* XXX -- Sould this be here??? */ + ctx->Feedback.BufferSize = 0; return; } @@ -103,7 +102,6 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) } - void _mesa_PassThrough( GLfloat token ) { @@ -153,6 +151,7 @@ void gl_feedback_vertex( GLcontext *ctx, } } + /**********************************************************************/ /* Selection */ /**********************************************************************/ diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 8a9256c178..520010c1a1 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -1,4 +1,4 @@ -/* $Id: lines.c,v 1.26 2001/01/13 05:48:25 keithw Exp $ */ +/* $Id: lines.c,v 1.27 2001/01/14 06:14:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,6 @@ #include "glheader.h" #include "context.h" #include "depth.h" -#include "feedback.h" #include "lines.h" #include "macros.h" #include "mmath.h" diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index c24b1b4eef..41788352a1 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -1,4 +1,4 @@ -/* $Id: points.c,v 1.27 2001/01/09 00:02:55 brianp Exp $ */ +/* $Id: points.c,v 1.28 2001/01/14 06:14:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -30,7 +30,6 @@ #else #include "glheader.h" #include "context.h" -#include "feedback.h" #include "macros.h" #include "mmath.h" #include "points.h" diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index 5fd5cd0f57..73a19ad38a 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -144,11 +144,11 @@ static void swsetup_points( GLcontext *ctx, GLuint first, GLuint last ) int i; if (VB->Elts) { - for(i=first;i<=last;i++) + for(i=first;iClipMask[VB->Elts[i]]==0) _swrast_Point( ctx, &verts[VB->Elts[i]] ); } else { - for(i=first;i<=last;i++) + for(i=first;iClipMask[i]==0) _swrast_Point( ctx, &verts[i] ); } diff --git a/src/mesa/swrast_setup/ss_vbtmp.h b/src/mesa/swrast_setup/ss_vbtmp.h index f5a4c449e7..15d51a41df 100644 --- a/src/mesa/swrast_setup/ss_vbtmp.h +++ b/src/mesa/swrast_setup/ss_vbtmp.h @@ -110,7 +110,7 @@ static void TAG(rs)(GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs ) if (IND & MULTITEX) { GLuint u; for (u = 0 ; u < maxtex ; u++) - if (tc[u]) + if (tc[u]) COPY_CLEAN_4V( v->texcoord[u], tsz[u], tc[u][i] ); } diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index 587f1b43d7..908328513d 100644 --- a/src/mesa/tnl/t_array_api.c +++ b/src/mesa/tnl/t_array_api.c @@ -1,4 +1,4 @@ -/* $Id: t_array_api.c,v 1.2 2001/01/08 21:56:00 keithw Exp $ */ +/* $Id: t_array_api.c,v 1.3 2001/01/14 06:14:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -148,7 +148,7 @@ static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode, { TNLcontext *tnl = TNL_CONTEXT(ctx); FLUSH_CURRENT( ctx, 0 ); - + _tnl_vb_bind_arrays( ctx, start, end ); tnl->vb.FirstPrimitive = 0; @@ -260,11 +260,11 @@ _tnl_DrawRangeElements(GLenum mode, "elements outside locked range."); } } - else if (end - start < ctx->Const.MaxArrayLockSize) { + else if (end + 1 - start < ctx->Const.MaxArrayLockSize) { /* The arrays aren't locked but we can still fit them inside a single * vertexbuffer. */ - _tnl_draw_range_elements( ctx, mode, start, end, count, ui_indices ); + _tnl_draw_range_elements( ctx, mode, start, end + 1, count, ui_indices ); } else { /* Range is too big to optimize: */ @@ -292,7 +292,8 @@ _tnl_DrawElements(GLenum mode, GLsizei count, GLenum type, ui_indices = (GLuint *)_ac_import_elements( ctx, GL_UNSIGNED_INT, count, type, indices ); - + +#if 1 if (ctx->Array.LockCount) { _tnl_draw_range_elements( ctx, mode, ctx->Array.LockFirst, @@ -309,11 +310,14 @@ _tnl_DrawElements(GLenum mode, GLsizei count, GLenum type, if (ui_indices[i] > max_elt) max_elt = ui_indices[i]; if (max_elt < ctx->Const.MaxArrayLockSize && /* can we use it? */ - max_elt < count) /* do we want to use it? */ - _tnl_draw_range_elements( ctx, mode, 0, max_elt, count, ui_indices ); + max_elt < count) /* do we want to use it? */ + _tnl_draw_range_elements( ctx, mode, 0, max_elt + 1, count, ui_indices ); else _tnl_draw_elements( ctx, mode, count, ui_indices ); } +#else + _tnl_draw_elements( ctx, mode, count, ui_indices ); +#endif } diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index d49c854241..41be51e4e2 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -1,4 +1,4 @@ -/* $Id: t_context.h,v 1.10 2001/01/13 05:48:26 keithw Exp $ */ +/* $Id: t_context.h,v 1.11 2001/01/14 06:14:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -105,7 +105,7 @@ /* Flags for IM->TexCoordSize. Enough flags for 16 units. */ #define TEX_0_SIZE_3 0x1 -#define TEX_0_SIZE_4 0x1000 +#define TEX_0_SIZE_4 0x1001 #define TEX_SIZE_3(unit) (TEX_0_SIZE_3<TexCoord[i].data = IM->TexCoord[i] + start; tmp->TexCoord[i].start = (GLfloat *)(IM->TexCoord[i] + start); tmp->TexCoord[i].size = 2; - if (IM->TexSize & i) { + if (IM->TexSize & TEX_SIZE_3(i)) { tmp->TexCoord[i].size = 3; - if (IM->TexSize & (i<<16)) + if (IM->TexSize & TEX_SIZE_4(i)) tmp->TexCoord[i].size = 4; } VB->TexCoordPtr[i] = &tmp->TexCoord[i]; diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 8ee814841b..11a17849b6 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -1,4 +1,4 @@ -/* $Id: t_pipeline.c,v 1.8 2001/01/08 21:56:00 keithw Exp $ */ +/* $Id: t_pipeline.c,v 1.9 2001/01/14 06:14:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -142,6 +142,7 @@ void _tnl_run_pipeline( GLcontext *ctx ) changed_inputs |= stage[i].outputs; if (running) { +/* fprintf(stderr, "run %s\n", stage[i].name); */ running = stage[i].run( ctx, &stage[i] ); } } diff --git a/src/mesa/tnl/t_vb_rendertmp.h b/src/mesa/tnl/t_vb_rendertmp.h index 194dd85190..c2e1c9051e 100644 --- a/src/mesa/tnl/t_vb_rendertmp.h +++ b/src/mesa/tnl/t_vb_rendertmp.h @@ -1,4 +1,4 @@ -/* $Id: t_vb_rendertmp.h,v 1.5 2001/01/08 04:09:42 keithw Exp $ */ +/* $Id: t_vb_rendertmp.h,v 1.6 2001/01/14 06:14:21 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -287,7 +287,7 @@ static void TAG(render_poly)( GLcontext *ctx, if (j