[Bf-blender-cvs] [c73be23e176] master: Revert "Fix T89204: slow repeated rendering with GPUOffscreen.draw_view3d"

Brecht Van Lommel noreply at git.blender.org
Thu Jun 17 02:07:00 CEST 2021


Commit: c73be23e176272da78b38f733fd56af09ebd7acf
Author: Brecht Van Lommel
Date:   Thu Jun 17 02:06:26 2021 +0200
Branches: master
https://developer.blender.org/rBc73be23e176272da78b38f733fd56af09ebd7acf

Revert "Fix T89204: slow repeated rendering with GPUOffscreen.draw_view3d"

This reverts commit d03b26edbdc3a9fe87fde44bd8db8c4a67a36757. There is some
refresh issue that needs to be solved before this can be enabled.

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

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

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

diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c
index 1ccac003e97..0d29bc98a31 100644
--- a/source/blender/python/gpu/gpu_py_offscreen.c
+++ b/source/blender/python/gpu/gpu_py_offscreen.c
@@ -44,7 +44,6 @@
 #include "GPU_context.h"
 #include "GPU_framebuffer.h"
 #include "GPU_texture.h"
-#include "GPU_viewport.h"
 
 #include "ED_view3d.h"
 #include "ED_view3d_offscreen.h"
@@ -343,10 +342,6 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar
 
   GPU_offscreen_bind(self->ofs, true);
 
-  if (!self->viewport) {
-    self->viewport = GPU_viewport_create();
-  }
-
   ED_view3d_draw_offscreen(depsgraph,
                            scene,
                            v3d->shading.type,
@@ -362,7 +357,7 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar
                            false,
                            true,
                            self->ofs,
-                           self->viewport);
+                           NULL);
 
   GPU_offscreen_unbind(self->ofs, true);
 
@@ -383,10 +378,6 @@ static PyObject *pygpu_offscreen_free(BPyGPUOffScreen *self)
 {
   BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
 
-  if (self->viewport) {
-    GPU_viewport_free(self->viewport);
-    self->viewport = NULL;
-  }
   GPU_offscreen_free(self->ofs);
   self->ofs = NULL;
   Py_RETURN_NONE;
@@ -395,9 +386,6 @@ static PyObject *pygpu_offscreen_free(BPyGPUOffScreen *self)
 
 static void BPyGPUOffScreen__tp_dealloc(BPyGPUOffScreen *self)
 {
-  if (self->viewport) {
-    GPU_viewport_free(self->viewport);
-  }
   if (self->ofs) {
     GPU_offscreen_free(self->ofs);
   }
@@ -468,7 +456,6 @@ PyObject *BPyGPUOffScreen_CreatePyObject(GPUOffScreen *ofs)
 
   self = PyObject_New(BPyGPUOffScreen, &BPyGPUOffScreen_Type);
   self->ofs = ofs;
-  self->viewport = NULL;
 
   return (PyObject *)self;
 }
diff --git a/source/blender/python/gpu/gpu_py_offscreen.h b/source/blender/python/gpu/gpu_py_offscreen.h
index 203c8c69f73..f551730cf54 100644
--- a/source/blender/python/gpu/gpu_py_offscreen.h
+++ b/source/blender/python/gpu/gpu_py_offscreen.h
@@ -26,12 +26,8 @@ extern PyTypeObject BPyGPUOffScreen_Type;
 
 #define BPyGPUOffScreen_Check(v) (Py_TYPE(v) == &BPyGPUOffScreen_Type)
 
-struct GPUOffscreen;
-struct GPUViewport;
-
 typedef struct BPyGPUOffScreen {
   PyObject_HEAD struct GPUOffScreen *ofs;
-  struct GPUViewport *viewport;
 } BPyGPUOffScreen;
 
 PyObject *BPyGPUOffScreen_CreatePyObject(struct GPUOffScreen *ofs) ATTR_NONNULL(1);



More information about the Bf-blender-cvs mailing list