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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-25 13:32:48 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-25 13:32:48 +0300
commit8a7f317666caa41aad0428b5ed3f399cdfbbd816 (patch)
tree7e6ba6c6a1ab952cc175d4e08b39aebc2286cb4a /source/blender/windowmanager
parentf33cb522dd5793c685dcd681f7c7e13ff60f920a (diff)
Cleanup: Nuke most of G.main from GPU code.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c3
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c4
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c8
3 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index aa89cd6d1ef..0f8c49c082d 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -948,6 +948,7 @@ void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *ar)
void wm_draw_update(bContext *C)
{
+ Main *bmain = CTX_data_main(C);
wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
@@ -955,7 +956,7 @@ void wm_draw_update(bContext *C)
BKE_subsurf_free_unused_buffers();
#endif
- GPU_free_unused_buffers();
+ GPU_free_unused_buffers(bmain);
for (win = wm->windows.first; win; win = win->next) {
#ifdef WIN32
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 5a92a345117..8e11e548aec 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -455,7 +455,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
}
/* free gpu materials, some materials depend on existing objects, such as lamps so freeing correctly refreshes */
- GPU_materials_free();
+ GPU_materials_free(bmain);
/* XXX TODO: align G.lib with other directory storage (like last opened image etc...) */
BLI_strncpy(G.lib, root, FILE_MAX);
@@ -751,7 +751,7 @@ static void lib_relocate_do(
DAG_scene_relations_rebuild(bmain, scene);
/* free gpu materials, some materials depend on existing objects, such as lamps so freeing correctly refreshes */
- GPU_materials_free();
+ GPU_materials_free(bmain);
}
void WM_lib_reload(Library *lib, bContext *C, ReportList *reports)
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 38aa18a029e..449a0a91a01 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -207,10 +207,10 @@ void WM_init(bContext *C, int argc, const char **argv)
GPU_init();
- GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
+ GPU_set_mipmap(G_MAIN, !(U.gameflags & USER_DISABLE_MIPMAP));
GPU_set_linear_mipmap(true);
- GPU_set_anisotropic(U.anisotropic_filter);
- GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
+ GPU_set_anisotropic(G_MAIN, U.anisotropic_filter);
+ GPU_set_gpu_mipmapping(G_MAIN, U.use_gpu_mipmap);
#ifdef WITH_OPENSUBDIV
BKE_subsurf_osd_init();
@@ -590,7 +590,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
#endif
GPU_global_buffer_pool_free();
- GPU_free_unused_buffers();
+ GPU_free_unused_buffers(G_MAIN);
GPU_exit();
}