From 00dc7477022acdd969e4d709a235c0be819efa6c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Jul 2022 22:14:04 +1000 Subject: 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 --- source/blender/gpu/GPU_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/gpu/GPU_context.h') diff --git a/source/blender/gpu/GPU_context.h b/source/blender/gpu/GPU_context.h index 1fcd94c48fc..b04a4422baa 100644 --- a/source/blender/gpu/GPU_context.h +++ b/source/blender/gpu/GPU_context.h @@ -17,6 +17,7 @@ extern "C" { #endif +bool GPU_backend_init_once(void); void GPU_backend_init(eGPUBackendType backend); void GPU_backend_exit(void); bool GPU_backend_supported(eGPUBackendType type); -- cgit v1.2.3