[Mesa-dev] [PATCH v3 2/7] vbo: add _mesa_initialize_vbo_vtxfmt

Jordan Justen jordan.l.justen at intel.com
Mon Nov 19 17:01:31 PST 2012


This function initializes the exec/save dispatch tables
for VBO vtxfmt.

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/main/vtxfmt.c |   18 ++++++++++++++++++
 src/mesa/main/vtxfmt.h |    1 +
 2 files changed, 19 insertions(+)

diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c
index 5891a52..faa40c1 100644
--- a/src/mesa/main/vtxfmt.c
+++ b/src/mesa/main/vtxfmt.c
@@ -36,6 +36,7 @@
 #include "eval.h"
 #include "dlist.h"
 #include "main/dispatch.h"
+#include "vbo/vbo_context.h"
 
 
 /**
@@ -262,3 +263,20 @@ _mesa_install_save_vtxfmt(struct gl_context *ctx, const GLvertexformat *vfmt)
    if (_mesa_is_desktop_gl(ctx))
       install_vtxfmt( ctx, ctx->Save, vfmt );
 }
+
+
+/**
+ * Install VBO vtxfmt functions.
+ *
+ * This function depends on ctx->Version.
+ */
+void
+_mesa_initialize_vbo_vtxfmt(struct gl_context *ctx)
+{
+   struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
+   _mesa_install_exec_vtxfmt(ctx, &exec->vtxfmt);
+   if (ctx->API == API_OPENGL) {
+      _mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt);
+   }
+}
+
diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h
index 65a0e6c..16ffb6f 100644
--- a/src/mesa/main/vtxfmt.h
+++ b/src/mesa/main/vtxfmt.h
@@ -39,5 +39,6 @@
 
 extern void _mesa_install_exec_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt );
 extern void _mesa_install_save_vtxfmt( struct gl_context *ctx, const GLvertexformat *vfmt );
+extern void _mesa_initialize_vbo_vtxfmt(struct gl_context *ctx);
 
 #endif /* _VTXFMT_H_ */
-- 
1.7.10.4



More information about the mesa-dev mailing list