diff options
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_engine.h')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.h | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index bc83136fece..6c2c9583979 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -35,6 +35,10 @@ struct RenderLayer; struct bGPDstroke; struct tGPspoint; +struct GPUBatch; +struct GPUVertBuf; +struct GPUVertFormat; + #define GPENCIL_CACHE_BLOCK_SIZE 8 #define GPENCIL_MAX_SHGROUPS 65536 #define GPENCIL_GROUPS_BLOCK_SIZE 1024 @@ -46,23 +50,6 @@ struct tGPspoint; #define GPENCIL_COLOR_TEXTURE 1 #define GPENCIL_COLOR_PATTERN 2 -#define GP_SIMPLIFY(scene) ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ENABLE)) -#define GP_SIMPLIFY_ONPLAY(playing) \ - (((playing == true) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY)) || \ - ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY) == 0)) -#define GP_SIMPLIFY_FILL(scene, playing) \ - ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ - (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL))) -#define GP_SIMPLIFY_MODIF(scene, playing) \ - ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ - (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_MODIFIER))) -#define GP_SIMPLIFY_FX(scene, playing) \ - ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ - (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FX))) -#define GP_SIMPLIFY_BLEND(scene, playing) \ - ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(scene)) && \ - (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_BLEND))) - #define GP_IS_CAMERAVIEW ((rv3d != NULL) && (rv3d->persp == RV3D_CAMOB && v3d->camera)) /* *********** OBJECTS CACHE *********** */ @@ -341,13 +328,13 @@ typedef struct GPENCIL_e_data { } GPENCIL_e_data; /* Engine data */ -/* GPUBatch Cache */ +/* GPUBatch Cache Element */ typedef struct GpencilBatchCacheElem { GPUBatch *batch; GPUVertBuf *vbo; int vbo_len; /* attr ids */ - GPUVertFormat format; + GPUVertFormat *format; uint pos_id; uint color_id; uint thickness_id; @@ -358,6 +345,7 @@ typedef struct GpencilBatchCacheElem { int tot_vertex; } GpencilBatchCacheElem; +/* Defines each batch group to define later the shgroup */ typedef struct GpencilBatchGroup { struct bGPDlayer *gpl; /* reference to original layer */ struct bGPDframe *gpf; /* reference to original frame */ @@ -375,6 +363,7 @@ typedef enum GpencilBatchGroup_Type { eGpencilBatchGroupType_Edlin = 5, } GpencilBatchGroup_Type; +/* Runtime data for GPU and evaluated frames after applying modifiers */ typedef struct GpencilBatchCache { GpencilBatchCacheElem b_stroke; GpencilBatchCacheElem b_point; @@ -382,18 +371,19 @@ typedef struct GpencilBatchCache { GpencilBatchCacheElem b_edit; GpencilBatchCacheElem b_edlin; - /* settings to determine if cache is invalid */ + /** Cache is dirty */ bool is_dirty; + /** Edit mode flag */ bool is_editmode; + /** Last cache frame */ int cache_frame; - /* data with the shading groups */ - int grp_used; /* total groups in arrays */ - int grp_size; /* max size of the array */ - struct GpencilBatchGroup *grp_cache; /* array of elements */ - - int tot_layers; - struct bGPDframe *derived_array; /* runtime data created by modifiers */ + /** Total groups in arrays */ + int grp_used; + /** Max size of the array */ + int grp_size; + /** Array of cache elements */ + struct GpencilBatchGroup *grp_cache; } GpencilBatchCache; /* general drawing functions */ |