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:
authorJulian Eisel <julian@blender.org>2020-08-10 18:29:35 +0300
committerJulian Eisel <julian@blender.org>2020-08-10 18:39:36 +0300
commit9c093a5d9ac43a103f81d91f9f32ec5efccaff6a (patch)
tree2c9cd1006bd111c315b977ee5cc0bb985333ae91 /source/blender/windowmanager/xr/intern/wm_xr_intern.h
parentc0340ec89393055bbb0ba0432b9edb5d70b3711c (diff)
Fix T79324: Crash when changing View Layer while VR session runs
Proper handling of View Layers for the VR session was never implemented. Now the View Layer of the VR session follows the window the session was started in. Note that if this window is closed, we fallback to another window. This is done to avoid the overhead it would take to maintain a separate depsgraph for the VR view. Instead we always share some already visible View Layer (and hence the depsgraph).
Diffstat (limited to 'source/blender/windowmanager/xr/intern/wm_xr_intern.h')
-rw-r--r--source/blender/windowmanager/xr/intern/wm_xr_intern.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_intern.h b/source/blender/windowmanager/xr/intern/wm_xr_intern.h
index c49e9e534b6..25e3da3ffb4 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_intern.h
+++ b/source/blender/windowmanager/xr/intern/wm_xr_intern.h
@@ -49,7 +49,11 @@ typedef struct wmXrSessionState {
typedef struct wmXrRuntimeData {
GHOST_XrContextHandle context;
- /* Although this struct is internal, RNA gets a handle to this for state information queries. */
+ /** The window the session was started in. Stored to be able to follow its view-layer. This may
+ * be an invalid reference, i.e. the window may have been closed. */
+ wmWindow *session_root_win;
+
+ /** Although this struct is internal, RNA gets a handle to this for state information queries. */
wmXrSessionState session_state;
wmXrSessionExitFn exit_fn;
} wmXrRuntimeData;