Fix T99706: Crash rendering with headless builds
When rendering with headless builds, show an error instead of crashing. Previously GPU_backend_init was called indirectly from DRW_opengl_context_create, a new function is now called from the window manager (GPU_backend_init_once), so it's possible to check if the GPU has a back-end. This also disables the `bgl` Python module when building WITH_HEADLESS. Reviewed By: fclem Ref D15463
This commit is contained in:
@@ -169,6 +169,10 @@ void WM_init_opengl(void)
|
||||
wm_ghost_init(NULL);
|
||||
}
|
||||
|
||||
if (!GPU_backend_init_once()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Needs to be first to have an OpenGL context bound. */
|
||||
DRW_opengl_context_create();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user