diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-15 13:44:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-15 17:31:28 +0300 |
commit | 1cf465bbc3312ae8eac3e1ae573b716e0fad92cf (patch) | |
tree | 27f1c1ee17327e2d6b9775c17faf6a431d677651 /source/blender/gpu/opengl | |
parent | 5e1229f25387a90fe626b4b2ac34f2eb5c7dc23a (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/opengl')
-rw-r--r-- | source/blender/gpu/opengl/gl_backend.hh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/opengl/gl_backend.hh b/source/blender/gpu/opengl/gl_backend.hh index 29249111294..e425b87afe8 100644 --- a/source/blender/gpu/opengl/gl_backend.hh +++ b/source/blender/gpu/opengl/gl_backend.hh @@ -42,11 +42,15 @@ class GLBackend : public GPUBackend { } ~GLBackend() { - GLTexture::samplers_free(); - GLBackend::platform_exit(); } + void delete_resources() override + { + /* Delete any resources with context active. */ + GLTexture::samplers_free(); + } + static GLBackend *get() { return static_cast<GLBackend *>(GPUBackend::get()); |