Mesa (master): vbo: move vp_mode enum to vbo_exec.h, use enum instead of GLuint

Brian Paul brianp at kemper.freedesktop.org
Thu May 21 22:12:22 UTC 2009


Module: Mesa
Branch: master
Commit: a1f6f82e829d14a9b730f1761ebfc11b4409cb51
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a1f6f82e829d14a9b730f1761ebfc11b4409cb51

Author: Brian Paul <brianp at vmware.com>
Date:   Thu May 21 09:50:55 2009 -0600

vbo: move vp_mode enum to vbo_exec.h, use enum instead of GLuint

---

 src/mesa/vbo/vbo_context.h |   12 ++++++------
 src/mesa/vbo/vbo_exec.h    |   10 ++++++++--
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/mesa/vbo/vbo_context.h b/src/mesa/vbo/vbo_context.h
index bf405eb..1d5e929 100644
--- a/src/mesa/vbo/vbo_context.h
+++ b/src/mesa/vbo/vbo_context.h
@@ -92,13 +92,13 @@ static INLINE struct vbo_context *vbo_context(GLcontext *ctx)
    return (struct vbo_context *)(ctx->swtnl_im);
 }
 
-enum {
-   VP_NONE = 1,
-   VP_NV,
-   VP_ARB
-};
 
-static INLINE GLuint get_program_mode( GLcontext *ctx )
+/**
+ * Return VP_x token to indicate whether we're running fixed-function
+ * vertex transformation, an NV vertex program or ARB vertex program/shader.
+ */
+static INLINE enum vp_mode
+get_program_mode( GLcontext *ctx )
 {
    if (!ctx->VertexProgram._Current)
       return VP_NONE;
diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h
index 100bb8a..e0f4489 100644
--- a/src/mesa/vbo/vbo_exec.h
+++ b/src/mesa/vbo/vbo_exec.h
@@ -48,6 +48,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define ERROR_ATTRIB 16
 
 
+/** Current vertex program mode */
+enum vp_mode {
+   VP_NONE,   /**< fixed function */
+   VP_NV,     /**< NV vertex program */
+   VP_ARB     /**< ARB vertex program or GLSL vertex shader */
+};
 
 
 struct vbo_exec_eval1_map {
@@ -103,7 +109,7 @@ struct vbo_exec_context
        * values are squashed down to the 32 attributes passed to the
        * vertex program below:
        */
-      GLuint program_mode;
+      enum vp_mode program_mode;
       GLuint enabled_flags;
       const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
    } vtx;
@@ -116,7 +122,7 @@ struct vbo_exec_context
    } eval;
 
    struct {
-      GLuint program_mode;
+      enum vp_mode program_mode;
       GLuint enabled_flags;
       GLuint array_obj;
 




More information about the mesa-commit mailing list