Page MenuHome

Grease pencil slows down vertex painting
Closed, ResolvedPublic

Description

In the default startup .blend, painting on a cube, I see about 10% of time spent freeing grease pencil data.

This makes no sense because there are no grease pencil objects in the scene.

Details

Type
To Do

Event Timeline

Brecht Van Lommel (brecht) lowered the priority of this task from Needs Triage by Developer to Normal.Wed, Sep 18, 12:47 PM
Brecht Van Lommel (brecht) created this task.

I have been looking at the code and really is not doing anything, it's a group of DRW_TEXTURE_FREE_SAFE and all textures are NULL except one of 1x1 pixel. The problem here is the GPencil engine is enabled when no GPencil objects are in the scene, so the Engine_init, cache init/populate/finish and draw scene, free is called... and this is to do nothing. This uneeded call is creating the passes and a lot of things that we don't need.

Could be possible add a check in draw manager to not call GPencil engine at all if no GPencil objects in the scene?

Maybe there is no real overhead from grease pencil and it's just happens to be waiting for the graphics driver there.

But you can move the allocation and freeing of that 1x1 texture to GPENCIL_engine_init and GPENCIL_engine_free I think? No need to do it for every redraw.

Brecht Van Lommel (brecht) claimed this task.