summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/marshal.c')
-rw-r--r--src/mesa/main/marshal.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mesa/main/marshal.c b/src/mesa/main/marshal.c
index c0760d25518..14577dd4cb4 100644
--- a/src/mesa/main/marshal.c
+++ b/src/mesa/main/marshal.c
@@ -31,6 +31,39 @@
#include "dispatch.h"
#include "marshal_generated.h"
+struct marshal_cmd_Flush
+{
+ struct marshal_cmd_base cmd_base;
+};
+
+
+void
+_mesa_unmarshal_Flush(struct gl_context *ctx,
+ const struct marshal_cmd_Flush *cmd)
+{
+ CALL_Flush(ctx->CurrentServerDispatch, ());
+}
+
+
+void GLAPIENTRY
+_mesa_marshal_Flush(void)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct marshal_cmd_Flush *cmd =
+ _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Flush,
+ sizeof(struct marshal_cmd_Flush));
+ (void) cmd;
+ _mesa_post_marshal_hook(ctx);
+
+ /* Flush() needs to be handled specially. In addition to telling the
+ * background thread to flush, we need to ensure that our own buffer is
+ * submitted to the background thread so that it will complete in a finite
+ * amount of time.
+ */
+ _mesa_glthread_flush_batch(ctx);
+}
+
+
struct marshal_cmd_ShaderSource
{
struct marshal_cmd_base cmd_base;