Merge commit 'origin/gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / main / dlist.c
index cafe8072ee04253e8389f657748611feeb065377..c7db435506e8a043c9df59267eb0d52c7fe0071d 100644 (file)
@@ -41,7 +41,6 @@
 #endif
 #include "arrayobj.h"
 #include "clip.h"
-#include "colormac.h"
 #include "colortab.h"
 #include "context.h"
 #include "convolve.h"
@@ -6796,6 +6795,11 @@ _mesa_EndList(void)
       _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
       return;
    }
+   
+   /* Call before emitting END_OF_LIST, in case the driver wants to
+    * emit opcodes itself.
+    */
+   ctx->Driver.EndList(ctx);
 
    (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
 
@@ -6809,8 +6813,6 @@ _mesa_EndList(void)
    if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
       mesa_print_display_list(ctx->ListState.CurrentListNum);
 
-   ctx->Driver.EndList(ctx);
-
    ctx->ListState.CurrentList = NULL;
    ctx->ListState.CurrentListNum = 0;
    ctx->ListState.CurrentListPtr = NULL;