diff options
-rw-r--r-- | source/blender/draw/engines/clay/clay.c | 45 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee.c | 36 | ||||
-rw-r--r-- | source/blender/draw/intern/DRW_render.h | 12 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 18 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_armature_mode.c | 15 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_curve_mode.c | 37 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_lattice_mode.c | 37 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 21 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_metaball_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_surface_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_text_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 32 | ||||
-rw-r--r-- | source/blender/draw/modes/paint_texture_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/paint_vertex_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/paint_weight_mode.c | 31 | ||||
-rw-r--r-- | source/blender/draw/modes/particle_mode.c | 38 | ||||
-rw-r--r-- | source/blender/draw/modes/pose_mode.c | 38 | ||||
-rw-r--r-- | source/blender/draw/modes/sculpt_mode.c | 35 |
18 files changed, 268 insertions, 282 deletions
diff --git a/source/blender/draw/engines/clay/clay.c b/source/blender/draw/engines/clay/clay.c index 9a2cab12730..750e6f4ebfe 100644 --- a/source/blender/draw/engines/clay/clay.c +++ b/source/blender/draw/engines/clay/clay.c @@ -275,12 +275,11 @@ RenderEngineSettings *CLAY_render_settings_create(void) return (RenderEngineSettings *)settings; } -static void CLAY_engine_init(void) +static void CLAY_engine_init(void *vedata) { - CLAY_Data *ved = DRW_viewport_engine_data_get("Clay"); - CLAY_StorageList *stl = ved->stl; - CLAY_TextureList *txl = ved->txl; - CLAY_FramebufferList *fbl = ved->fbl; + CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl; + CLAY_TextureList *txl = ((CLAY_Data *)vedata)->txl; + CLAY_FramebufferList *fbl = ((CLAY_Data *)vedata)->fbl; /* Create Texture Array */ if (!e_data.matcap_array) { @@ -433,10 +432,9 @@ static void CLAY_engine_init(void) } } -static DRWShadingGroup *CLAY_shgroup_create(DRWPass *pass, int *material_id) +static DRWShadingGroup *CLAY_shgroup_create(CLAY_Data *vedata, DRWPass *pass, int *material_id) { - CLAY_Data *vedata = DRW_viewport_engine_data_get("Clay"); - CLAY_TextureList *txl = vedata->txl; + CLAY_TextureList *txl = ((CLAY_Data *)vedata)->txl; const int depthloc = 0, matcaploc = 1, jitterloc = 2, sampleloc = 3; DRWShadingGroup *grp = DRW_shgroup_create(e_data.clay_sh, pass); @@ -556,7 +554,7 @@ static void override_setting(CollectionEngineSettings *ces, const char *name, vo } } -static DRWShadingGroup *CLAY_object_shgrp_get(Object *ob, CLAY_StorageList *stl, CLAY_PassList *psl) +static DRWShadingGroup *CLAY_object_shgrp_get(CLAY_Data *vedata, Object *ob, CLAY_StorageList *stl, CLAY_PassList *psl) { DRWShadingGroup **shgrps = stl->storage->shgrps; MaterialEngineSettingsClay *settings = DRW_render_settings_get(NULL, RE_engine_id_BLENDER_CLAY); @@ -591,7 +589,7 @@ static DRWShadingGroup *CLAY_object_shgrp_get(Object *ob, CLAY_StorageList *stl, ssao_attenuation, matcap_icon); if (shgrps[id] == NULL) { - shgrps[id] = CLAY_shgroup_create(psl->clay_pass, &e_data.ubo_mat_idxs[id]); + shgrps[id] = CLAY_shgroup_create(vedata, psl->clay_pass, &e_data.ubo_mat_idxs[id]); /* if it's the first shgrp, pass bind the material UBO */ if (stl->storage->ubo_current_id == 1) { DRW_shgroup_uniform_block(shgrps[0], "material_block", stl->mat_ubo, 0); @@ -601,11 +599,10 @@ static DRWShadingGroup *CLAY_object_shgrp_get(Object *ob, CLAY_StorageList *stl, return shgrps[id]; } -static void CLAY_cache_init(void) +static void CLAY_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("Clay"); - CLAY_PassList *psl = g_data.vedata->psl; - CLAY_StorageList *stl = g_data.vedata->stl; + CLAY_PassList *psl = ((CLAY_Data *)vedata)->psl; + CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl; /* Depth Pass */ { @@ -624,10 +621,10 @@ static void CLAY_cache_init(void) } } -static void CLAY_cache_populate(Object *ob) +static void CLAY_cache_populate(void *vedata, Object *ob) { - CLAY_PassList *psl = g_data.vedata->psl; - CLAY_StorageList *stl = g_data.vedata->stl; + CLAY_PassList *psl = ((CLAY_Data *)vedata)->psl; + CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl; struct Batch *geom; DRWShadingGroup *clay_shgrp; @@ -646,23 +643,23 @@ static void CLAY_cache_populate(Object *ob) DRW_shgroup_call_add((do_cull) ? g_data.depth_shgrp_cull : g_data.depth_shgrp, geom, ob->obmat); /* Shading */ - clay_shgrp = CLAY_object_shgrp_get(ob, stl, psl); + clay_shgrp = CLAY_object_shgrp_get(vedata, ob, stl, psl); DRW_shgroup_call_add(clay_shgrp, geom, ob->obmat); } } -static void CLAY_cache_finish(void) +static void CLAY_cache_finish(void *vedata) { - CLAY_StorageList *stl = g_data.vedata->stl; + CLAY_StorageList *stl = ((CLAY_Data *)vedata)->stl; DRW_uniformbuffer_update(stl->mat_ubo, &stl->storage->mat_storage); } -static void CLAY_draw_scene(void) +static void CLAY_draw_scene(void *vedata) { - CLAY_Data *ved = DRW_viewport_engine_data_get("Clay"); - CLAY_PassList *psl = ved->psl; - CLAY_FramebufferList *fbl = ved->fbl; + + CLAY_PassList *psl = ((CLAY_Data *)vedata)->psl; + CLAY_FramebufferList *fbl = ((CLAY_Data *)vedata)->fbl; DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); /* Pass 1 : Depth pre-pass */ diff --git a/source/blender/draw/engines/eevee/eevee.c b/source/blender/draw/engines/eevee/eevee.c index 2f058e3e6e3..bb17a6b46b0 100644 --- a/source/blender/draw/engines/eevee/eevee.c +++ b/source/blender/draw/engines/eevee/eevee.c @@ -54,12 +54,11 @@ extern char datatoc_tonemap_frag_glsl[]; /* *********** FUNCTIONS *********** */ -static void EEVEE_engine_init(void) +static void EEVEE_engine_init(void *vedata) { - EEVEE_Data *ved = DRW_viewport_engine_data_get(EEVEE_ENGINE); - EEVEE_TextureList *txl = ved->txl; - EEVEE_FramebufferList *fbl = ved->fbl; - EEVEE_StorageList *stl = ved->stl; + EEVEE_TextureList *txl = ((EEVEE_Data *)vedata)->txl; + EEVEE_FramebufferList *fbl = ((EEVEE_Data *)vedata)->fbl; + EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; DRWFboTexture tex = {&txl->color, DRW_BUF_RGBA_32}; @@ -79,7 +78,6 @@ static void EEVEE_engine_init(void) if (!e_data.tonemap) { e_data.tonemap = DRW_shader_create_fullscreen(datatoc_tonemap_frag_glsl, NULL); } - UNUSED_VARS(stl); if (stl->lights_info == NULL) EEVEE_lights_init(stl); @@ -87,12 +85,11 @@ static void EEVEE_engine_init(void) // EEVEE_lights_update(stl); } -static void EEVEE_cache_init(void) +static void EEVEE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get(EEVEE_ENGINE); - EEVEE_PassList *psl = g_data.vedata->psl; - EEVEE_TextureList *txl = g_data.vedata->txl; - EEVEE_StorageList *stl = g_data.vedata->stl; + EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl; + EEVEE_TextureList *txl = ((EEVEE_Data *)vedata)->txl; + EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; { psl->depth_pass = DRW_pass_create("Depth Pass", DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS); @@ -138,9 +135,9 @@ static void EEVEE_cache_init(void) EEVEE_lights_cache_init(stl); } -static void EEVEE_cache_populate(Object *ob) +static void EEVEE_cache_populate(void *vedata, Object *ob) { - EEVEE_StorageList *stl = g_data.vedata->stl; + EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; if (ob->type == OB_MESH) { CollectionEngineSettings *ces_mode_ob = BKE_object_collection_engine_get(ob, COLLECTION_MODE_OBJECT, ""); @@ -163,18 +160,17 @@ static void EEVEE_cache_populate(Object *ob) } } -static void EEVEE_cache_finish(void) +static void EEVEE_cache_finish(void *vedata) { - EEVEE_StorageList *stl = g_data.vedata->stl; + EEVEE_StorageList *stl = ((EEVEE_Data *)vedata)->stl; EEVEE_lights_cache_finish(stl); } -static void EEVEE_draw_scene(void) +static void EEVEE_draw_scene(void *vedata) { - EEVEE_Data *ved = DRW_viewport_engine_data_get(EEVEE_ENGINE); - EEVEE_PassList *psl = ved->psl; - EEVEE_FramebufferList *fbl = ved->fbl; + EEVEE_PassList *psl = ((EEVEE_Data *)vedata)->psl; + EEVEE_FramebufferList *fbl = ((EEVEE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); @@ -218,7 +214,7 @@ static void EEVEE_collection_settings_create(RenderEngine *UNUSED(engine), Colle DrawEngineType draw_engine_eevee_type = { NULL, NULL, - N_("Clay"), + N_("Eevee"), &EEVEE_engine_init, &EEVEE_engine_free, &EEVEE_cache_init, diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 3aabb92be79..1f74ca5981a 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -72,15 +72,15 @@ typedef struct DrawEngineType { char idname[32]; - void (*engine_init)(void); + void (*engine_init)(void *vedata); void (*engine_free)(void); - void (*cache_init)(void); - void (*cache_populate)(struct Object *ob); - void (*cache_finish)(void); + void (*cache_init)(void *vedata); + void (*cache_populate)(void *vedata, struct Object *ob); + void (*cache_finish)(void *vedata); - void (*draw_background)(void); - void (*draw_scene)(void); + void (*draw_background)(void *vedata); + void (*draw_scene)(void *vedata); } DrawEngineType; #ifndef __DRW_ENGINE_H__ diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index ee51ec4276f..43a0937a2f5 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1394,8 +1394,9 @@ static void DRW_engines_init(void) { for (LinkData *link = DST.enabled_engines.first; link; link = link->next) { DrawEngineType *engine = link->data; + ViewportEngineData *data = DRW_viewport_engine_data_get(engine->idname); if (engine->engine_init) { - engine->engine_init(); + engine->engine_init(data); } } } @@ -1404,8 +1405,9 @@ static void DRW_engines_cache_init(void) { for (LinkData *link = DST.enabled_engines.first; link; link = link->next) { DrawEngineType *engine = link->data; + ViewportEngineData *data = DRW_viewport_engine_data_get(engine->idname); if (engine->cache_init) { - engine->cache_init(); + engine->cache_init(data); } } } @@ -1414,8 +1416,9 @@ static void DRW_engines_cache_populate(Object *ob) { for (LinkData *link = DST.enabled_engines.first; link; link = link->next) { DrawEngineType *engine = link->data; + ViewportEngineData *data = DRW_viewport_engine_data_get(engine->idname); if (engine->cache_populate) { - engine->cache_populate(ob); + engine->cache_populate(data, ob); } } } @@ -1424,8 +1427,9 @@ static void DRW_engines_cache_finish(void) { for (LinkData *link = DST.enabled_engines.first; link; link = link->next) { DrawEngineType *engine = link->data; + ViewportEngineData *data = DRW_viewport_engine_data_get(engine->idname); if (engine->cache_finish) { - engine->cache_finish(); + engine->cache_finish(data); } } } @@ -1434,8 +1438,9 @@ static void DRW_engines_draw_background(void) { for (LinkData *link = DST.enabled_engines.first; link; link = link->next) { DrawEngineType *engine = link->data; + ViewportEngineData *data = DRW_viewport_engine_data_get(engine->idname); if (engine->draw_background) { - engine->draw_background(); + engine->draw_background(data); return; } } @@ -1448,8 +1453,9 @@ static void DRW_engines_draw_scene(void) { for (LinkData *link = DST.enabled_engines.first; link; link = link->next) { DrawEngineType *engine = link->data; + ViewportEngineData *data = DRW_viewport_engine_data_get(engine->idname); if (engine->draw_scene) { - engine->draw_scene(); + engine->draw_scene(data); } } } diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c index c56bbe519da..a04ae608ce7 100644 --- a/source/blender/draw/modes/edit_armature_mode.c +++ b/source/blender/draw/modes/edit_armature_mode.c @@ -59,10 +59,10 @@ static struct { /* *********** FUNCTIONS *********** */ -static void EDIT_ARMATURE_cache_init(void) +static void EDIT_ARMATURE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditArmatureMode"); - EDIT_ARMATURE_PassList *psl = g_data.vedata->psl; + + EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl; { /* Solid bones */ @@ -87,10 +87,10 @@ static void EDIT_ARMATURE_cache_init(void) } } -static void EDIT_ARMATURE_cache_populate(Object *ob) +static void EDIT_ARMATURE_cache_populate(void *vedata, Object *ob) { bArmature *arm = ob->data; - EDIT_ARMATURE_PassList *psl = g_data.vedata->psl; + EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl; if (ob->type == OB_ARMATURE) { if (arm->edbo) { @@ -99,10 +99,9 @@ static void EDIT_ARMATURE_cache_populate(Object *ob) } } -static void EDIT_ARMATURE_draw_scene(void) +static void EDIT_ARMATURE_draw_scene(void *vedata) { - EDIT_ARMATURE_Data *ved = DRW_viewport_engine_data_get("EditArmatureMode"); - EDIT_ARMATURE_PassList *psl = ved->psl; + EDIT_ARMATURE_PassList *psl = ((EDIT_ARMATURE_Data *)vedata)->psl; DRW_draw_pass(psl->bone_solid); DRW_draw_pass(psl->bone_wire); diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c index 745342a4f19..46030554fb6 100644 --- a/source/blender/draw/modes/edit_curve_mode.c +++ b/source/blender/draw/modes/edit_curve_mode.c @@ -115,12 +115,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_CURVE_engine_init(void) +static void EDIT_CURVE_engine_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditCurveMode"); - EDIT_CURVE_TextureList *txl = g_data.vedata->txl; - EDIT_CURVE_FramebufferList *fbl = g_data.vedata->fbl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + + EDIT_CURVE_TextureList *txl = ((EDIT_CURVE_Data *)vedata)->txl; + EDIT_CURVE_FramebufferList *fbl = ((EDIT_CURVE_Data *)vedata)->fbl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_CURVE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_CURVE_cache_init(void) +static void EDIT_CURVE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditCurveMode"); - EDIT_CURVE_PassList *psl = g_data.vedata->psl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_CURVE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_CURVE_cache_populate(Object *ob) +static void EDIT_CURVE_cache_populate(void *vedata, Object *ob) { - EDIT_CURVE_PassList *psl = g_data.vedata->psl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_CURVE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_CURVE_cache_finish(void) +static void EDIT_CURVE_cache_finish(void *vedata) { - EDIT_CURVE_PassList *psl = g_data.vedata->psl; - EDIT_CURVE_StorageList *stl = g_data.vedata->stl; + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_CURVE_draw_scene(void) +static void EDIT_CURVE_draw_scene(void *vedata) { - EDIT_CURVE_Data *ved = DRW_viewport_engine_data_get("EditCurveMode"); - EDIT_CURVE_PassList *psl = ved->psl; - EDIT_CURVE_FramebufferList *fbl = ved->fbl; + EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl; + EDIT_CURVE_FramebufferList *fbl = ((EDIT_CURVE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c index 30603c2bfc3..32862ca444c 100644 --- a/source/blender/draw/modes/edit_lattice_mode.c +++ b/source/blender/draw/modes/edit_lattice_mode.c @@ -115,12 +115,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_LATTICE_engine_init(void) +static void EDIT_LATTICE_engine_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditLatticeMode"); - EDIT_LATTICE_TextureList *txl = g_data.vedata->txl; - EDIT_LATTICE_FramebufferList *fbl = g_data.vedata->fbl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + + EDIT_LATTICE_TextureList *txl = ((EDIT_LATTICE_Data *)vedata)->txl; + EDIT_LATTICE_FramebufferList *fbl = ((EDIT_LATTICE_Data *)vedata)->fbl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_LATTICE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_LATTICE_cache_init(void) +static void EDIT_LATTICE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditLatticeMode"); - EDIT_LATTICE_PassList *psl = g_data.vedata->psl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_LATTICE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_LATTICE_cache_populate(Object *ob) +static void EDIT_LATTICE_cache_populate(void *vedata, Object *ob) { - EDIT_LATTICE_PassList *psl = g_data.vedata->psl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_LATTICE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_LATTICE_cache_finish(void) +static void EDIT_LATTICE_cache_finish(void *vedata) { - EDIT_LATTICE_PassList *psl = g_data.vedata->psl; - EDIT_LATTICE_StorageList *stl = g_data.vedata->stl; + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_StorageList *stl = ((EDIT_LATTICE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_LATTICE_draw_scene(void) +static void EDIT_LATTICE_draw_scene(void *vedata) { - EDIT_LATTICE_Data *ved = DRW_viewport_engine_data_get("EditLatticeMode"); - EDIT_LATTICE_PassList *psl = ved->psl; - EDIT_LATTICE_FramebufferList *fbl = ved->fbl; + EDIT_LATTICE_PassList *psl = ((EDIT_LATTICE_Data *)vedata)->psl; + EDIT_LATTICE_FramebufferList *fbl = ((EDIT_LATTICE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index 45d32d70bbc..b17d6288d05 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -124,11 +124,11 @@ static struct { /* *********** FUNCTIONS *********** */ -static void EDIT_MESH_engine_init(void) +static void EDIT_MESH_engine_init(void *vedata) { EDIT_MESH_Data *ved = DRW_viewport_engine_data_get("EditMeshMode"); EDIT_MESH_TextureList *txl = ved->txl; - EDIT_MESH_FramebufferList *fbl = ved->fbl; + EDIT_MESH_FramebufferList *fbl = ((EDIT_MESH_Data *)vedata)->fbl; float *viewport_size = DRW_viewport_size_get(); @@ -261,11 +261,11 @@ static float backwire_opacity; static float face_mod; static float size_normal; -static void EDIT_MESH_cache_init(void) +static void EDIT_MESH_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditMeshMode"); - EDIT_MESH_TextureList *txl = g_data.vedata->txl; - EDIT_MESH_PassList *psl = g_data.vedata->psl; + + EDIT_MESH_TextureList *txl = ((EDIT_MESH_Data *)vedata)->txl; + EDIT_MESH_PassList *psl = ((EDIT_MESH_Data *)vedata)->psl; DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); const struct bContext *C = DRW_get_context(); @@ -348,7 +348,7 @@ static void edit_mesh_add_ob_to_pass(Scene *scene, Object *ob, DRWShadingGroup * } } -static void EDIT_MESH_cache_populate(Object *ob) +static void EDIT_MESH_cache_populate(void *UNUSED(vedata), Object *ob) { const struct bContext *C = DRW_get_context(); View3D *v3d = CTX_wm_view3d(C); @@ -401,11 +401,10 @@ static void EDIT_MESH_cache_populate(Object *ob) } } -static void EDIT_MESH_draw_scene(void) +static void EDIT_MESH_draw_scene(void *vedata) { - EDIT_MESH_Data *ved = DRW_viewport_engine_data_get("EditMeshMode"); - EDIT_MESH_PassList *psl = ved->psl; - EDIT_MESH_FramebufferList *fbl = ved->fbl; + EDIT_MESH_PassList *psl = ((EDIT_MESH_Data *)vedata)->psl; + EDIT_MESH_FramebufferList *fbl = ((EDIT_MESH_Data *)vedata)->fbl; DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c index 6f3e11be4a7..5f0ca3f1566 100644 --- a/source/blender/draw/modes/edit_metaball_mode.c +++ b/source/blender/draw/modes/edit_metaball_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_METABALL_engine_init(void) +static void EDIT_METABALL_engine_init(void *vedata) { EDIT_METABALL_Data *ved = DRW_viewport_engine_data_get("EditMetaballMode"); EDIT_METABALL_TextureList *txl = ved->txl; - EDIT_METABALL_FramebufferList *fbl = ved->fbl; + EDIT_METABALL_FramebufferList *fbl = ((EDIT_METABALL_Data *)vedata)->fbl; EDIT_METABALL_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_METABALL_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_METABALL_cache_init(void) +static void EDIT_METABALL_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditMetaballMode"); - EDIT_METABALL_PassList *psl = g_data.vedata->psl; - EDIT_METABALL_StorageList *stl = g_data.vedata->stl; + + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_StorageList *stl = ((EDIT_METABALL_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_METABALL_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_METABALL_cache_populate(Object *ob) +static void EDIT_METABALL_cache_populate(void *vedata, Object *ob) { - EDIT_METABALL_PassList *psl = g_data.vedata->psl; - EDIT_METABALL_StorageList *stl = g_data.vedata->stl; + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_StorageList *stl = ((EDIT_METABALL_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_METABALL_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_METABALL_cache_finish(void) +static void EDIT_METABALL_cache_finish(void *vedata) { - EDIT_METABALL_PassList *psl = g_data.vedata->psl; - EDIT_METABALL_StorageList *stl = g_data.vedata->stl; + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_StorageList *stl = ((EDIT_METABALL_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_METABALL_draw_scene(void) +static void EDIT_METABALL_draw_scene(void *vedata) { - EDIT_METABALL_Data *ved = DRW_viewport_engine_data_get("EditMetaballMode"); - EDIT_METABALL_PassList *psl = ved->psl; - EDIT_METABALL_FramebufferList *fbl = ved->fbl; + EDIT_METABALL_PassList *psl = ((EDIT_METABALL_Data *)vedata)->psl; + EDIT_METABALL_FramebufferList *fbl = ((EDIT_METABALL_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_surface_mode.c b/source/blender/draw/modes/edit_surface_mode.c index 286ba7f9818..b5e0d09fb23 100644 --- a/source/blender/draw/modes/edit_surface_mode.c +++ b/source/blender/draw/modes/edit_surface_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_SURFACE_engine_init(void) +static void EDIT_SURFACE_engine_init(void *vedata) { EDIT_SURFACE_Data *ved = DRW_viewport_engine_data_get("EditSurfaceMode"); EDIT_SURFACE_TextureList *txl = ved->txl; - EDIT_SURFACE_FramebufferList *fbl = ved->fbl; + EDIT_SURFACE_FramebufferList *fbl = ((EDIT_SURFACE_Data *)vedata)->fbl; EDIT_SURFACE_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_SURFACE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_SURFACE_cache_init(void) +static void EDIT_SURFACE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditSurfaceMode"); - EDIT_SURFACE_PassList *psl = g_data.vedata->psl; - EDIT_SURFACE_StorageList *stl = g_data.vedata->stl; + + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_StorageList *stl = ((EDIT_SURFACE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_SURFACE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_SURFACE_cache_populate(Object *ob) +static void EDIT_SURFACE_cache_populate(void *vedata, Object *ob) { - EDIT_SURFACE_PassList *psl = g_data.vedata->psl; - EDIT_SURFACE_StorageList *stl = g_data.vedata->stl; + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_StorageList *stl = ((EDIT_SURFACE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_SURFACE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_SURFACE_cache_finish(void) +static void EDIT_SURFACE_cache_finish(void *vedata) { - EDIT_SURFACE_PassList *psl = g_data.vedata->psl; - EDIT_SURFACE_StorageList *stl = g_data.vedata->stl; + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_StorageList *stl = ((EDIT_SURFACE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_SURFACE_draw_scene(void) +static void EDIT_SURFACE_draw_scene(void *vedata) { - EDIT_SURFACE_Data *ved = DRW_viewport_engine_data_get("EditSurfaceMode"); - EDIT_SURFACE_PassList *psl = ved->psl; - EDIT_SURFACE_FramebufferList *fbl = ved->fbl; + EDIT_SURFACE_PassList *psl = ((EDIT_SURFACE_Data *)vedata)->psl; + EDIT_SURFACE_FramebufferList *fbl = ((EDIT_SURFACE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/edit_text_mode.c b/source/blender/draw/modes/edit_text_mode.c index dfe91daea9f..46ab36efbb5 100644 --- a/source/blender/draw/modes/edit_text_mode.c +++ b/source/blender/draw/modes/edit_text_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void EDIT_TEXT_engine_init(void) +static void EDIT_TEXT_engine_init(void *vedata) { EDIT_TEXT_Data *ved = DRW_viewport_engine_data_get("EditTextMode"); EDIT_TEXT_TextureList *txl = ved->txl; - EDIT_TEXT_FramebufferList *fbl = ved->fbl; + EDIT_TEXT_FramebufferList *fbl = ((EDIT_TEXT_Data *)vedata)->fbl; EDIT_TEXT_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void EDIT_TEXT_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void EDIT_TEXT_cache_init(void) +static void EDIT_TEXT_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("EditTextMode"); - EDIT_TEXT_PassList *psl = g_data.vedata->psl; - EDIT_TEXT_StorageList *stl = g_data.vedata->stl; + + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_StorageList *stl = ((EDIT_TEXT_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void EDIT_TEXT_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void EDIT_TEXT_cache_populate(Object *ob) +static void EDIT_TEXT_cache_populate(void *vedata, Object *ob) { - EDIT_TEXT_PassList *psl = g_data.vedata->psl; - EDIT_TEXT_StorageList *stl = g_data.vedata->stl; + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_StorageList *stl = ((EDIT_TEXT_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void EDIT_TEXT_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void EDIT_TEXT_cache_finish(void) +static void EDIT_TEXT_cache_finish(void *vedata) { - EDIT_TEXT_PassList *psl = g_data.vedata->psl; - EDIT_TEXT_StorageList *stl = g_data.vedata->stl; + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_StorageList *stl = ((EDIT_TEXT_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void EDIT_TEXT_draw_scene(void) +static void EDIT_TEXT_draw_scene(void *vedata) { - EDIT_TEXT_Data *ved = DRW_viewport_engine_data_get("EditTextMode"); - EDIT_TEXT_PassList *psl = ved->psl; - EDIT_TEXT_FramebufferList *fbl = ved->fbl; + EDIT_TEXT_PassList *psl = ((EDIT_TEXT_Data *)vedata)->psl; + EDIT_TEXT_FramebufferList *fbl = ((EDIT_TEXT_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index b7bb489ca2b..706f73005d5 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -185,11 +185,11 @@ enum { /* *********** FUNCTIONS *********** */ -static void OBJECT_engine_init(void) +static void OBJECT_engine_init(void *vedata) { - OBJECT_Data *ved = DRW_viewport_engine_data_get("ObjectMode"); - OBJECT_TextureList *txl = ved->txl; - OBJECT_FramebufferList *fbl = ved->fbl; + + OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl; + OBJECT_FramebufferList *fbl = ((OBJECT_Data *)vedata)->fbl; float *viewport_size = DRW_viewport_size_get(); @@ -374,12 +374,12 @@ static DRWShadingGroup *shgroup_outline(DRWPass *pass, const float col[4], struc return grp; } -static void OBJECT_cache_init(void) +static void OBJECT_cache_init(void *vedata) { /* DRW_viewport_engine_data_get is rather slow, better not do it on every objects */ - g_data.vedata = DRW_viewport_engine_data_get("ObjectMode"); - OBJECT_PassList *psl = g_data.vedata->psl; - OBJECT_TextureList *txl = g_data.vedata->txl; + + OBJECT_PassList *psl = ((OBJECT_Data *)vedata)->psl; + OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl; DefaultTextureList *dtxl = DRW_viewport_texture_list_get(); { @@ -897,7 +897,7 @@ static void DRW_shgroup_object_center(Object *ob) } } -static void OBJECT_cache_populate(Object *ob) +static void OBJECT_cache_populate(void *vedata, Object *ob) { const struct bContext *C = DRW_get_context(); Scene *scene = CTX_data_scene(C); @@ -950,8 +950,8 @@ static void OBJECT_cache_populate(Object *ob) { bArmature *arm = ob->data; if (arm->edbo == NULL) { - DRW_shgroup_armature_object(ob, sl, g_data.vedata->psl->bone_solid, - g_data.vedata->psl->bone_wire, + DRW_shgroup_armature_object(ob, sl, ((OBJECT_Data *)vedata)->psl->bone_solid, + ((OBJECT_Data *)vedata)->psl->bone_wire, g_data.relationship_lines); } } @@ -964,12 +964,12 @@ static void OBJECT_cache_populate(Object *ob) DRW_shgroup_relationship_lines(ob); } -static void OBJECT_draw_scene(void) +static void OBJECT_draw_scene(void *vedata) { - OBJECT_Data *ved = DRW_viewport_engine_data_get("ObjectMode"); - OBJECT_PassList *psl = ved->psl; - OBJECT_FramebufferList *fbl = ved->fbl; - OBJECT_TextureList *txl = ved->txl; + + OBJECT_PassList *psl = ((OBJECT_Data *)vedata)->psl; + OBJECT_FramebufferList *fbl = ((OBJECT_Data *)vedata)->fbl; + OBJECT_TextureList *txl = ((OBJECT_Data *)vedata)->txl; DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); float clearcol[4] = {0.0f, 0.0f, 0.0f, 0.0f}; diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c index 3ec60e93a1b..f1617a29133 100644 --- a/source/blender/draw/modes/paint_texture_mode.c +++ b/source/blender/draw/modes/paint_texture_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PAINT_TEXTURE_engine_init(void) +static void PAINT_TEXTURE_engine_init(void *vedata) { PAINT_TEXTURE_Data *ved = DRW_viewport_engine_data_get("PaintTextureMode"); PAINT_TEXTURE_TextureList *txl = ved->txl; - PAINT_TEXTURE_FramebufferList *fbl = ved->fbl; + PAINT_TEXTURE_FramebufferList *fbl = ((PAINT_TEXTURE_Data *)vedata)->fbl; PAINT_TEXTURE_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void PAINT_TEXTURE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PAINT_TEXTURE_cache_init(void) +static void PAINT_TEXTURE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PaintTextureMode"); - PAINT_TEXTURE_PassList *psl = g_data.vedata->psl; - PAINT_TEXTURE_StorageList *stl = g_data.vedata->stl; + + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_StorageList *stl = ((PAINT_TEXTURE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void PAINT_TEXTURE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PAINT_TEXTURE_cache_populate(Object *ob) +static void PAINT_TEXTURE_cache_populate(void *vedata, Object *ob) { - PAINT_TEXTURE_PassList *psl = g_data.vedata->psl; - PAINT_TEXTURE_StorageList *stl = g_data.vedata->stl; + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_StorageList *stl = ((PAINT_TEXTURE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void PAINT_TEXTURE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PAINT_TEXTURE_cache_finish(void) +static void PAINT_TEXTURE_cache_finish(void *vedata) { - PAINT_TEXTURE_PassList *psl = g_data.vedata->psl; - PAINT_TEXTURE_StorageList *stl = g_data.vedata->stl; + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_StorageList *stl = ((PAINT_TEXTURE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PAINT_TEXTURE_draw_scene(void) +static void PAINT_TEXTURE_draw_scene(void *vedata) { - PAINT_TEXTURE_Data *ved = DRW_viewport_engine_data_get("PaintTextureMode"); - PAINT_TEXTURE_PassList *psl = ved->psl; - PAINT_TEXTURE_FramebufferList *fbl = ved->fbl; + PAINT_TEXTURE_PassList *psl = ((PAINT_TEXTURE_Data *)vedata)->psl; + PAINT_TEXTURE_FramebufferList *fbl = ((PAINT_TEXTURE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c index bac81c9b81c..0d8ccff23aa 100644 --- a/source/blender/draw/modes/paint_vertex_mode.c +++ b/source/blender/draw/modes/paint_vertex_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PAINT_VERTEX_engine_init(void) +static void PAINT_VERTEX_engine_init(void *vedata) { PAINT_VERTEX_Data *ved = DRW_viewport_engine_data_get("PaintVertexMode"); PAINT_VERTEX_TextureList *txl = ved->txl; - PAINT_VERTEX_FramebufferList *fbl = ved->fbl; + PAINT_VERTEX_FramebufferList *fbl = ((PAINT_VERTEX_Data *)vedata)->fbl; PAINT_VERTEX_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void PAINT_VERTEX_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PAINT_VERTEX_cache_init(void) +static void PAINT_VERTEX_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PaintVertexMode"); - PAINT_VERTEX_PassList *psl = g_data.vedata->psl; - PAINT_VERTEX_StorageList *stl = g_data.vedata->stl; + + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_StorageList *stl = ((PAINT_VERTEX_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void PAINT_VERTEX_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PAINT_VERTEX_cache_populate(Object *ob) +static void PAINT_VERTEX_cache_populate(void *vedata, Object *ob) { - PAINT_VERTEX_PassList *psl = g_data.vedata->psl; - PAINT_VERTEX_StorageList *stl = g_data.vedata->stl; + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_StorageList *stl = ((PAINT_VERTEX_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void PAINT_VERTEX_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PAINT_VERTEX_cache_finish(void) +static void PAINT_VERTEX_cache_finish(void *vedata) { - PAINT_VERTEX_PassList *psl = g_data.vedata->psl; - PAINT_VERTEX_StorageList *stl = g_data.vedata->stl; + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_StorageList *stl = ((PAINT_VERTEX_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PAINT_VERTEX_draw_scene(void) +static void PAINT_VERTEX_draw_scene(void *vedata) { - PAINT_VERTEX_Data *ved = DRW_viewport_engine_data_get("PaintVertexMode"); - PAINT_VERTEX_PassList *psl = ved->psl; - PAINT_VERTEX_FramebufferList *fbl = ved->fbl; + PAINT_VERTEX_PassList *psl = ((PAINT_VERTEX_Data *)vedata)->psl; + PAINT_VERTEX_FramebufferList *fbl = ((PAINT_VERTEX_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c index 06f73436760..00a034a87c0 100644 --- a/source/blender/draw/modes/paint_weight_mode.c +++ b/source/blender/draw/modes/paint_weight_mode.c @@ -115,11 +115,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PAINT_WEIGHT_engine_init(void) +static void PAINT_WEIGHT_engine_init(void *vedata) { PAINT_WEIGHT_Data *ved = DRW_viewport_engine_data_get("PaintWeightMode"); PAINT_WEIGHT_TextureList *txl = ved->txl; - PAINT_WEIGHT_FramebufferList *fbl = ved->fbl; + PAINT_WEIGHT_FramebufferList *fbl = ((PAINT_WEIGHT_Data *)vedata)->fbl; PAINT_WEIGHT_StorageList *stl = ved->stl; UNUSED_VARS(txl, fbl, stl); @@ -146,11 +146,11 @@ static void PAINT_WEIGHT_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PAINT_WEIGHT_cache_init(void) +static void PAINT_WEIGHT_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PaintWeightMode"); - PAINT_WEIGHT_PassList *psl = g_data.vedata->psl; - PAINT_WEIGHT_StorageList *stl = g_data.vedata->stl; + + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_StorageList *stl = ((PAINT_WEIGHT_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -176,10 +176,10 @@ static void PAINT_WEIGHT_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PAINT_WEIGHT_cache_populate(Object *ob) +static void PAINT_WEIGHT_cache_populate(void *vedata, Object *ob) { - PAINT_WEIGHT_PassList *psl = g_data.vedata->psl; - PAINT_WEIGHT_StorageList *stl = g_data.vedata->stl; + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_StorageList *stl = ((PAINT_WEIGHT_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -193,21 +193,20 @@ static void PAINT_WEIGHT_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PAINT_WEIGHT_cache_finish(void) +static void PAINT_WEIGHT_cache_finish(void *vedata) { - PAINT_WEIGHT_PassList *psl = g_data.vedata->psl; - PAINT_WEIGHT_StorageList *stl = g_data.vedata->stl; + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_StorageList *stl = ((PAINT_WEIGHT_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PAINT_WEIGHT_draw_scene(void) +static void PAINT_WEIGHT_draw_scene(void *vedata) { - PAINT_WEIGHT_Data *ved = DRW_viewport_engine_data_get("PaintWeightMode"); - PAINT_WEIGHT_PassList *psl = ved->psl; - PAINT_WEIGHT_FramebufferList *fbl = ved->fbl; + PAINT_WEIGHT_PassList *psl = ((PAINT_WEIGHT_Data *)vedata)->psl; + PAINT_WEIGHT_FramebufferList *fbl = ((PAINT_WEIGHT_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c index 393268f81c2..b2d9d39281b 100644 --- a/source/blender/draw/modes/particle_mode.c +++ b/source/blender/draw/modes/particle_mode.c @@ -109,12 +109,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void PARTICLE_engine_init(void) +static void PARTICLE_engine_init(void *vedata) { - PARTICLE_Data *ved = DRW_viewport_engine_data_get("ParticleMode"); - PARTICLE_TextureList *txl = ved->txl; - PARTICLE_FramebufferList *fbl = ved->fbl; - PARTICLE_StorageList *stl = ved->stl; + + PARTICLE_TextureList *txl = ((PARTICLE_Data *)vedata)->txl; + PARTICLE_FramebufferList *fbl = ((PARTICLE_Data *)vedata)->fbl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -140,11 +140,11 @@ static void PARTICLE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void PARTICLE_cache_init(void) +static void PARTICLE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("ParticleMode"); - PARTICLE_PassList *psl = g_data.vedata->psl; - PARTICLE_StorageList *stl = g_data.vedata->stl; + + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -170,10 +170,10 @@ static void PARTICLE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void PARTICLE_cache_populate(Object *ob) +static void PARTICLE_cache_populate(void *vedata, Object *ob) { - PARTICLE_PassList *psl = g_data.vedata->psl; - PARTICLE_StorageList *stl = g_data.vedata->stl; + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -187,21 +187,21 @@ static void PARTICLE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void PARTICLE_cache_finish(void) +static void PARTICLE_cache_finish(void *vedata) { - PARTICLE_PassList *psl = g_data.vedata->psl; - PARTICLE_StorageList *stl = g_data.vedata->stl; + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void PARTICLE_draw_scene(void) +static void PARTICLE_draw_scene(void *vedata) { - PARTICLE_Data *ved = DRW_viewport_engine_data_get("ParticleMode"); - PARTICLE_PassList *psl = ved->psl; - PARTICLE_FramebufferList *fbl = ved->fbl; + + PARTICLE_PassList *psl = ((PARTICLE_Data *)vedata)->psl; + PARTICLE_FramebufferList *fbl = ((PARTICLE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c index 184d8ae85e5..ec08650b866 100644 --- a/source/blender/draw/modes/pose_mode.c +++ b/source/blender/draw/modes/pose_mode.c @@ -109,12 +109,12 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void POSE_engine_init(void) +static void POSE_engine_init(void *vedata) { - POSE_Data *ved = DRW_viewport_engine_data_get("PoseMode"); - POSE_TextureList *txl = ved->txl; - POSE_FramebufferList *fbl = ved->fbl; - POSE_StorageList *stl = ved->stl; + + POSE_TextureList *txl = ((POSE_Data *)vedata)->txl; + POSE_FramebufferList *fbl = ((POSE_Data *)vedata)->fbl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -140,11 +140,11 @@ static void POSE_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void POSE_cache_init(void) +static void POSE_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("PoseMode"); - POSE_PassList *psl = g_data.vedata->psl; - POSE_StorageList *stl = g_data.vedata->stl; + + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -170,10 +170,10 @@ static void POSE_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void POSE_cache_populate(Object *ob) +static void POSE_cache_populate(void *vedata, Object *ob) { - POSE_PassList *psl = g_data.vedata->psl; - POSE_StorageList *stl = g_data.vedata->stl; + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -187,21 +187,21 @@ static void POSE_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void POSE_cache_finish(void) +static void POSE_cache_finish(void *vedata) { - POSE_PassList *psl = g_data.vedata->psl; - POSE_StorageList *stl = g_data.vedata->stl; + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_StorageList *stl = ((POSE_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void POSE_draw_scene(void) +static void POSE_draw_scene(void *vedata) { - POSE_Data *ved = DRW_viewport_engine_data_get("PoseMode"); - POSE_PassList *psl = ved->psl; - POSE_FramebufferList *fbl = ved->fbl; + + POSE_PassList *psl = ((POSE_Data *)vedata)->psl; + POSE_FramebufferList *fbl = ((POSE_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); diff --git a/source/blender/draw/modes/sculpt_mode.c b/source/blender/draw/modes/sculpt_mode.c index f25f21bfbda..49cc324869c 100644 --- a/source/blender/draw/modes/sculpt_mode.c +++ b/source/blender/draw/modes/sculpt_mode.c @@ -109,12 +109,11 @@ static struct { /* Init Textures, Framebuffers, Storage and Shaders. * It is called for every frames. * (Optional) */ -static void SCULPT_engine_init(void) +static void SCULPT_engine_init(void *vedata) { - SCULPT_Data *ved = DRW_viewport_engine_data_get("SculptMode"); - SCULPT_TextureList *txl = ved->txl; - SCULPT_FramebufferList *fbl = ved->fbl; - SCULPT_StorageList *stl = ved->stl; + SCULPT_TextureList *txl = ((SCULPT_Data *)vedata)->txl; + SCULPT_FramebufferList *fbl = ((SCULPT_Data *)vedata)->fbl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; UNUSED_VARS(txl, fbl, stl); @@ -140,11 +139,10 @@ static void SCULPT_engine_init(void) /* Here init all passes and shading groups * Assume that all Passes are NULL */ -static void SCULPT_cache_init(void) +static void SCULPT_cache_init(void *vedata) { - g_data.vedata = DRW_viewport_engine_data_get("SculptMode"); - SCULPT_PassList *psl = g_data.vedata->psl; - SCULPT_StorageList *stl = g_data.vedata->stl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; UNUSED_VARS(stl); @@ -170,10 +168,10 @@ static void SCULPT_cache_init(void) } /* Add geometry to shadingGroups. Execute for each objects */ -static void SCULPT_cache_populate(Object *ob) +static void SCULPT_cache_populate(void *vedata, Object *ob) { - SCULPT_PassList *psl = g_data.vedata->psl; - SCULPT_StorageList *stl = g_data.vedata->stl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; UNUSED_VARS(psl, stl); @@ -187,21 +185,20 @@ static void SCULPT_cache_populate(Object *ob) } /* Optional: Post-cache_populate callback */ -static void SCULPT_cache_finish(void) +static void SCULPT_cache_finish(void *vedata) { - SCULPT_PassList *psl = g_data.vedata->psl; - SCULPT_StorageList *stl = g_data.vedata->stl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_StorageList *stl = ((SCULPT_Data *)vedata)->stl; /* Do something here! dependant on the objects gathered */ UNUSED_VARS(psl, stl); } /* Draw time ! Control rendering pipeline from here */ -static void SCULPT_draw_scene(void) +static void SCULPT_draw_scene(void *vedata) { - SCULPT_Data *ved = DRW_viewport_engine_data_get("SculptMode"); - SCULPT_PassList *psl = ved->psl; - SCULPT_FramebufferList *fbl = ved->fbl; + SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; + SCULPT_FramebufferList *fbl = ((SCULPT_Data *)vedata)->fbl; /* Default framebuffer and texture */ DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); |