summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-02-09 19:44:56 +0000
committerDave Airlie <airlied@redhat.com>2012-02-28 10:32:26 +0000
commitfd4a3d463c103192311aacc04f5f871f4a1035df (patch)
tree0acd5cda659dcc41177c2a70133706e3551e28ef /src/mesa/vbo/vbo.h
parent4ffc8b9ae46dcdb01adedde3ebb60f0c6a22138b (diff)
downloadexternal_mesa3d-fd4a3d463c103192311aacc04f5f871f4a1035df.zip
external_mesa3d-fd4a3d463c103192311aacc04f5f871f4a1035df.tar.gz
external_mesa3d-fd4a3d463c103192311aacc04f5f871f4a1035df.tar.bz2
mesa/vbo: inline vbo_sizeof_ib_type.
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>
Diffstat (limited to 'src/mesa/vbo/vbo.h')
-rw-r--r--src/mesa/vbo/vbo.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index bf925ab..2d01d98 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -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,