diff options
author | YimingWu <xp8110@outlook.com> | 2021-06-16 17:38:47 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2021-06-16 17:38:47 +0300 |
commit | 247abdbf4148843daf469285a6a63ab9cd0aeef9 (patch) | |
tree | 78a20d5175b09c83d907aaddef347536bf20aca8 /source/blender/makesdna/DNA_gpencil_modifier_types.h | |
parent | b37093de7b42cf331a4ae5830737d9972d7bb426 (diff) |
LineArt: Cached calculation for modifiers in the same stack.
This allows line art to run only once for each modifier stacks,
with an option to toggle a specific line art modifier should
use cache or re-do their own calculations.
Reviewed By: Sebastian Parborg (zeddb), Hans Goudey (HooglyBoogly)
Differential Revision: https://developer.blender.org/D11291
Diffstat (limited to 'source/blender/makesdna/DNA_gpencil_modifier_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_types.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 410212ce100..3977ad326da 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -878,6 +878,7 @@ typedef enum eLineArtGPencilModifierFlags { LRT_GPENCIL_MATCH_OUTPUT_VGROUP = (1 << 1), LRT_GPENCIL_BINARY_WEIGHTS = (1 << 2) /* Deprecated, this is removed for lack of use case. */, LRT_GPENCIL_IS_BAKED = (1 << 3), + LRT_GPENCIL_USE_CACHE = (1 << 4), } eLineArtGPencilModifierFlags; typedef enum eLineartGpencilTransparencyFlags { @@ -886,6 +887,8 @@ typedef enum eLineartGpencilTransparencyFlags { LRT_GPENCIL_TRANSPARENCY_MATCH = (1 << 1), } eLineartGpencilTransparencyFlags; +struct LineartCache; + typedef struct LineartGpencilModifierData { GpencilModifierData modifier; @@ -925,16 +928,24 @@ typedef struct LineartGpencilModifierData { /* CPU mode */ float chaining_image_threshold; - int _pad; - /* Ported from SceneLineArt flags. */ int calculation_flags; /* Additional Switches. */ int flags; - /* Runtime only. */ - void *render_buffer; + /* Runtime data. */ + + /* Because we can potentially only compute features lines once per modifier stack (Use Cache), we + * need to have these override values to ensure that we have the data we need is computed and + * stored in the cache. */ + char level_start_override; + char level_end_override; + short edge_types_override; + + struct LineartCache *cache; + /* Keep a pointer to the render buffer so we can call destroy from ModifierData. */ + struct LineartRenderBuffer *render_buffer_ptr; } LineartGpencilModifierData; |