fix memory access error in vbo_bind_vertex_list
[mesa.git] / src / mesa / vbo / vbo_context.h
index 982da004378682c77786d8cfe1064113fc78c51a..013f81bdd5c8b891cc59d08f91e978f7173e5f11 100644 (file)
 #ifndef _VBO_CONTEXT_H
 #define _VBO_CONTEXT_H
 
+#include "vbo.h"
 #include "vbo_attrib.h"
 #include "vbo_save.h"
 #include "vbo_exec.h"
 
 
 struct vbo_context {
-   struct gl_client_array legacy_currval[16];
-   struct gl_client_array generic_currval[16];
-   struct gl_client_array mat_currval[16];
+   struct gl_client_array currval[VBO_ATTRIB_MAX];
+   
+   /* These point into the above.  TODO: remove. 
+    */
+   struct gl_client_array *legacy_currval;
+   struct gl_client_array *generic_currval;
+   struct gl_client_array *mat_currval;
 
    GLuint map_vp_none[32];
    GLuint map_vp_arb[32];
 
+   GLfloat *current[VBO_ATTRIB_MAX]; /* points into ctx->Current, ctx->Light.Material */
+   GLfloat CurrentFloatEdgeFlag;
+
+
    struct vbo_exec_context exec;
    struct vbo_save_context save;
 
    /* Callback into the driver.  This must always succeed, the driver
     * is responsible for initiating any fallback actions required:
     */
-   void (*draw_prims)( GLcontext *ctx,
-                      const struct gl_client_array *arrays[],
-                      const struct _mesa_prim *prims,
-                      GLuint nr_prims,
-                      const struct _mesa_index_buffer *ib,
-                      GLuint min_index,
-                      GLuint max_index );
+   vbo_draw_func draw_prims;
 };
 
 
@@ -93,9 +96,9 @@ enum {
 
 static INLINE GLuint get_program_mode( GLcontext *ctx )
 {
-   if (!ctx->VertexProgram._Enabled)
+   if (!ctx->VertexProgram._Current)
       return VP_NONE;
-   else if (ctx->VertexProgram.Current->IsNVProgram)
+   else if (ctx->VertexProgram._Current->IsNVProgram)
       return VP_NV;
    else
       return VP_ARB;