summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_manager.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-02-05 01:20:51 +0100
committerTimothy Arceri <[email protected]>2017-03-16 14:14:19 +1100
commitc83562ccaa5f4bd42f4f59c519b48faeb295e354 (patch)
treed997283ca998e8c737bcd667dde3acd3e03d0dfa /src/mesa/state_tracker/st_manager.c
parent93bdad3253cfa353cadf4444711c70f39e9baf09 (diff)
gallium: implement the backend of threaded GL dispatch
Acked-by: Timothy Arceri <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_manager.c')
-rw-r--r--src/mesa/state_tracker/st_manager.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index e663b017174..dad408a451e 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -29,6 +29,7 @@
#include "main/extensions.h"
#include "main/context.h"
#include "main/debug_output.h"
+#include "main/glthread.h"
#include "main/texobj.h"
#include "main/teximage.h"
#include "main/texstate.h"
@@ -629,6 +630,22 @@ st_context_destroy(struct st_context_iface *stctxi)
st_destroy_context(st);
}
+static void
+st_start_thread(struct st_context_iface *stctxi)
+{
+ struct st_context *st = (struct st_context *) stctxi;
+
+ _mesa_glthread_init(st->ctx);
+}
+
+static void
+st_thread_finish(struct st_context_iface *stctxi)
+{
+ struct st_context *st = (struct st_context *) stctxi;
+
+ _mesa_glthread_finish(st->ctx);
+}
+
static struct st_context_iface *
st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
const struct st_context_attribs *attribs,
@@ -723,6 +740,8 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
st->iface.teximage = st_context_teximage;
st->iface.copy = st_context_copy;
st->iface.share = st_context_share;
+ st->iface.start_thread = st_start_thread;
+ st->iface.thread_finish = st_thread_finish;
st->iface.st_context_private = (void *) smapi;
st->iface.cso_context = st->cso_context;
st->iface.pipe = st->pipe;