[Bf-blender-cvs] [db28a8b3d17] blender-v3.4-release: Fix T102322: Crash on exiting VR session when using DirectX backend
Peter Kim
noreply at git.blender.org
Wed Nov 23 02:21:51 CET 2022
Commit: db28a8b3d17d29738273e4b1e26c06d969ac61c0
Author: Peter Kim
Date: Wed Nov 23 10:21:17 2022 +0900
Branches: blender-v3.4-release
https://developer.blender.org/rBdb28a8b3d17d29738273e4b1e26c06d969ac61c0
Fix T102322: Crash on exiting VR session when using DirectX backend
This prevents Blender from crashing with an access violation when
stopping a VR session using the DirectX backend. The issue occurred for
any headset on Windows+Nvidia when using the SteamVR runtime and thus
affected a large number of users.
The workaround presented here is to simply skip unregistering the
shared resources on exit, as either of the calls to
`wglDXUnregisterObjectNV()` or `wglDXCloseDeviceNV()` will result in an
access violation. While not ideal, this avoids the crash and doesn't
present any issues when starting a new VR session.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D16569
===================================================================
M intern/ghost/intern/GHOST_ContextD3D.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_ContextD3D.cpp b/intern/ghost/intern/GHOST_ContextD3D.cpp
index 857323941ea..53bb73ba258 100644
--- a/intern/ghost/intern/GHOST_ContextD3D.cpp
+++ b/intern/ghost/intern/GHOST_ContextD3D.cpp
@@ -179,13 +179,14 @@ class GHOST_SharedOpenGLResource {
}
if (m_is_initialized) {
- if (m_shared.render_target
-#if 1
+#if 0 /* TODO: Causes an access violation since Blender 3.4 (a296b8f694d1). */
+ if (m_shared.render_target
+# if 1
/* TODO: #wglDXUnregisterObjectNV() causes an access violation on AMD when the shared
* resource is a GL texture. Since there is currently no good alternative, just skip
* unregistering the shared resource. */
&& !m_use_gl_texture2d
-#endif
+# endif
) {
wglDXUnregisterObjectNV(m_shared.device, m_shared.render_target);
}
@@ -199,6 +200,12 @@ class GHOST_SharedOpenGLResource {
else {
glDeleteRenderbuffers(1, &m_gl_render_target);
}
+#else
+ glDeleteFramebuffers(1, &m_shared.fbo);
+ if (m_use_gl_texture2d) {
+ glDeleteTextures(1, &m_gl_render_target);
+ }
+#endif
}
}
More information about the Bf-blender-cvs
mailing list