vbo: minor optimisation in vbo_exec_DrawRangeElements
authorDave Airlie <airlied@redhat.com>
Wed, 22 Jun 2011 03:09:12 +0000 (13:09 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 14 Jul 2011 14:22:58 +0000 (15:22 +0100)
this moves getting the context into the debug in this function,

just spotted it trawling callgrind traces for other things.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/vbo/vbo_exec_array.c

index 7959337decb9ac2aec7f3dc4b1e477818ef44a1e..b908d5aea7e7f1c2233280b25d04811f235ab332 100644 (file)
@@ -972,13 +972,13 @@ static void GLAPIENTRY
 vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
                            GLsizei count, GLenum type, const GLvoid *indices)
 {
-   GET_CURRENT_CONTEXT(ctx);
-
-   if (MESA_VERBOSE & VERBOSE_DRAW)
+   if (MESA_VERBOSE & VERBOSE_DRAW) {
+      GET_CURRENT_CONTEXT(ctx);
       _mesa_debug(ctx,
                   "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n",
                   _mesa_lookup_enum_by_nr(mode), start, end, count,
                   _mesa_lookup_enum_by_nr(type), indices);
+   }
 
    vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
                                        indices, 0);