diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-24 12:24:57 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-24 12:24:57 +0300 |
commit | 22b8ac80d2857caa1fe77d6ec3c90b547b1152a7 (patch) | |
tree | 8792c964a346069f71937dc6d05ff6187e9ad87b /source/blender | |
parent | 13fa4b98986e569f0e4c6a7945104ebd59567f96 (diff) | |
parent | 38863924305367eaae65d9447f8a306b86d6ea44 (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c8f2bec145b..c9c460c6a72 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -53,6 +53,7 @@ #include "GPU_immediate.h" #include "GPU_immediate_util.h" #include "GPU_matrix.h" +#include "GPU_platform.h" #include "GPU_state.h" #ifdef WITH_INPUT_IME @@ -1208,6 +1209,26 @@ void UI_widgetbase_draw_cache_end(void) GPU_blend(false); } +/* Disable cached/instanced drawing and enforce single widget drawing pipeline. + * Works around interface artifacts happening on certain driver and hardware + * configurations. */ +static bool draw_widgetbase_batch_skip_draw_cache(void) +{ + /* MacOS is known to have issues on Mac Mini and MacBook Pro with Intel Iris GPU. + * For example, T78307. */ + if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_ANY)) { + return true; + } + + /* There are also reports that some AMD and Mesa driver configuration suffer from the + * same issue, T78803. */ + if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE)) { + return true; + } + + return false; +} + static void draw_widgetbase_batch(uiWidgetBase *wtb) { wtb->uniform_params.tria_type = wtb->tria1.type; @@ -1216,7 +1237,7 @@ static void draw_widgetbase_batch(uiWidgetBase *wtb) copy_v2_v2(wtb->uniform_params.tria1_center, wtb->tria1.center); copy_v2_v2(wtb->uniform_params.tria2_center, wtb->tria2.center); - if (g_widget_base_batch.enabled) { + if (g_widget_base_batch.enabled && !draw_widgetbase_batch_skip_draw_cache()) { g_widget_base_batch.params[g_widget_base_batch.count] = wtb->uniform_params; g_widget_base_batch.count++; |