[Bf-blender-cvs] [cd494087c1f] master: Fix crash when switching back from render preview.

Jeroen Bakker noreply at git.blender.org
Tue Dec 7 11:33:33 CET 2021


Commit: cd494087c1f214771d952d110ed2a1a685e7ec28
Author: Jeroen Bakker
Date:   Tue Dec 7 11:30:50 2021 +0100
Branches: master
https://developer.blender.org/rBcd494087c1f214771d952d110ed2a1a685e7ec28

Fix crash when switching back from render preview.

Issue is that external engine uses the gpu info. but overwrote the
instance data. The draw manager would then detect instance data and
required the engine type to have a instance free callback.

The solution is to save some space in the engine data to hold an empty
and unused instance_data attribute to comply with `ViewportEngineData`
struct.

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

M	source/blender/draw/engines/eevee/eevee_private.h
M	source/blender/draw/engines/external/external_engine.c

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

diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h
index f51b4fa0127..87f84ec584d 100644
--- a/source/blender/draw/engines/eevee/eevee_private.h
+++ b/source/blender/draw/engines/eevee/eevee_private.h
@@ -992,6 +992,8 @@ typedef struct EEVEE_Data {
   EEVEE_TextureList *txl;
   EEVEE_PassList *psl;
   EEVEE_StorageList *stl;
+  void *instance_data;
+
   char info[GPU_INFO_SIZE];
 } EEVEE_Data;
 
diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c
index 1877d3a4b43..1d899c3935b 100644
--- a/source/blender/draw/engines/external/external_engine.c
+++ b/source/blender/draw/engines/external/external_engine.c
@@ -88,6 +88,8 @@ typedef struct EXTERNAL_Data {
   EXTERNAL_TextureList *txl;
   EXTERNAL_PassList *psl;
   EXTERNAL_StorageList *stl;
+  void *instance_data;
+
   char info[GPU_INFO_SIZE];
 } EXTERNAL_Data;



More information about the Bf-blender-cvs mailing list