diff options
author | Julian Eisel <julian@blender.org> | 2020-06-23 18:19:00 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-06-23 18:28:53 +0300 |
commit | 2dd60e6c2cbdf3e39ed3451ee0f67a5b00a7a5bc (patch) | |
tree | f49fd69364dfe0a045c6df0081f51d559cefb80a /source/blender/windowmanager/wm_surface.h | |
parent | 1e0426da7c735b5d59f23b2b9303d9c1d72ca7f8 (diff) |
Fix T77830: Crash in VR session when opening material preview
Draw-manager mutex has to be set before activating OpenGL/GPU context.
Otherwise, parallel jobs (like preview rendering) may try to activate
the context from another thread.
Also: Use WM wrappers for activating/releasing OpenGL context, which
have an additional assert check.
Suggest to backport this for 2.83.1.
Diffstat (limited to 'source/blender/windowmanager/wm_surface.h')
-rw-r--r-- | source/blender/windowmanager/wm_surface.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/wm_surface.h b/source/blender/windowmanager/wm_surface.h index e1b00ae1ade..bc1cc825e4b 100644 --- a/source/blender/windowmanager/wm_surface.h +++ b/source/blender/windowmanager/wm_surface.h @@ -38,6 +38,11 @@ typedef struct wmSurface { void (*draw)(struct bContext *); /** Free customdata, not the surface itself (done by wm_surface API) */ void (*free_data)(struct wmSurface *); + + /** Called when surface is activated for drawing (made drawable). */ + void (*activate)(void); + /** Called when surface is deactivated for drawing (current drawable cleared). */ + void (*deactivate)(void); } wmSurface; /* Create/Free */ |