diff options
Diffstat (limited to 'xc/extras/Mesa/src/tnl/t_eval_api.c')
-rw-r--r-- | xc/extras/Mesa/src/tnl/t_eval_api.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/xc/extras/Mesa/src/tnl/t_eval_api.c b/xc/extras/Mesa/src/tnl/t_eval_api.c index 5bd3880df..cd38d92d3 100644 --- a/xc/extras/Mesa/src/tnl/t_eval_api.c +++ b/xc/extras/Mesa/src/tnl/t_eval_api.c @@ -1,8 +1,7 @@ -/* $Id: t_eval_api.c,v 1.1.1.1 2002/10/22 13:06:21 alanh Exp $ */ /* * Mesa 3-D graphics library - * Version: 4.0.3 + * Version: 4.1 * * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. * @@ -22,6 +21,10 @@ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Keith Whitwell - original code + * Brian Paul - vertex program updates */ @@ -29,7 +32,7 @@ #include "colormac.h" #include "context.h" #include "macros.h" -#include "mem.h" +#include "imports.h" #include "mmath.h" #include "mtypes.h" #include "math/m_eval.h" @@ -40,9 +43,6 @@ #include "t_imm_exec.h" - - - /* KW: If are compiling, we don't know whether eval will produce a * vertex when it is run in the future. If this is pure immediate * mode, eval is a noop if neither vertex map is enabled. @@ -61,7 +61,8 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) GLenum prim; ASSERT_OUTSIDE_BEGIN_END(ctx); -/* fprintf(stderr, "%s\n", __FUNCTION__); */ + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glEvalMesh1()"); switch (mode) { case GL_POINT: @@ -77,7 +78,8 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) /* No effect if vertex maps disabled. */ - if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3) + if (!ctx->Eval.Map1Vertex4 && !ctx->Eval.Map1Vertex3 && + (!ctx->VertexProgram.Enabled || !ctx->Eval.Map1Attrib[VERT_ATTRIB_POS])) return; du = ctx->Eval.MapGrid1du; @@ -108,10 +110,10 @@ _tnl_exec_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) tnl->Driver.NotifyBegin = 0; if (compiling) { - struct immediate *IM = _tnl_alloc_immediate( ctx ); + struct immediate *tmp = _tnl_alloc_immediate( ctx ); FLUSH_VERTICES( ctx, 0 ); - SET_IMMEDIATE( ctx, IM ); - IM->ref_count++; + SET_IMMEDIATE( ctx, tmp ); + TNL_CURRENT_IM(ctx)->ref_count++; ctx->CompileFlag = GL_FALSE; } @@ -146,14 +148,15 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) GLfloat u, du, v, dv, v1, u1; ASSERT_OUTSIDE_BEGIN_END(ctx); -/* fprintf(stderr, "%s\n", __FUNCTION__); */ + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glEvalMesh2()"); /* No effect if vertex maps disabled. */ - if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3) + if (!ctx->Eval.Map2Vertex4 && !ctx->Eval.Map2Vertex3 && + (!ctx->VertexProgram.Enabled || !ctx->Eval.Map2Attrib[VERT_ATTRIB_POS])) return; - du = ctx->Eval.MapGrid2du; dv = ctx->Eval.MapGrid2dv; v1 = ctx->Eval.MapGrid2v1 + j1 * dv; @@ -173,10 +176,10 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) tnl->Driver.NotifyBegin = 0; if (compiling) { - struct immediate *IM = _tnl_alloc_immediate( ctx ); + struct immediate *tmp = _tnl_alloc_immediate( ctx ); FLUSH_VERTICES( ctx, 0 ); - SET_IMMEDIATE( ctx, IM ); - IM->ref_count++; + SET_IMMEDIATE( ctx, tmp ); + TNL_CURRENT_IM(ctx)->ref_count++; ctx->CompileFlag = GL_FALSE; } @@ -236,7 +239,6 @@ _tnl_exec_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) } - void _tnl_eval_init( GLcontext *ctx ) { GLvertexformat *vfmt = &(TNL_CONTEXT(ctx)->vtxfmt); |