Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-04-12 12:49:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-04-12 12:51:14 +0300
commit0c9a2def8b1e40a0b5a3ed348d1fd92cc13096ff (patch)
tree8749b8080b9b02514cc7f9d08dab6391ce716844 /source/blender/draw/modes
parentb380f4927e30bc2877b4f3a760fefa0dfc3614e1 (diff)
Draw Engine: remove hard coded limit on array sizes
This removes MAX_STORAGE, MAX_BUFFERS, MAX_TEXTURES, MAX_PASSES limits. Actual memory saving isn't so important, it just means we don't need to manually bump these based on changes to engines.
Diffstat (limited to 'source/blender/draw/modes')
-rw-r--r--source/blender/draw/modes/edit_armature_mode.c11
-rw-r--r--source/blender/draw/modes/edit_curve_mode.c7
-rw-r--r--source/blender/draw/modes/edit_lattice_mode.c7
-rw-r--r--source/blender/draw/modes/edit_mesh_mode.c9
-rw-r--r--source/blender/draw/modes/edit_metaball_mode.c7
-rw-r--r--source/blender/draw/modes/edit_surface_mode.c7
-rw-r--r--source/blender/draw/modes/edit_text_mode.c7
-rw-r--r--source/blender/draw/modes/object_mode.c13
-rw-r--r--source/blender/draw/modes/paint_texture_mode.c7
-rw-r--r--source/blender/draw/modes/paint_vertex_mode.c7
-rw-r--r--source/blender/draw/modes/paint_weight_mode.c7
-rw-r--r--source/blender/draw/modes/particle_mode.c7
-rw-r--r--source/blender/draw/modes/pose_mode.c7
-rw-r--r--source/blender/draw/modes/sculpt_mode.c7
14 files changed, 49 insertions, 61 deletions
diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c
index 6111b9b160b..68e3112f03b 100644
--- a/source/blender/draw/modes/edit_armature_mode.c
+++ b/source/blender/draw/modes/edit_armature_mode.c
@@ -35,24 +35,22 @@
extern GlobalsUboStorage ts;
/* *********** LISTS *********** */
-/* keep it under MAX_PASSES */
typedef struct EDIT_ARMATURE_PassList {
struct DRWPass *bone_solid;
struct DRWPass *bone_wire;
struct DRWPass *relationship;
} EDIT_ARMATURE_PassList;
-/* keep it under MAX_STORAGE */
typedef struct EDIT_ARMATURE_StorageList {
struct g_data *g_data;
} EDIT_ARMATURE_StorageList;
typedef struct EDIT_ARMATURE_Data {
void *engine_type;
- void *fbl;
- void *txl;
+ char *fbl;
+ char *txl;
EDIT_ARMATURE_PassList *psl;
- void *stl;
+ EDIT_ARMATURE_StorageList *stl;
} EDIT_ARMATURE_Data;
/* *********** STATIC *********** */
@@ -126,9 +124,12 @@ void EDIT_ARMATURE_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize EDIT_ARMATURE_data_size = DRW_VIEWPORT_DATA_SIZE(EDIT_ARMATURE_Data);
+
DrawEngineType draw_engine_edit_armature_type = {
NULL, NULL,
N_("EditArmatureMode"),
+ &EDIT_ARMATURE_data_size,
NULL,
NULL,
&EDIT_ARMATURE_cache_init,
diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c
index 7a2bfa2792a..2cb03018254 100644
--- a/source/blender/draw/modes/edit_curve_mode.c
+++ b/source/blender/draw/modes/edit_curve_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and EDIT_CURVE_cache_init()
* for EDIT_CURVE_PassList */
-/* keep it under MAX_PASSES */
typedef struct EDIT_CURVE_PassList {
/* Declare all passes here and init them in
* EDIT_CURVE_cache_init().
@@ -54,14 +53,12 @@ typedef struct EDIT_CURVE_PassList {
struct DRWPass *pass;
} EDIT_CURVE_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct EDIT_CURVE_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} EDIT_CURVE_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct EDIT_CURVE_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct EDIT_CURVE_TextureList {
struct GPUTexture *texture;
} EDIT_CURVE_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct EDIT_CURVE_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -259,9 +255,12 @@ void EDIT_CURVE_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize EDIT_CURVE_data_size = DRW_VIEWPORT_DATA_SIZE(EDIT_CURVE_Data);
+
DrawEngineType draw_engine_edit_curve_type = {
NULL, NULL,
N_("EditCurveMode"),
+ &EDIT_CURVE_data_size,
&EDIT_CURVE_engine_init,
&EDIT_CURVE_engine_free,
&EDIT_CURVE_cache_init,
diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c
index 994682ecbed..ea5256b42a5 100644
--- a/source/blender/draw/modes/edit_lattice_mode.c
+++ b/source/blender/draw/modes/edit_lattice_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and EDIT_LATTICE_cache_init()
* for EDIT_LATTICE_PassList */
-/* keep it under MAX_PASSES */
typedef struct EDIT_LATTICE_PassList {
/* Declare all passes here and init them in
* EDIT_LATTICE_cache_init().
@@ -54,14 +53,12 @@ typedef struct EDIT_LATTICE_PassList {
struct DRWPass *pass;
} EDIT_LATTICE_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct EDIT_LATTICE_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} EDIT_LATTICE_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct EDIT_LATTICE_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct EDIT_LATTICE_TextureList {
struct GPUTexture *texture;
} EDIT_LATTICE_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct EDIT_LATTICE_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -257,9 +253,12 @@ void EDIT_LATTICE_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize EDIT_LATTICE_data_size = DRW_VIEWPORT_DATA_SIZE(EDIT_LATTICE_Data);
+
DrawEngineType draw_engine_edit_lattice_type = {
NULL, NULL,
N_("EditLatticeMode"),
+ &EDIT_LATTICE_data_size,
&EDIT_LATTICE_engine_init,
&EDIT_LATTICE_engine_free,
&EDIT_LATTICE_cache_init,
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c
index dc53ca44f25..08a6a6e778b 100644
--- a/source/blender/draw/modes/edit_mesh_mode.c
+++ b/source/blender/draw/modes/edit_mesh_mode.c
@@ -54,7 +54,6 @@ extern char datatoc_common_globals_lib_glsl[];
extern char datatoc_gpu_shader_uniform_color_frag_glsl[];
/* *********** LISTS *********** */
-/* keep it under MAX_PASSES */
typedef struct EDIT_MESH_PassList {
struct DRWPass *depth_hidden_wire;
struct DRWPass *edit_face_overlay;
@@ -64,18 +63,15 @@ typedef struct EDIT_MESH_PassList {
struct DRWPass *normals;
} EDIT_MESH_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct EDIT_MESH_FramebufferList {
struct GPUFrameBuffer *occlude_wire_fb;
} EDIT_MESH_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct EDIT_MESH_TextureList {
struct GPUTexture *occlude_wire_depth_tx;
struct GPUTexture *occlude_wire_color_tx;
} EDIT_MESH_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct EDIT_MESH_StorageList {
struct g_data *g_data;
} EDIT_MESH_StorageList;
@@ -85,7 +81,7 @@ typedef struct EDIT_MESH_Data {
EDIT_MESH_FramebufferList *fbl;
EDIT_MESH_TextureList *txl;
EDIT_MESH_PassList *psl;
- void *stl;
+ EDIT_MESH_StorageList *stl;
} EDIT_MESH_Data;
/* *********** STATIC *********** */
@@ -529,9 +525,12 @@ static void EDIT_MESH_engine_free(void)
DRW_shader_free(e_data.normals_sh);
}
+static const DrawEngineDataSize EDIT_MESH_data_size = DRW_VIEWPORT_DATA_SIZE(EDIT_MESH_Data);
+
DrawEngineType draw_engine_edit_mesh_type = {
NULL, NULL,
N_("EditMeshMode"),
+ &EDIT_MESH_data_size,
&EDIT_MESH_engine_init,
&EDIT_MESH_engine_free,
&EDIT_MESH_cache_init,
diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c
index d5cc2a0f07b..20d78fdffda 100644
--- a/source/blender/draw/modes/edit_metaball_mode.c
+++ b/source/blender/draw/modes/edit_metaball_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and EDIT_METABALL_cache_init()
* for EDIT_METABALL_PassList */
-/* keep it under MAX_PASSES */
typedef struct EDIT_METABALL_PassList {
/* Declare all passes here and init them in
* EDIT_METABALL_cache_init().
@@ -54,14 +53,12 @@ typedef struct EDIT_METABALL_PassList {
struct DRWPass *pass;
} EDIT_METABALL_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct EDIT_METABALL_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} EDIT_METABALL_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct EDIT_METABALL_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct EDIT_METABALL_TextureList {
struct GPUTexture *texture;
} EDIT_METABALL_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct EDIT_METABALL_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -257,9 +253,12 @@ void EDIT_METABALL_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize EDIT_METABALL_data_size = DRW_VIEWPORT_DATA_SIZE(EDIT_METABALL_Data);
+
DrawEngineType draw_engine_edit_metaball_type = {
NULL, NULL,
N_("EditMetaballMode"),
+ &EDIT_METABALL_data_size,
&EDIT_METABALL_engine_init,
&EDIT_METABALL_engine_free,
&EDIT_METABALL_cache_init,
diff --git a/source/blender/draw/modes/edit_surface_mode.c b/source/blender/draw/modes/edit_surface_mode.c
index d30cfb77f47..c09a10dcc91 100644
--- a/source/blender/draw/modes/edit_surface_mode.c
+++ b/source/blender/draw/modes/edit_surface_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and EDIT_SURFACE_cache_init()
* for EDIT_SURFACE_PassList */
-/* keep it under MAX_PASSES */
typedef struct EDIT_SURFACE_PassList {
/* Declare all passes here and init them in
* EDIT_SURFACE_cache_init().
@@ -54,14 +53,12 @@ typedef struct EDIT_SURFACE_PassList {
struct DRWPass *pass;
} EDIT_SURFACE_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct EDIT_SURFACE_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} EDIT_SURFACE_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct EDIT_SURFACE_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct EDIT_SURFACE_TextureList {
struct GPUTexture *texture;
} EDIT_SURFACE_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct EDIT_SURFACE_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -257,9 +253,12 @@ void EDIT_SURFACE_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize EDIT_SURFACE_data_size = DRW_VIEWPORT_DATA_SIZE(EDIT_SURFACE_Data);
+
DrawEngineType draw_engine_edit_surface_type = {
NULL, NULL,
N_("EditSurfaceMode"),
+ &EDIT_SURFACE_data_size,
&EDIT_SURFACE_engine_init,
&EDIT_SURFACE_engine_free,
&EDIT_SURFACE_cache_init,
diff --git a/source/blender/draw/modes/edit_text_mode.c b/source/blender/draw/modes/edit_text_mode.c
index fc11ed90ea7..f105e2d316c 100644
--- a/source/blender/draw/modes/edit_text_mode.c
+++ b/source/blender/draw/modes/edit_text_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and EDIT_TEXT_cache_init()
* for EDIT_TEXT_PassList */
-/* keep it under MAX_PASSES */
typedef struct EDIT_TEXT_PassList {
/* Declare all passes here and init them in
* EDIT_TEXT_cache_init().
@@ -54,14 +53,12 @@ typedef struct EDIT_TEXT_PassList {
struct DRWPass *pass;
} EDIT_TEXT_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct EDIT_TEXT_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} EDIT_TEXT_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct EDIT_TEXT_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct EDIT_TEXT_TextureList {
struct GPUTexture *texture;
} EDIT_TEXT_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct EDIT_TEXT_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -257,9 +253,12 @@ void EDIT_TEXT_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize EDIT_TEXT_data_size = DRW_VIEWPORT_DATA_SIZE(EDIT_TEXT_Data);
+
DrawEngineType draw_engine_edit_text_type = {
NULL, NULL,
N_("EditTextMode"),
+ &EDIT_TEXT_data_size,
&EDIT_TEXT_engine_init,
&EDIT_TEXT_engine_free,
&EDIT_TEXT_cache_init,
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 8e9d328cecf..ad4da8870f2 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -60,7 +60,6 @@ extern char datatoc_object_grid_vert_glsl[];
extern char datatoc_common_globals_lib_glsl[];
/* *********** LISTS *********** */
-/* keep it under MAX_PASSES */
typedef struct OBJECT_PassList {
struct DRWPass *non_meshes;
struct DRWPass *ob_center;
@@ -78,30 +77,27 @@ typedef struct OBJECT_PassList {
struct DRWPass *bone_wire;
} OBJECT_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct OBJECT_FramebufferList {
struct GPUFrameBuffer *outlines;
struct GPUFrameBuffer *blur;
} OBJECT_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct OBJECT_TextureList {
struct GPUTexture *outlines_depth_tx;
struct GPUTexture *outlines_color_tx;
struct GPUTexture *outlines_blur_tx;
} OBJECT_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct OBJECT_StorageList {
struct g_data *g_data;
} OBJECT_StorageList;
typedef struct OBJECT_Data {
void *engine_type;
- void *fbl;
- void *txl;
+ OBJECT_FramebufferList *fbl;
+ OBJECT_TextureList *txl;
OBJECT_PassList *psl;
- void *stl;
+ OBJECT_StorageList *stl;
} OBJECT_Data;
/* *********** STATIC *********** */
@@ -1218,9 +1214,12 @@ void OBJECT_collection_settings_create(IDProperty *props)
BKE_collection_engine_property_add_int(props, "show_backface_culling", false);
}
+static const DrawEngineDataSize OBJECT_data_size = DRW_VIEWPORT_DATA_SIZE(OBJECT_Data);
+
DrawEngineType draw_engine_object_type = {
NULL, NULL,
N_("ObjectMode"),
+ &OBJECT_data_size,
&OBJECT_engine_init,
&OBJECT_engine_free,
&OBJECT_cache_init,
diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c
index a795727e816..06799e549e5 100644
--- a/source/blender/draw/modes/paint_texture_mode.c
+++ b/source/blender/draw/modes/paint_texture_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and PAINT_TEXTURE_cache_init()
* for PAINT_TEXTURE_PassList */
-/* keep it under MAX_PASSES */
typedef struct PAINT_TEXTURE_PassList {
/* Declare all passes here and init them in
* PAINT_TEXTURE_cache_init().
@@ -54,14 +53,12 @@ typedef struct PAINT_TEXTURE_PassList {
struct DRWPass *pass;
} PAINT_TEXTURE_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct PAINT_TEXTURE_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} PAINT_TEXTURE_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct PAINT_TEXTURE_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct PAINT_TEXTURE_TextureList {
struct GPUTexture *texture;
} PAINT_TEXTURE_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct PAINT_TEXTURE_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -257,9 +253,12 @@ void PAINT_TEXTURE_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize PAINT_TEXTURE_data_size = DRW_VIEWPORT_DATA_SIZE(PAINT_TEXTURE_Data);
+
DrawEngineType draw_engine_paint_texture_type = {
NULL, NULL,
N_("PaintTextureMode"),
+ &PAINT_TEXTURE_data_size,
&PAINT_TEXTURE_engine_init,
&PAINT_TEXTURE_engine_free,
&PAINT_TEXTURE_cache_init,
diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c
index cd72881357f..61bd376072f 100644
--- a/source/blender/draw/modes/paint_vertex_mode.c
+++ b/source/blender/draw/modes/paint_vertex_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and PAINT_VERTEX_cache_init()
* for PAINT_VERTEX_PassList */
-/* keep it under MAX_PASSES */
typedef struct PAINT_VERTEX_PassList {
/* Declare all passes here and init them in
* PAINT_VERTEX_cache_init().
@@ -54,14 +53,12 @@ typedef struct PAINT_VERTEX_PassList {
struct DRWPass *pass;
} PAINT_VERTEX_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct PAINT_VERTEX_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} PAINT_VERTEX_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct PAINT_VERTEX_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct PAINT_VERTEX_TextureList {
struct GPUTexture *texture;
} PAINT_VERTEX_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct PAINT_VERTEX_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -257,9 +253,12 @@ void PAINT_VERTEX_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize PAINT_VERTEX_data_size = DRW_VIEWPORT_DATA_SIZE(PAINT_VERTEX_Data);
+
DrawEngineType draw_engine_paint_vertex_type = {
NULL, NULL,
N_("PaintVertexMode"),
+ &PAINT_VERTEX_data_size,
&PAINT_VERTEX_engine_init,
&PAINT_VERTEX_engine_free,
&PAINT_VERTEX_cache_init,
diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c
index 4e5bcd7e042..fa02ac3f3d8 100644
--- a/source/blender/draw/modes/paint_weight_mode.c
+++ b/source/blender/draw/modes/paint_weight_mode.c
@@ -46,7 +46,6 @@ extern struct GlobalsUboStorage ts; /* draw_common.c */
* initialize most of them and PAINT_WEIGHT_cache_init()
* for PAINT_WEIGHT_PassList */
-/* keep it under MAX_PASSES */
typedef struct PAINT_WEIGHT_PassList {
/* Declare all passes here and init them in
* PAINT_WEIGHT_cache_init().
@@ -54,14 +53,12 @@ typedef struct PAINT_WEIGHT_PassList {
struct DRWPass *pass;
} PAINT_WEIGHT_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct PAINT_WEIGHT_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} PAINT_WEIGHT_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct PAINT_WEIGHT_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -69,7 +66,6 @@ typedef struct PAINT_WEIGHT_TextureList {
struct GPUTexture *texture;
} PAINT_WEIGHT_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct PAINT_WEIGHT_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -254,9 +250,12 @@ void PAINT_WEIGHT_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize PAINT_WEIGHT_data_size = DRW_VIEWPORT_DATA_SIZE(PAINT_WEIGHT_Data);
+
DrawEngineType draw_engine_paint_weight_type = {
NULL, NULL,
N_("PaintWeightMode"),
+ &PAINT_WEIGHT_data_size,
&PAINT_WEIGHT_engine_init,
&PAINT_WEIGHT_engine_free,
&PAINT_WEIGHT_cache_init,
diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c
index 2fa32946196..e51be560476 100644
--- a/source/blender/draw/modes/particle_mode.c
+++ b/source/blender/draw/modes/particle_mode.c
@@ -40,7 +40,6 @@
* initialize most of them and PARTICLE_cache_init()
* for PARTICLE_PassList */
-/* keep it under MAX_PASSES */
typedef struct PARTICLE_PassList {
/* Declare all passes here and init them in
* PARTICLE_cache_init().
@@ -48,14 +47,12 @@ typedef struct PARTICLE_PassList {
struct DRWPass *pass;
} PARTICLE_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct PARTICLE_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} PARTICLE_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct PARTICLE_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -63,7 +60,6 @@ typedef struct PARTICLE_TextureList {
struct GPUTexture *texture;
} PARTICLE_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct PARTICLE_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -252,9 +248,12 @@ void PARTICLE_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize PARTICLE_data_size = DRW_VIEWPORT_DATA_SIZE(PARTICLE_Data);
+
DrawEngineType draw_engine_particle_type = {
NULL, NULL,
N_("ParticleMode"),
+ &PARTICLE_data_size,
&PARTICLE_engine_init,
&PARTICLE_engine_free,
&PARTICLE_cache_init,
diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c
index e779e2f4ca3..390becf2d91 100644
--- a/source/blender/draw/modes/pose_mode.c
+++ b/source/blender/draw/modes/pose_mode.c
@@ -40,7 +40,6 @@
* initialize most of them and POSE_cache_init()
* for POSE_PassList */
-/* keep it under MAX_PASSES */
typedef struct POSE_PassList {
/* Declare all passes here and init them in
* POSE_cache_init().
@@ -48,14 +47,12 @@ typedef struct POSE_PassList {
struct DRWPass *pass;
} POSE_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct POSE_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} POSE_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct POSE_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -63,7 +60,6 @@ typedef struct POSE_TextureList {
struct GPUTexture *texture;
} POSE_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct POSE_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -252,9 +248,12 @@ void POSE_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize POSE_data_size = DRW_VIEWPORT_DATA_SIZE(POSE_Data);
+
DrawEngineType draw_engine_pose_type = {
NULL, NULL,
N_("PoseMode"),
+ &POSE_data_size,
&POSE_engine_init,
&POSE_engine_free,
&POSE_cache_init,
diff --git a/source/blender/draw/modes/sculpt_mode.c b/source/blender/draw/modes/sculpt_mode.c
index 2fdd240ca79..14140ae6711 100644
--- a/source/blender/draw/modes/sculpt_mode.c
+++ b/source/blender/draw/modes/sculpt_mode.c
@@ -40,7 +40,6 @@
* initialize most of them and SCULPT_cache_init()
* for SCULPT_PassList */
-/* keep it under MAX_PASSES */
typedef struct SCULPT_PassList {
/* Declare all passes here and init them in
* SCULPT_cache_init().
@@ -48,14 +47,12 @@ typedef struct SCULPT_PassList {
struct DRWPass *pass;
} SCULPT_PassList;
-/* keep it under MAX_BUFFERS */
typedef struct SCULPT_FramebufferList {
/* Contains all framebuffer objects needed by this engine.
* Only contains (GPUFrameBuffer *) */
struct GPUFrameBuffer *fb;
} SCULPT_FramebufferList;
-/* keep it under MAX_TEXTURES */
typedef struct SCULPT_TextureList {
/* Contains all framebuffer textures / utility textures
* needed by this engine. Only viewport specific textures
@@ -63,7 +60,6 @@ typedef struct SCULPT_TextureList {
struct GPUTexture *texture;
} SCULPT_TextureList;
-/* keep it under MAX_STORAGE */
typedef struct SCULPT_StorageList {
/* Contains any other memory block that the engine needs.
* Only directly MEM_(m/c)allocN'ed blocks because they are
@@ -251,9 +247,12 @@ void SCULPT_collection_settings_create(CollectionEngineSettings *ces)
}
#endif
+static const DrawEngineDataSize SCULPT_data_size = DRW_VIEWPORT_DATA_SIZE(SCULPT_Data);
+
DrawEngineType draw_engine_sculpt_type = {
NULL, NULL,
N_("SculptMode"),
+ &SCULPT_data_size,
&SCULPT_engine_init,
&SCULPT_engine_free,
&SCULPT_cache_init,