Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Show First 20 Lines • Show All 2,424 Lines • ▼ Show 20 Lines | |||||
| void *WM_opengl_context_create(void) | void *WM_opengl_context_create(void) | ||||
| { | { | ||||
| /* On Windows there is a problem creating contexts that share lists | /* On Windows there is a problem creating contexts that share lists | ||||
| * from one context that is current in another thread. | * from one context that is current in another thread. | ||||
| * So we should call this function only on the main thread. | * So we should call this function only on the main thread. | ||||
| */ | */ | ||||
| BLI_assert(BLI_thread_is_main()); | BLI_assert(BLI_thread_is_main()); | ||||
| return WM_opengl_context_create_from_thread(); | |||||
| } | |||||
| /* Special version of OpenGL context creation which allows context to be created from non-main | |||||
| * thread. | |||||
| * The caller takes a risk of possible driver quirks which might make certain resources not shared | |||||
| * across different contexts. */ | |||||
| void *WM_opengl_context_create_from_thread(void) | |||||
| { | |||||
| BLI_assert(GPU_framebuffer_active_get() == GPU_framebuffer_back_get()); | BLI_assert(GPU_framebuffer_active_get() == GPU_framebuffer_back_get()); | ||||
| GHOST_GLSettings glSettings = {0}; | GHOST_GLSettings glSettings = {0}; | ||||
| if (G.debug & G_DEBUG_GPU) { | if (G.debug & G_DEBUG_GPU) { | ||||
| glSettings.flags |= GHOST_glDebugContext; | glSettings.flags |= GHOST_glDebugContext; | ||||
| } | } | ||||
| return GHOST_CreateOpenGLContext(g_system, glSettings); | return GHOST_CreateOpenGLContext(g_system, glSettings); | ||||
| } | } | ||||
| Show All 30 Lines | |||||