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:
authorBrecht Van Lommel <brecht@blender.org>2022-07-15 19:58:35 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-07-15 20:11:07 +0300
commit92a99c14965905e73f049bc1f92b597a903977fc (patch)
treef89d8ab851399e9bd7c10bd6b79af8fca1ae86f9 /source/blender/gpu/GPU_context.h
parent5152c7c152e52d563cbd3ba3c792de3af0c2c14f (diff)
Fix Eevee backround render crash after recent changes from D15463
Backend initialization needs to be delayed until after the OpenGL context is created. This worked fine in foreground mode because the OpenGL context already exists for the window at the point GPU_backend_init_once was called, but not for background mode. Create the backend just in time in GPU_context_create as before, and automatically free it when the last context id discarded. But check if any GPU backend is supported before creating the OpenGL context. Ref D15463, D15465
Diffstat (limited to 'source/blender/gpu/GPU_context.h')
-rw-r--r--source/blender/gpu/GPU_context.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/gpu/GPU_context.h b/source/blender/gpu/GPU_context.h
index c81296093a1..9d92ea2cad9 100644
--- a/source/blender/gpu/GPU_context.h
+++ b/source/blender/gpu/GPU_context.h
@@ -17,14 +17,10 @@
extern "C" {
#endif
-/* GPU backends abstract the differences between different APIs. These must be
- * initialized before creating contexts, and deleted after the last context is
- * discarded. GPU_context_create automatically initializes a backend if none
- * exists yet. */
-bool GPU_backend_init_once(void);
-void GPU_backend_exit(void);
-bool GPU_backend_supported(eGPUBackendType type);
-
+/* GPU backends abstract the differences between different APIs. GPU_context_create
+ * automatically initializes the backend, and GPU_context_discard frees it when there
+ * are no more contexts. */
+bool GPU_backend_supported(void);
eGPUBackendType GPU_backend_get_type(void);
/** Opaque type hiding blender::gpu::Context. */