/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.5.1
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
static void clear_active_eval1( TNLcontext *tnl, GLuint attr )
{
+ ASSERT(attr < _TNL_NUM_EVAL);
tnl->vtx.eval.map1[attr].map = NULL;
}
static void clear_active_eval2( TNLcontext *tnl, GLuint attr )
{
+ ASSERT(attr < _TNL_NUM_EVAL);
tnl->vtx.eval.map2[attr].map = NULL;
}
static void set_active_eval1( TNLcontext *tnl, GLuint attr, GLuint dim,
struct gl_1d_map *map )
{
+ ASSERT(attr < _TNL_NUM_EVAL);
if (!tnl->vtx.eval.map1[attr].map) {
tnl->vtx.eval.map1[attr].map = map;
tnl->vtx.eval.map1[attr].sz = dim;
static void set_active_eval2( TNLcontext *tnl, GLuint attr, GLuint dim,
struct gl_2d_map *map )
{
+ ASSERT(attr < _TNL_NUM_EVAL);
if (!tnl->vtx.eval.map2[attr].map) {
tnl->vtx.eval.map2[attr].map = map;
tnl->vtx.eval.map2[attr].sz = dim;
/* Vertex program maps have priority over conventional attribs */
- for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
+ for (attr = 0; attr < _TNL_NUM_EVAL; attr++) {
clear_active_eval1( tnl, attr );
clear_active_eval2( tnl, attr );
}
- if (ctx->VertexProgram._Enabled) {
- for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
- if (ctx->Eval.Map1Attrib[attr])
- set_active_eval1( tnl, attr, 4, &ctx->EvalMap.Map1Attrib[attr] );
-
- if (ctx->Eval.Map2Attrib[attr])
- set_active_eval2( tnl, attr, 4, &ctx->EvalMap.Map2Attrib[attr] );
- }
- }
-
if (ctx->Eval.Map1Color4)
set_active_eval1( tnl, VERT_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 );
else if (ctx->Eval.Map2Vertex3)
set_active_eval2( tnl, VERT_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 );
+ /* Evaluators with generic attributes is only supported for NV vertex
+ * programs, not ARB vertex programs. 16 evaluator maps are supported.
+ * We do this after the conventional attributes since the spec says that
+ * these generic maps have higher priority.
+ */
+ if (ctx->VertexProgram._Enabled &&
+ ctx->VertexProgram._Current &&
+ ctx->VertexProgram._Current->IsNVProgram) {
+ for (attr = 0; attr < 16; attr++) {
+ if (ctx->Eval.Map1Attrib[attr])
+ set_active_eval1( tnl, attr, 4, &ctx->EvalMap.Map1Attrib[attr] );
+
+ if (ctx->Eval.Map2Attrib[attr])
+ set_active_eval2( tnl, attr, 4, &ctx->EvalMap.Map2Attrib[attr] );
+ }
+ }
+
tnl->vtx.eval.new_state = 0;
}
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint attr;
- for (attr = 1; attr <= _TNL_ATTRIB_EDGEFLAG; attr++) {
+ for (attr = 1; attr < _TNL_NUM_EVAL; attr++) {
struct gl_1d_map *map = tnl->vtx.eval.map1[attr].map;
if (map) {
GLfloat uu = (u - map->u1) * map->du;
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint attr;
- for (attr = 1; attr <= _TNL_ATTRIB_EDGEFLAG; attr++) {
+ for (attr = 1; attr < _TNL_NUM_EVAL; attr++) {
struct gl_2d_map *map = tnl->vtx.eval.map2[attr].map;
if (map) {
GLfloat uu = (u - map->u1) * map->du;