diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-15 19:58:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-15 20:11:07 +0300 |
commit | 92a99c14965905e73f049bc1f92b597a903977fc (patch) | |
tree | f89d8ab851399e9bd7c10bd6b79af8fca1ae86f9 /source/blender/windowmanager/intern | |
parent | 5152c7c152e52d563cbd3ba3c792de3af0c2c14f (diff) |
Fix Eevee backround render crash after recent changes from D15463
Backend initialization needs to be delayed until after the OpenGL context
is created. This worked fine in foreground mode because the OpenGL context
already exists for the window at the point GPU_backend_init_once was called,
but not for background mode.
Create the backend just in time in GPU_context_create as before, and
automatically free it when the last context id discarded. But check if any
GPU backend is supported before creating the OpenGL context.
Ref D15463, D15465
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_init_exit.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 7324abfd096..7f5ec77e16d 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -169,7 +169,7 @@ void WM_init_opengl(void) wm_ghost_init(NULL); } - if (!GPU_backend_init_once()) { + if (!GPU_backend_supported()) { return; } @@ -613,7 +613,6 @@ void WM_exit_ex(bContext *C, const bool do_python) else { UI_exit(); } - GPU_backend_exit(); BKE_blender_userdef_data_free(&U, false); |