glthread: inline _mesa_unmarshal_dispatch_cmd and convert the switch to a table
[mesa.git] / src / mesa / main / marshal.h
index 63e0295576ef04fde2b5f44704873492404a9cbe..b2556ca98415ea9a4e0c135e7801a10fa3717a6a 100644 (file)
@@ -33,6 +33,7 @@
 #include "main/glthread.h"
 #include "main/context.h"
 #include "main/macros.h"
+#include "marshal_generated.h"
 
 struct marshal_cmd_base
 {
@@ -47,6 +48,9 @@ struct marshal_cmd_base
    uint16_t cmd_size;
 };
 
+typedef void (*_mesa_unmarshal_func)(struct gl_context *ctx, const void *cmd);
+extern const _mesa_unmarshal_func _mesa_unmarshal_dispatch[NUM_DISPATCH_CMD];
+
 static inline void *
 _mesa_glthread_allocate_command(struct gl_context *ctx,
                                 uint16_t cmd_id,
@@ -125,20 +129,9 @@ debug_print_marshal(const char *func)
 #endif
 }
 
-static inline void
-debug_print_unmarshal(const char *func)
-{
-#if DEBUG_MARSHAL_PRINT_CALLS
-   printf("unmarshal: %s\n", func);
-#endif
-}
-
 struct _glapi_table *
 _mesa_create_marshal_table(const struct gl_context *ctx);
 
-size_t
-_mesa_unmarshal_dispatch_cmd(struct gl_context *ctx, const void *cmd);
-
 static inline void
 _mesa_post_marshal_hook(struct gl_context *ctx)
 {