From 218c254e72119603a82cf292c764c87702c528cf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Jul 2017 14:48:55 +1000 Subject: [PATCH 1/6] Resolve T51745: Mesh extrude keep-orig needs edges Document to avoid confusion when called from Python. --- source/blender/bmesh/intern/bmesh_opdefines.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 200a31b1a57..a55df234264 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1037,7 +1037,7 @@ static BMOpDefine bmo_extrude_face_region_def = { /* slots_in */ {{"geom", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT | BM_EDGE | BM_FACE}}, /* edges and faces */ {"edges_exclude", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_EMPTY}}, - {"use_keep_orig", BMO_OP_SLOT_BOOL}, /* keep original geometry */ + {"use_keep_orig", BMO_OP_SLOT_BOOL}, /* keep original geometry (requires ``geom`` to include edges). */ {"use_select_history", BMO_OP_SLOT_BOOL}, /* pass to duplicate */ {{'\0'}}, }, From d415a1cbd646b28f8b19da304b66dc580eb08763 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Jul 2017 19:07:37 +1000 Subject: [PATCH 2/6] Fix T49034: multi-drag crashes when UI forces exit --- source/blender/editors/interface/interface_utils.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 636b7e4e9ce..cf16cc9f50d 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -380,6 +380,17 @@ uiButStore *UI_butstore_create(uiBlock *block) void UI_butstore_free(uiBlock *block, uiButStore *bs_handle) { + /* Workaround for button store being moved into new block, + * which then can't use the previous buttons state ('ui_but_update_from_old_block' fails to find a match), + * keeping the active button in the old block holding a reference to the button-state in the new block: see T49034. + * + * Ideally we would manage moving the 'uiButStore', keeping a correct state. + * All things considered this is the most straightforward fix - Campbell. + */ + if (block != bs_handle->block && bs_handle->block != NULL) { + block = bs_handle->block; + } + BLI_freelistN(&bs_handle->items); BLI_remlink(&block->butstore, bs_handle); From 1dfc4be6abeded19b50373e909282208edb18b6d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 11 Jul 2017 11:05:21 +0200 Subject: [PATCH 3/6] Opensubdiv: Fix compilation error with older Opensubdiv versions --- intern/opensubdiv/opensubdiv_capi.cc | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/intern/opensubdiv/opensubdiv_capi.cc b/intern/opensubdiv/opensubdiv_capi.cc index 91803551f12..0a55a432cc6 100644 --- a/intern/opensubdiv/opensubdiv_capi.cc +++ b/intern/opensubdiv/opensubdiv_capi.cc @@ -75,6 +75,16 @@ #include "MEM_guardedalloc.h" +#include +#include + +using std::string; +using std::vector; + +#define STRINGIFY_ARG(x) "" #x +#define STRINGIFY_APPEND(a, b) "" a #b +#define STRINGIFY(x) STRINGIFY_APPEND("", x) + /* **************** Types declaration **************** */ using OpenSubdiv::Osd::GLMeshInterface; @@ -147,6 +157,38 @@ typedef Mesh* tokens, + const string& str, + const string& separators, + bool skip_empty) { + size_t token_start = 0, token_length = 0; + for (size_t i = 0; i < str.length(); ++i) { + const char ch = str[i]; + if (separators.find(ch) == string::npos) { + /* Append non-separator char to a token. */ + ++token_length; + } else { + /* Append current token to the list (if any). */ + if (token_length > 0 || !skip_empty) { + string token = str.substr(token_start, token_length); + tokens->push_back(token); + } + /* Re-set token pointers, */ + token_start = i + 1; + token_length = 0; + } + } + /* Append token which might be at the end of the string. */ + if ((token_length != 0) || + (!skip_empty && token_start > 0 && + separators.find(str[token_start-1]) != string::npos)) { + string token = str.substr(token_start, token_length); + tokens->push_back(token); + } +} +#endif + struct FVarVertex { float u, v; void Clear() { @@ -385,5 +427,27 @@ int openSubdiv_supportGPUDisplay(void) int openSubdiv_getVersionHex(void) { +#if defined(OPENSUBDIV_VERSION_NUMBER) return OPENSUBDIV_VERSION_NUMBER; +#elif defined(OPENSUBDIV_VERSION_MAJOR) + return OPENSUBDIV_VERSION_MAJOR * 10000 + + OPENSUBDIV_VERSION_MINOR * 100 + + OPENSUBDIV_VERSION_PATCH; +#elif defined(OPENSUBDIV_VERSION) + const char* version = STRINGIFY(OPENSUBDIV_VERSION); + if (version[0] == 'v') { + version += 1; + } + int major = 0, minor = 0, patch = 0; + vector tokens; + stringSplit(&tokens, version, "_", true); + if (tokens.size() == 3) { + major = atoi(tokens[0].c_str()); + minor = atoi(tokens[1].c_str()); + patch = atoi(tokens[2].c_str()); + } + return major * 10000 + minor * 100 + patch; +#else + return 0; +#endif } From d5d7d453a5ce506e2d01e0d329447168135c4cb4 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 11 Jul 2017 11:06:36 +0200 Subject: [PATCH 4/6] Fix memory leak caused by node clipboard The issue was caused by combination of following factors: - Clipboard cleanup function will pass node tree as NULL to node free function. This is fine on it's own, we don't have tree in clipboard. - Node free function will call node storage cleanup only when there is a non-NULL node tree. This is somewhat weird, because storage cleanup does not take node tree as argument. So the solution here: move node storage cleanup outside of check that node tree is not NULL. --- source/blender/blenkernel/intern/node.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 78323557ae2..5acfe4a0aa4 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1700,11 +1700,12 @@ static void node_free_node_ex(bNodeTree *ntree, bNode *node, bool remove_animdat ntreeTexEndExecTree(ntree->execdata); ntree->execdata = NULL; } - - if (node->typeinfo->freefunc) - node->typeinfo->freefunc(node); } - + + if (node->typeinfo->freefunc) { + node->typeinfo->freefunc(node); + } + for (sock = node->inputs.first; sock; sock = nextsock) { nextsock = sock->next; node_socket_free(ntree, sock, node); From 36ef6ff66b292820ea769656c2c2d526184a23ba Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Tue, 11 Jul 2017 11:17:36 +0200 Subject: [PATCH 5/6] Theme Flatty Light Color GraphEditor tabs, brighter 3D viewport gradient --- .../presets/interface_theme/flatty_light.xml | 69 ++++++++++--------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/release/scripts/presets/interface_theme/flatty_light.xml b/release/scripts/presets/interface_theme/flatty_light.xml index 623e0b334dd..c89cbd92ca0 100644 --- a/release/scripts/presets/interface_theme/flatty_light.xml +++ b/release/scripts/presets/interface_theme/flatty_light.xml @@ -216,7 +216,7 @@ - + paint_curve_pivot="#ff7f7f7f" + outline_width="1"> + gradient="#444444" + high_gradient="#858585"> @@ -348,6 +350,7 @@ vertex="#000000" vertex_select="#ff8500" vertex_size="6" + vertex_bevel="#000000" vertex_unreferenced="#000000" handle_free="#000000" handle_auto="#909000" @@ -372,13 +375,13 @@ header_text="#000000" header_text_hi="#ffffff" button="#999999e6" - button_title="#000000" + button_title="#1a1a1a" button_text="#000000" button_text_hi="#ffffff" - tab_active="#727272" - tab_inactive="#535353" - tab_back="#404040ff" - tab_outline="#3c3c3c"> + tab_active="#6697e6" + tab_inactive="#cccccc" + tab_back="#999999ff" + tab_outline="#999999"> - + + tab_inactive="#cccccc" + tab_back="#999999ff" + tab_outline="#999999"> Date: Tue, 11 Jul 2017 12:16:58 +0200 Subject: [PATCH 6/6] Cycles: Disable OpenCL clFlush workarounds This is something which was reported to work fine by Mai, Benjamin and confirmed by myself. Disabling this workaround gains us some speedup: Before Now bmw27 04:28.42 04:07.79 classroom 09:26.48 08:54.53 fishy_cat 08:44.01 08:18.70 koro 09:17.98 08:57.18 pavillon_barcelone 12:26.64 11:52.81 Test environment is: - Ubuntu 16.04, with all updates installed - AMD RX 480 GPU - amdgpu pro driver version 17.10-450821 --- intern/cycles/device/opencl/opencl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h index 7da690904aa..78ca377d933 100644 --- a/intern/cycles/device/opencl/opencl.h +++ b/intern/cycles/device/opencl/opencl.h @@ -27,6 +27,9 @@ CCL_NAMESPACE_BEGIN +/* Disable workarounds, seems to be working fine on latest drivers. */ +#define CYCLES_DISABLE_DRIVER_WORKAROUNDS + /* Define CYCLES_DISABLE_DRIVER_WORKAROUNDS to disable workaounds for testing */ #ifndef CYCLES_DISABLE_DRIVER_WORKAROUNDS /* Work around AMD driver hangs by ensuring each command is finished before doing anything else. */