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:
authorCampbell Barton <ideasman42@gmail.com>2021-01-27 12:26:22 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-27 12:26:22 +0300
commit3f8816eb6a9253a43d9bc853df3460656ad1df53 (patch)
tree37391b8dc85d894bcbf876f7d23eda20db855ae3 /source/blender/python
parent75c426a60af024d4b85537cf2b26a57882282870 (diff)
parentea01c8c5f6ce5bf7df1af13795155f2dec473e0a (diff)
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/gpu/gpu_py_offscreen.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c
index 00d367c603b..51038aae598 100644
--- a/source/blender/python/gpu/gpu_py_offscreen.c
+++ b/source/blender/python/gpu/gpu_py_offscreen.c
@@ -247,6 +247,12 @@ static PyObject *py_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *args,
depsgraph = BKE_scene_ensure_depsgraph(G_MAIN, scene, view_layer);
+ /* Disable 'bgl' state since it interfere with off-screen drawing, see: T84402. */
+ const bool is_bgl = GPU_bgl_get();
+ if (is_bgl) {
+ GPU_bgl_end();
+ }
+
GPU_offscreen_bind(self->ofs, true);
ED_view3d_draw_offscreen(depsgraph,
@@ -267,6 +273,10 @@ static PyObject *py_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *args,
GPU_offscreen_unbind(self->ofs, true);
+ if (is_bgl) {
+ GPU_bgl_start();
+ }
+
Py_RETURN_NONE;
}