From be5123a0a9c1aa9d4fa4dadcf754c65109ee2c2c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 2 Nov 2017 12:33:39 +0100 Subject: [PATCH 1/3] Space clip: Make it more clear that filter track does not use any settings from tool shelf --- release/scripts/startup/bl_ui/space_clip.py | 1 + 1 file changed, 1 insertion(+) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 11043ed1111..1cb2275a86f 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -471,6 +471,7 @@ class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel): layout.prop(settings, "clean_frames", text="Frames") layout.prop(settings, "clean_error", text="Error") layout.prop(settings, "clean_action", text="") + layout.separator() layout.operator("clip.filter_tracks") From 5cb873068920aad7be92439c69e75c553edff4b5 Mon Sep 17 00:00:00 2001 From: Mai Lavelle Date: Thu, 2 Nov 2017 08:10:24 -0400 Subject: [PATCH 2/3] Cycles: Add another limit to OpenCL memory usage Some drivers may report very large allocation sizes, which could cause unnecessary memory usage. This is now limited to 2gb which should still be enough to get the needed performance benefits without waste. --- intern/cycles/device/opencl/opencl_split.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp index ae623d22f07..2125f3d126f 100644 --- a/intern/cycles/device/opencl/opencl_split.cpp +++ b/intern/cycles/device/opencl/opencl_split.cpp @@ -430,7 +430,10 @@ public: << string_human_readable_number(max_buffer_size) << " bytes. (" << string_human_readable_size(max_buffer_size) << ")."; - size_t num_elements = max_elements_for_max_buffer_size(kg, data, max_buffer_size / 2); + /* Limit to 2gb, as we shouldn't need more than that and some devices may support much more. */ + max_buffer_size = min(max_buffer_size / 2, (cl_ulong)2l*1024*1024*1024); + + size_t num_elements = max_elements_for_max_buffer_size(kg, data, max_buffer_size); int2 global_size = make_int2(max(round_down((int)sqrt(num_elements), 64), 64), (int)sqrt(num_elements)); VLOG(1) << "Global size: " << global_size << "."; return global_size; From 6355d98267963984160b7cae212d0353b6846a7d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Nov 2017 00:22:59 +1100 Subject: [PATCH 3/3] UI: free up bit in uiBut.flag --- source/blender/editors/include/UI_interface.h | 2 +- .../editors/interface/interface_intern.h | 3 +-- .../editors/interface/interface_widgets.c | 18 ++++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index a4720aa8b83..1482937d6a0 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -155,7 +155,7 @@ enum { /* but->flag - general state flags. */ enum { - /* warning, the first 6 flags are internal */ + /* warning, the first 5 flags are internal */ UI_BUT_ICON_SUBMENU = (1 << 6), UI_BUT_ICON_PREVIEW = (1 << 7), diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index da11c2abab2..7ee18549342 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -118,8 +118,7 @@ enum { UI_SCROLLED = (1 << 1), /* temp hidden, scrolled away */ UI_ACTIVE = (1 << 2), UI_HAS_ICON = (1 << 3), - UI_TEXTINPUT = (1 << 4), - UI_HIDDEN = (1 << 5), + UI_HIDDEN = (1 << 4), /* warn: rest of uiBut->flag in UI_interface.h */ }; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 79571e24a4b..9c80b30100d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -67,14 +67,16 @@ #define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect)) #define UI_BUT_FLAGS_PUBLIC \ - (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_TEXTINPUT | UI_HIDDEN) + (UI_SELECT | UI_SCROLLED | UI_ACTIVE | UI_HAS_ICON | UI_HIDDEN) -/* Bits 0..5 are from UI_SELECT .. etc */ +/* Don't overlap w/ UI_BUT_FLAGS_PUBLIC buts. */ enum { /* Show that holding the button opens a menu. */ UI_STATE_HOLD_ACTION = (1 << 6), + UI_STATE_TEXT_INPUT = (1 << 7), }; + /* ************** widget base functions ************** */ /** * - in: roundbox codes for corner types and radius @@ -1984,7 +1986,7 @@ static void widget_state(uiWidgetType *wt, int state) { uiWidgetStateColors *wcol_state = wt->wcol_state; - if ((state & UI_BUT_LIST_ITEM) && !(state & UI_TEXTINPUT)) { + if ((state & UI_BUT_LIST_ITEM) && !(state & UI_STATE_TEXT_INPUT)) { /* Override default widget's colors. */ bTheme *btheme = UI_GetTheme(); wt->wcol_theme = &btheme->tui.wcol_list_item; @@ -2678,14 +2680,14 @@ static void widget_numbut_draw(uiWidgetColors *wcol, rcti *rect, int state, int } /* decoration */ - if (!(state & UI_TEXTINPUT)) { + if (!(state & UI_STATE_TEXT_INPUT)) { shape_preset_init_number_arrows(&wtb.tria1, rect, 0.6f, 'l'); shape_preset_init_number_arrows(&wtb.tria2, rect, 0.6f, 'r'); } widgetbase_draw(&wtb, wcol); - if (!(state & UI_TEXTINPUT)) { + if (!(state & UI_STATE_TEXT_INPUT)) { /* text space */ rect->xmin += textofs; rect->xmax -= textofs; @@ -2964,7 +2966,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s widgetbase_draw(&wtb, wcol); /* draw left/right parts only when not in text editing */ - if (!(state & UI_TEXTINPUT)) { + if (!(state & UI_STATE_TEXT_INPUT)) { int roundboxalign_slider; /* slider part */ @@ -3015,7 +3017,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s widgetbase_draw(&wtb, wcol); /* add space at either side of the button so text aligns with numbuttons (which have arrow icons) */ - if (!(state & UI_TEXTINPUT)) { + if (!(state & UI_STATE_TEXT_INPUT)) { rect->xmax -= toffs; rect->xmin += toffs; } @@ -3910,7 +3912,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct if ((but->editstr) || (UNLIKELY(but->flag & UI_BUT_DRAG_MULTI) && ui_but_drag_multi_edit_get(but))) { - state |= UI_TEXTINPUT; + state |= UI_STATE_TEXT_INPUT; } if (but->hold_func) {