From cd494087c1f214771d952d110ed2a1a685e7ec28 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 7 Dec 2021 11:30:50 +0100 Subject: 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. --- source/blender/draw/engines/eevee/eevee_private.h | 2 ++ source/blender/draw/engines/external/external_engine.c | 2 ++ 2 files changed, 4 insertions(+) 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; -- cgit v1.2.3