mesa: replace _mesa_problem() with assert() in hash table
[mesa.git] / src / mesa / main / marshal.h
index 3d104240afe5d5795cbe2352c67f8409a424c245..4842d27eebfcb06fbb9bd909cb02e5d1cd2cdb42 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "main/glthread.h"
 #include "main/context.h"
+#include "main/macros.h"
 
 struct marshal_cmd_base
 {
@@ -55,15 +56,16 @@ _mesa_glthread_allocate_command(struct gl_context *ctx,
 {
    struct glthread_state *glthread = ctx->GLThread;
    struct marshal_cmd_base *cmd_base;
+   const size_t aligned_size = ALIGN(size, 8);
 
    if (unlikely(glthread->batch->used + size > MARSHAL_MAX_CMD_SIZE))
       _mesa_glthread_flush_batch(ctx);
 
    cmd_base = (struct marshal_cmd_base *)
       &glthread->batch->buffer[glthread->batch->used];
-   glthread->batch->used += size;
+   glthread->batch->used += aligned_size;
    cmd_base->cmd_id = cmd_id;
-   cmd_base->cmd_size = size;
+   cmd_base->cmd_size = aligned_size;
    return cmd_base;
 }
 
@@ -197,6 +199,7 @@ _mesa_glthread_is_compat_bind_vertex_array(const struct gl_context *ctx)
    return ctx->API != API_OPENGL_CORE;
 }
 
+struct marshal_cmd_Enable;
 struct marshal_cmd_ShaderSource;
 struct marshal_cmd_Flush;
 struct marshal_cmd_BindBuffer;
@@ -204,6 +207,13 @@ struct marshal_cmd_BufferData;
 struct marshal_cmd_BufferSubData;
 struct marshal_cmd_ClearBufferfv;
 
+void
+_mesa_unmarshal_Enable(struct gl_context *ctx,
+                       const struct marshal_cmd_Enable *cmd);
+
+void GLAPIENTRY
+_mesa_marshal_Enable(GLenum cap);
+
 void GLAPIENTRY
 _mesa_marshal_ShaderSource(GLuint shader, GLsizei count,
                            const GLchar * const *string, const GLint *length);