diff options
19 files changed, 28 insertions, 17 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index de3f8592aec..1de07688c5e 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -31,6 +31,8 @@ #include "eevee_private.h" +#include "eevee_engine.h" /* own include */ + #define EEVEE_ENGINE "BLENDER_EEVEE" /* *********** FUNCTIONS *********** */ diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index 898cbdba1a5..0100fa095e6 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -28,13 +28,14 @@ #include "DNA_screen_types.h" #include "DNA_view3d_types.h" - #include "ED_screen.h" #include "GPU_matrix.h" #include "GPU_shader.h" #include "GPU_viewport.h" +#include "external_engine.h" /* own include */ + /* Shaders */ #define EXTERNAL_ENGINE "BLENDER_EXTERNAL" @@ -197,7 +198,7 @@ static void external_engine_free(void) static const DrawEngineDataSize external_data_size = DRW_VIEWPORT_DATA_SIZE(EXTERNAL_Data); -DrawEngineType draw_engine_external_type = { +static DrawEngineType draw_engine_external_type = { NULL, NULL, N_("External"), &external_data_size, diff --git a/source/blender/draw/intern/draw_anim_viz.c b/source/blender/draw/intern/draw_anim_viz.c index 2689d2726d8..09625b9b47e 100644 --- a/source/blender/draw/intern/draw_anim_viz.c +++ b/source/blender/draw/intern/draw_anim_viz.c @@ -47,6 +47,8 @@ #include "draw_common.h" #include "draw_manager_text.h" +#include "draw_mode_engines.h" + /* ********************************* Lists ************************************** */ /* All lists are per viewport specific datas. * They are all free when viewport changes engines diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 12c7f5ba4f4..a570312adf6 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -212,6 +212,8 @@ struct DRW_Global { struct GPUTexture *ramp; struct GPUTexture *weight_ramp; + + struct GPUUniformBuffer *view_ubo; }; extern struct DRW_Global G_draw; diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 166b499a56f..82e371b8147 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -96,8 +96,6 @@ DRWManager DST = {NULL}; static ListBase DRW_engines = {NULL, NULL}; -extern struct GPUUniformBuffer *view_ubo; /* draw_manager_exec.c */ - static void drw_state_prepare_clean_for_draw(DRWManager *dst) { memset(dst, 0x0, offsetof(DRWManager, gl_context)); @@ -647,8 +645,8 @@ static void drw_viewport_var_init(void) DST.RST.bound_ubo_slots = MEM_callocN(sizeof(char) * GPU_max_ubo_binds(), "Bound Ubo Slots"); } - if (view_ubo == NULL) { - view_ubo = DRW_uniformbuffer_create(sizeof(ViewUboStorage), NULL); + if (G_draw.view_ubo == NULL) { + G_draw.view_ubo = DRW_uniformbuffer_create(sizeof(ViewUboStorage), NULL); } DST.override_mat = 0; @@ -2572,7 +2570,6 @@ void DRW_engines_register(void) } } -extern struct GPUVertFormat *g_pos_format; /* draw_shgroup.c */ void DRW_engines_free(void) { DRW_opengl_context_enable(); @@ -2596,7 +2593,7 @@ void DRW_engines_free(void) } DRW_UBO_FREE_SAFE(G_draw.block_ubo); - DRW_UBO_FREE_SAFE(view_ubo); + DRW_UBO_FREE_SAFE(G_draw.view_ubo); DRW_TEXTURE_FREE_SAFE(G_draw.ramp); DRW_TEXTURE_FREE_SAFE(G_draw.weight_ramp); MEM_SAFE_FREE(g_pos_format); diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index 811d0125119..22dfc28e305 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -427,4 +427,6 @@ void drw_debug_init(void); void drw_batch_cache_generate_requested(struct Object *ob); +extern struct GPUVertFormat *g_pos_format; + #endif /* __DRAW_MANAGER_H__ */ diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index ca0bfba4da1..91e3befa8d6 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -41,8 +41,6 @@ struct GPUVertFormat *g_pos_format = NULL; -extern struct GPUUniformBuffer *view_ubo; /* draw_manager_exec.c */ - /* -------------------------------------------------------------------- */ /** \name Uniform Buffer Object (DRW_uniformbuffer) * \{ */ @@ -670,7 +668,7 @@ static void drw_shgroup_init(DRWShadingGroup *shgroup, GPUShader *shader) int view_ubo_location = GPU_shader_get_uniform_block(shader, "viewBlock"); if (view_ubo_location != -1) { - drw_shgroup_uniform_create_ex(shgroup, view_ubo_location, DRW_UNIFORM_BLOCK_PERSIST, view_ubo, 0, 1); + drw_shgroup_uniform_create_ex(shgroup, view_ubo_location, DRW_UNIFORM_BLOCK_PERSIST, G_draw.view_ubo, 0, 1); } else { /* Only here to support builtin shaders. This should not be used by engines. */ diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 42a0a9f77bf..e558552fc4d 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -45,8 +45,6 @@ void DRW_select_load_id(uint id) #define DEBUG_UBO_BINDING -struct GPUUniformBuffer *view_ubo; - /* -------------------------------------------------------------------- */ /** \name Draw State (DRW_state) * \{ */ @@ -1294,7 +1292,7 @@ static void drw_update_view(void) DST.state_cache_id++; DST.dirty_mat = false; - DRW_uniformbuffer_update(view_ubo, &DST.view_data); + DRW_uniformbuffer_update(G_draw.view_ubo, &DST.view_data); /* Catch integer wrap around. */ if (UNLIKELY(DST.state_cache_id == 0)) { diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c index 62f284c6a97..0a1acf99bc6 100644 --- a/source/blender/draw/modes/edit_armature_mode.c +++ b/source/blender/draw/modes/edit_armature_mode.c @@ -27,6 +27,7 @@ #include "DNA_view3d_types.h" #include "draw_common.h" +#include "draw_mode_engines.h" /* *********** LISTS *********** */ typedef struct EDIT_ARMATURE_PassList { diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c index 642f7fead66..c2841549270 100644 --- a/source/blender/draw/modes/edit_curve_mode.c +++ b/source/blender/draw/modes/edit_curve_mode.c @@ -32,7 +32,7 @@ #include "GPU_shader.h" #include "draw_common.h" - +#include "draw_mode_engines.h" /* If needed, contains all global/Theme colors * Add needed theme colors / values to DRW_globals_update() and update UBO diff --git a/source/blender/draw/modes/edit_lattice_mode.c b/source/blender/draw/modes/edit_lattice_mode.c index e77d319ad25..70870292556 100644 --- a/source/blender/draw/modes/edit_lattice_mode.c +++ b/source/blender/draw/modes/edit_lattice_mode.c @@ -29,6 +29,7 @@ #include "GPU_shader.h" #include "draw_common.h" +#include "draw_mode_engines.h" extern char datatoc_common_globals_lib_glsl[]; diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c index 72d8b4b86f8..04b03cb3ac1 100644 --- a/source/blender/draw/modes/edit_metaball_mode.c +++ b/source/blender/draw/modes/edit_metaball_mode.c @@ -32,7 +32,7 @@ #include "GPU_shader.h" #include "draw_common.h" - +#include "draw_mode_engines.h" /* *********** LISTS *********** */ /* All lists are per viewport specific datas. diff --git a/source/blender/draw/modes/edit_text_mode.c b/source/blender/draw/modes/edit_text_mode.c index a6ebcc1f756..f52bfaccd5b 100644 --- a/source/blender/draw/modes/edit_text_mode.c +++ b/source/blender/draw/modes/edit_text_mode.c @@ -33,6 +33,7 @@ #include "GPU_shader.h" #include "draw_common.h" +#include "draw_mode_engines.h" /* *********** LISTS *********** */ /* All lists are per viewport specific datas. diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index 3cd9165abc4..b583e29eaa7 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -34,6 +34,8 @@ #include "GPU_shader.h" #include "DRW_render.h" +#include "draw_mode_engines.h" + #ifdef __APPLE__ #define USE_GEOM_SHADER_WORKAROUND 1 #else diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c index 45ba03b8e36..0a9746b3de5 100644 --- a/source/blender/draw/modes/paint_texture_mode.c +++ b/source/blender/draw/modes/paint_texture_mode.c @@ -32,7 +32,7 @@ #include "GPU_texture.h" #include "draw_common.h" - +#include "draw_mode_engines.h" #include "DNA_mesh_types.h" diff --git a/source/blender/draw/modes/paint_vertex_mode.c b/source/blender/draw/modes/paint_vertex_mode.c index caa768bd815..ac678a996dc 100644 --- a/source/blender/draw/modes/paint_vertex_mode.c +++ b/source/blender/draw/modes/paint_vertex_mode.c @@ -26,6 +26,7 @@ #include "GPU_shader.h" #include "draw_common.h" +#include "draw_mode_engines.h" #include "DNA_mesh_types.h" #include "DNA_view3d_types.h" diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c index 249823692b0..3090322fc80 100644 --- a/source/blender/draw/modes/particle_mode.c +++ b/source/blender/draw/modes/particle_mode.c @@ -30,6 +30,7 @@ #include "GPU_shader.h" #include "draw_common.h" +#include "draw_mode_engines.h" #include "ED_particle.h" diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c index 74e44a4c40b..c35f2cb8203 100644 --- a/source/blender/draw/modes/pose_mode.c +++ b/source/blender/draw/modes/pose_mode.c @@ -31,6 +31,7 @@ #include "GPU_shader.h" #include "draw_common.h" +#include "draw_mode_engines.h" /* *********** LISTS *********** */ /* All lists are per viewport specific datas. diff --git a/source/blender/draw/modes/sculpt_mode.c b/source/blender/draw/modes/sculpt_mode.c index bb13cb36c01..1a525f24349 100644 --- a/source/blender/draw/modes/sculpt_mode.c +++ b/source/blender/draw/modes/sculpt_mode.c @@ -35,6 +35,7 @@ #include "GPU_shader.h" #include "draw_common.h" +#include "draw_mode_engines.h" extern char datatoc_sculpt_mask_vert_glsl[]; extern char datatoc_gpu_shader_3D_smooth_color_frag_glsl[]; |