[Bf-blender-cvs] [fb88088203e] blender2.8: Preserve the actively bound framebuffer after using gpu.offscreen

Dalai Felinto noreply at git.blender.org
Thu Sep 20 23:43:25 CEST 2018


Commit: fb88088203ec478f4c06bd4b755d47492246759d
Author: Dalai Felinto
Date:   Thu Sep 20 21:41:30 2018 +0000
Branches: blender2.8
https://developer.blender.org/rBfb88088203ec478f4c06bd4b755d47492246759d

Preserve the actively bound framebuffer after using gpu.offscreen

Otherwise we cannot draw anything after drawing in the offscreen buffer

===================================================================

M	source/blender/python/gpu/gpu_py_offscreen.c

===================================================================

diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c
index fc1bc274845..866a98bbb9f 100644
--- a/source/blender/python/gpu/gpu_py_offscreen.c
+++ b/source/blender/python/gpu/gpu_py_offscreen.c
@@ -227,6 +227,8 @@ static PyObject *bpygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *a
 
 	rv3d_mats = ED_view3d_mats_rv3d_backup(ar->regiondata);
 
+	GPUFrameBuffer *active = GPU_framebuffer_active_get();
+
 	GPU_offscreen_bind(self->ofs, true); /* bind */
 
 	ED_view3d_draw_offscreen(depsgraph,
@@ -246,6 +248,7 @@ static PyObject *bpygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *a
 	                         NULL);
 
 	GPU_offscreen_unbind(self->ofs, true); /* unbind */
+	GPU_framebuffer_bind(active);
 
 	ED_view3d_mats_rv3d_restore(ar->regiondata, rv3d_mats);
 	MEM_freeN(rv3d_mats);



More information about the Bf-blender-cvs mailing list