From 541d07045b79cef52bdcf8bd1d90fc60793c9872 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Fri, 19 Oct 2018 20:39:21 +0200 Subject: GP: Redesign drawing cache to support particles Full redesign of the cache system used for drawing strokes and handle derived frame data. Before, the cache was saved in bGPdata and a hash was used to manage several objects with the same datablock. Old design made the use of particles very inefficient and prone to bugs and segment faults, and especially when this was mixed with onion skinning and multiple objects using same datablock. Also, there were some conflicts with the depsgrah logic (the old design was done before despgraph was in place) that made the use of hash not working. The new design saves the data in the object runtime struct and avoid the use of any hash to find the right data. This improves the speed and reduce a lot the complexity of the code, memory allocation, hash overload and adds full support for particles and reused datablocks. The particles can reuse the modifiers and shader effects of the original grease pencil object. --- source/blender/draw/DRW_engine.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/draw/DRW_engine.h') diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h index d61958931e5..f99ce1be894 100644 --- a/source/blender/draw/DRW_engine.h +++ b/source/blender/draw/DRW_engine.h @@ -128,6 +128,7 @@ void DRW_draw_depth_loop( /* grease pencil render */ void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph); +void DRW_gpencil_freecache(struct Object *ob); /* This is here because GPUViewport needs it */ void DRW_pass_free(struct DRWPass *pass); -- cgit v1.2.3