summaryrefslogtreecommitdiff
path: root/src/mesa/vbo
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r--src/mesa/vbo/vbo_exec.h4
-rw-r--r--src/mesa/vbo/vbo_exec_api.c19
-rw-r--r--src/mesa/vbo/vbo_exec_array.c2
-rw-r--r--src/mesa/vbo/vbo_exec_eval.c33
4 files changed, 44 insertions, 14 deletions
diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index 0a05b8df89..98c1f363d9 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -138,6 +138,10 @@ struct vbo_exec_context
*/
const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
} array;
+
+#ifdef DEBUG
+ GLint flush_call_depth;
+#endif
};
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index f72d2d84f3..f0a7eeadd0 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -867,15 +867,27 @@ void vbo_exec_FlushVertices_internal( GLcontext *ctx, GLboolean unmap )
}
-
+/**
+ * \param flags bitmask of FLUSH_STORED_VERTICES, FLUSH_UPDATE_CURRENT
+ */
void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
{
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
+#ifdef DEBUG
+ /* debug check: make sure we don't get called recursively */
+ exec->flush_call_depth++;
+ assert(exec->flush_call_depth == 1);
+#endif
+
if (0) _mesa_printf("%s\n", __FUNCTION__);
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__);
+#ifdef DEBUG
+ exec->flush_call_depth--;
+ assert(exec->flush_call_depth == 0);
+#endif
return;
}
@@ -889,6 +901,11 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
}
exec->ctx->Driver.NeedFlush &= ~flags;
+
+#ifdef DEBUG
+ exec->flush_call_depth--;
+ assert(exec->flush_call_depth == 0);
+#endif
}
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index fd70b57b72..6de8f059b7 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -146,7 +146,7 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array,
array->Ptr, array->BufferObj->Name);
f[k] = 1.0; /* XXX replace the bad value! */
}
- //assert(!IS_INF_OR_NAN(f[k]));
+ /*assert(!IS_INF_OR_NAN(f[k]));*/
}
}
break;
diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c
index 0c691b3a5c..a7846213d0 100644
--- a/src/mesa/vbo/vbo_exec_eval.c
+++ b/src/mesa/vbo/vbo_exec_eval.c
@@ -35,17 +35,20 @@
static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr )
{
+ assert(attr < Elements(exec->eval.map1));
exec->eval.map1[attr].map = NULL;
}
static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr )
{
+ assert(attr < Elements(exec->eval.map2));
exec->eval.map2[attr].map = NULL;
}
static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim,
struct gl_1d_map *map )
{
+ assert(attr < Elements(exec->eval.map1));
if (!exec->eval.map1[attr].map) {
exec->eval.map1[attr].map = map;
exec->eval.map1[attr].sz = dim;
@@ -55,6 +58,7 @@ static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint
static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim,
struct gl_2d_map *map )
{
+ assert(attr < Elements(exec->eval.map2));
if (!exec->eval.map2[attr].map) {
exec->eval.map2[attr].map = map;
exec->eval.map2[attr].sz = dim;
@@ -73,18 +77,6 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec )
clear_active_eval2( exec, attr );
}
- /* _NEW_PROGRAM */
- if (ctx->VertexProgram._Enabled) {
- for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) {
- /* _NEW_EVAL */
- if (ctx->Eval.Map1Attrib[attr])
- set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] );
-
- if (ctx->Eval.Map2Attrib[attr])
- set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] );
- }
- }
-
if (ctx->Eval.Map1Color4)
set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 );
@@ -125,6 +117,23 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec )
else if (ctx->Eval.Map2Vertex3)
set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 );
+ /* _NEW_PROGRAM */
+ if (ctx->VertexProgram._Enabled) {
+ /* These are the 16 evaluators which GL_NV_vertex_program defines.
+ * They alias and override the conventional vertex attributs.
+ */
+ for (attr = 0; attr < 16; attr++) {
+ /* _NEW_EVAL */
+ assert(attr < Elements(ctx->Eval.Map1Attrib));
+ if (ctx->Eval.Map1Attrib[attr])
+ set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] );
+
+ assert(attr < Elements(ctx->Eval.Map2Attrib));
+ if (ctx->Eval.Map2Attrib[attr])
+ set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] );
+ }
+ }
+
exec->eval.recalculate_maps = 0;
}