#ifndef _GLTHREAD_H
#define _GLTHREAD_H
-#ifdef HAVE_PTHREAD
+#include "main/mtypes.h"
+
+/* Command size is a number of bytes stored in a short. */
+#define MARSHAL_MAX_CMD_SIZE 65535
#include <inttypes.h>
#include <stdbool.h>
#include <pthread.h>
-#include "main/mtypes.h"
enum marshal_dispatch_cmd_id;
-/* Command size is a number of bytes stored in a short. */
-#define MARSHAL_MAX_CMD_SIZE 65535
-
struct glthread_state
{
/** The worker thread that asynchronously processes our GL commands. */
* be accessed.
*/
struct glthread_batch *batch;
+
+ /**
+ * Tracks on the main thread side whether the current vertex array binding
+ * is in a VBO.
+ */
+ bool vertex_array_is_vbo;
+
+ /**
+ * Tracks on the main thread side whether the current element array (index
+ * buffer) binding is in a VBO.
+ */
+ bool element_array_is_vbo;
};
/**
struct glthread_batch *next;
/**
- * Points to the first command in the batch.
+ * Amount of data used by batch commands, in bytes.
*/
- uint8_t *buffer;
+ size_t used;
/**
- * Amount of data used by batch commands, in bytes.
+ * Data contained in the command buffer.
*/
- size_t used;
+ uint8_t buffer[MARSHAL_MAX_CMD_SIZE];
};
void _mesa_glthread_init(struct gl_context *ctx);
void _mesa_glthread_destroy(struct gl_context *ctx);
+void _mesa_glthread_restore_dispatch(struct gl_context *ctx);
void _mesa_glthread_flush_batch(struct gl_context *ctx);
void _mesa_glthread_finish(struct gl_context *ctx);
-#else /* HAVE_PTHREAD */
-
-static inline void
-_mesa_glthread_init(struct gl_context *ctx)
-{
-}
-
-static inline void
-_mesa_glthread_destroy(struct gl_context *ctx)
-{
-}
-
-static inline void
-_mesa_glthread_finish(struct gl_context *ctx)
-{
-}
-#endif /* !HAVE_PTHREAD */
#endif /* _GLTHREAD_H*/