Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-06-11 12:49:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-06-11 14:55:02 +0300
commit128926a41b368e166af63515370d9c9367e3dda2 (patch)
tree54eb6a813e6e8afab6d76e65b24f597bd399af1e /source/blender/draw/intern/draw_manager.c
parent1463ec68962380b015d7cbf3f65eadbd06ff3c4a (diff)
GHOST: Delay opengl context initialization
This way they can be init in their owner thread. Contexts should not be shared accross threads. Once you make a context active on a thread it is owned by the thread. This commit only have the GLX backend updated but should not break orther platform.
Diffstat (limited to 'source/blender/draw/intern/draw_manager.c')
-rw-r--r--source/blender/draw/intern/draw_manager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 65702a65541..5f059f92d5f 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2160,6 +2160,8 @@ void DRW_opengl_context_create(void)
}
/* This changes the active context. */
DST.gl_context = WM_opengl_context_create();
+ /* Make the context active for this thread (main thread) */
+ WM_opengl_context_activate(DST.gl_context);
/* Be sure to create gawain.context too. */
DST.gwn_context = GWN_context_create();
if (!G.background) {