diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-04-21 21:53:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-04-22 14:44:06 +0300 |
commit | b2cc2dda9c37775b04b6a9b4e07a25a51c74c693 (patch) | |
tree | f784106a6952e9621a86529026feae6ea139f3f7 /source/blender/draw | |
parent | aba78caa11451d0e8a10088eb5ad6be42a591f5e (diff) |
Fix 3D viewport select using grease pencil engine when not needed
Other draw loops also avoid the overhead of grease pencil drawing when there
are no grease pencil objects in the scene. It's a little faster to skip those
shaders and buffer when not needed.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 09b9b63d07a..51222d833c2 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -2054,7 +2054,9 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph, } else if (!draw_surface) { /* grease pencil selection */ - use_drw_engine(&draw_engine_gpencil_type); + if (drw_gpencil_engine_needed(depsgraph, v3d)) { + use_drw_engine(&draw_engine_gpencil_type); + } drw_engines_enable_overlays(); } @@ -2062,7 +2064,9 @@ void DRW_draw_select_loop(struct Depsgraph *depsgraph, /* Draw surface for occlusion. */ drw_engines_enable_basic(); /* grease pencil selection */ - use_drw_engine(&draw_engine_gpencil_type); + if (drw_gpencil_engine_needed(depsgraph, v3d)) { + use_drw_engine(&draw_engine_gpencil_type); + } drw_engines_enable_overlays(); } |