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 13:44:35 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-07-15 17:31:28 +0300
commit1cf465bbc3312ae8eac3e1ae573b716e0fad92cf (patch)
tree27f1c1ee17327e2d6b9775c17faf6a431d677651 /source/blender/gpu/GPU_context.h
parent5e1229f25387a90fe626b4b2ac34f2eb5c7dc23a (diff)
Fix GPU backend deleting resources without an active context
This causes an assert with libepoxy, but was wrong already regardless. Refactor logic to work as follows: * GPU_exit() deletes backend resources * Destroy UI GPU resources with the context active * Call GPU_backend_exit() after deleting the context Ref D15291 Differential Revision: https://developer.blender.org/D15465
Diffstat (limited to 'source/blender/gpu/GPU_context.h')
-rw-r--r--source/blender/gpu/GPU_context.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_context.h b/source/blender/gpu/GPU_context.h
index b04a4422baa..c81296093a1 100644
--- a/source/blender/gpu/GPU_context.h
+++ b/source/blender/gpu/GPU_context.h
@@ -17,8 +17,11 @@
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_init(eGPUBackendType backend);
void GPU_backend_exit(void);
bool GPU_backend_supported(eGPUBackendType type);