mesa/vbo: inline vbo_sizeof_ib_type.
authorDave Airlie <airlied@redhat.com>
Thu, 9 Feb 2012 19:44:56 +0000 (19:44 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 28 Feb 2012 10:32:26 +0000 (10:32 +0000)
Can't see any reason this wouldn't be better off as an inline.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/vbo/vbo.h
src/mesa/vbo/vbo_exec_array.c

index bf925ab..2d01d98 100644 (file)
@@ -123,8 +123,22 @@ void vbo_rebase_prims( struct gl_context *ctx,
                       GLuint max_index,
                       vbo_draw_func draw );
 
-int
-vbo_sizeof_ib_type(GLenum type);
+static inline int
+vbo_sizeof_ib_type(GLenum type)
+{
+   switch (type) {
+   case GL_UNSIGNED_INT:
+      return sizeof(GLuint);
+   case GL_UNSIGNED_SHORT:
+      return sizeof(GLushort);
+   case GL_UNSIGNED_BYTE:
+      return sizeof(GLubyte);
+   default:
+      assert(!"unsupported index data type");
+      /* In case assert is turned off */
+      return 0;
+   }
+}
 
 void
 vbo_get_minmax_indices(struct gl_context *ctx, const struct _mesa_prim *prim,
index 06e36a6..b0a4261 100644 (file)
@@ -75,22 +75,6 @@ vbo_check_buffers_are_unmapped(struct gl_context *ctx)
    assert(!_mesa_bufferobj_mapped(exec->vtx.bufferobj));
 }
 
-int
-vbo_sizeof_ib_type(GLenum type)
-{
-   switch (type) {
-   case GL_UNSIGNED_INT:
-      return sizeof(GLuint);
-   case GL_UNSIGNED_SHORT:
-      return sizeof(GLushort);
-   case GL_UNSIGNED_BYTE:
-      return sizeof(GLubyte);
-   default:
-      assert(!"unsupported index data type");
-      /* In case assert is turned off */
-      return 0;
-   }
-}
 
 
 /**