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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-13 21:15:34 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-14 16:00:48 +0300
commit7028a11db9ec3d29282739f7ad9a0343711ebc24 (patch)
tree29433d298eaed8f4f3e26a695e8c97f9f00ef952 /source/blender/windowmanager
parent8049ad21b07d94ebedb2baec321735d5022befe4 (diff)
GPU: don't use multisample for entire window, only for offscreen 3D viewport.
Now that the new 3D viewport draws to a multisample offscreen buffer, there is no good reason anymore to create an entire multisample window and pay the performance/memory cost for other regions that don't need it. GL_MULTISAMPLE now only gets enabled for offscreen buffers, so we don't need to check for it throughout the UI code anymore. Differential Revision: https://developer.blender.org/D3062
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c2
-rw-r--r--source/blender/windowmanager/intern/wm_window.c12
-rw-r--r--source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c11
3 files changed, 0 insertions, 25 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 6a86644da17..0056ef06a29 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -182,7 +182,6 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
static void wm_window_substitute_old(wmWindowManager *wm, wmWindow *oldwin, wmWindow *win)
{
win->ghostwin = oldwin->ghostwin;
- win->multisamples = oldwin->multisamples;
win->active = oldwin->active;
if (win->active)
wm->winactive = win;
@@ -191,7 +190,6 @@ static void wm_window_substitute_old(wmWindowManager *wm, wmWindow *oldwin, wmWi
GHOST_SetWindowUserData(win->ghostwin, win); /* pointer back */
oldwin->ghostwin = NULL;
- oldwin->multisamples = 0;
win->eventstate = oldwin->eventstate;
oldwin->eventstate = NULL;
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 519e0500b73..0c2ac975ddd 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -175,7 +175,6 @@ static void wm_ghostwindow_destroy(wmWindow *win)
if (win->ghostwin) {
GHOST_DisposeWindow(g_system, win->ghostwin);
win->ghostwin = NULL;
- win->multisamples = 0;
}
}
@@ -461,16 +460,8 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
{
GHOST_WindowHandle ghostwin;
GHOST_GLSettings glSettings = {0};
- static int multisamples = -1;
int scr_w, scr_h, posy;
- /* force setting multisamples only once, it requires restart - and you cannot
- * mix it, either all windows have it, or none (tested in OSX opengl) */
- if (multisamples == -1)
- multisamples = U.ogl_multisamples;
-
- glSettings.numOfAASamples = multisamples;
-
/* a new window is created when pageflip mode is required for a window */
if (win->stereo3d_format->display_mode == S3D_DISPLAY_PAGEFLIP)
glSettings.flags |= GHOST_glStereoVisual;
@@ -508,9 +499,6 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
if (win->eventstate == NULL)
win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");
- /* store multisamples window was created with, in case user prefs change */
- win->multisamples = multisamples;
-
/* store actual window size in blender window */
bounds = GHOST_GetClientBounds(win->ghostwin);
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
index a9875020fbb..03fbe234a20 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
@@ -390,16 +390,9 @@ static void manipulators_draw_list(const wmManipulatorMap *mmap, const bContext
return;
}
- const bool draw_multisample = (U.ogl_multisamples != USER_MULTISAMPLE_NONE);
-
/* TODO this will need it own shader probably? don't think it can be handled from that point though. */
/* const bool use_lighting = (U.manipulator_flag & V3D_MANIPULATOR_SHADED) != 0; */
- /* enable multisampling */
- if (draw_multisample) {
- glEnable(GL_MULTISAMPLE);
- }
-
bool is_depth_prev = false;
/* draw_manipulators contains all visible manipulators - draw them */
@@ -435,10 +428,6 @@ static void manipulators_draw_list(const wmManipulatorMap *mmap, const bContext
if (is_depth_prev) {
glDisable(GL_DEPTH_TEST);
}
-
- if (draw_multisample) {
- glDisable(GL_MULTISAMPLE);
- }
}
void WM_manipulatormap_draw(