Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| #include "interface_intern.h" | #include "interface_intern.h" | ||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | ||||
| #include "GPU_batch_presets.h" | #include "GPU_batch_presets.h" | ||||
| #include "GPU_immediate.h" | #include "GPU_immediate.h" | ||||
| #include "GPU_immediate_util.h" | #include "GPU_immediate_util.h" | ||||
| #include "GPU_matrix.h" | #include "GPU_matrix.h" | ||||
| #include "GPU_platform.h" | |||||
| #include "GPU_state.h" | #include "GPU_state.h" | ||||
| #ifdef WITH_INPUT_IME | #ifdef WITH_INPUT_IME | ||||
| # include "WM_types.h" | # include "WM_types.h" | ||||
| #endif | #endif | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Local Enums/Defines | /** \name Local Enums/Defines | ||||
| ▲ Show 20 Lines • Show All 1,139 Lines • ▼ Show 20 Lines | void UI_widgetbase_draw_cache_end(void) | ||||
| GPU_blend(true); | GPU_blend(true); | ||||
| UI_widgetbase_draw_cache_flush(); | UI_widgetbase_draw_cache_flush(); | ||||
| GPU_blend(false); | 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)) { | |||||
fclem: it's linux that should be here. not GPU_OS_MAC.
also it's amd gpu. see T78803 | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| static void draw_widgetbase_batch(uiWidgetBase *wtb) | static void draw_widgetbase_batch(uiWidgetBase *wtb) | ||||
| { | { | ||||
| wtb->uniform_params.tria_type = wtb->tria1.type; | wtb->uniform_params.tria_type = wtb->tria1.type; | ||||
| wtb->uniform_params.tria1_size = wtb->tria1.size; | wtb->uniform_params.tria1_size = wtb->tria1.size; | ||||
| wtb->uniform_params.tria2_size = wtb->tria2.size; | wtb->uniform_params.tria2_size = wtb->tria2.size; | ||||
| copy_v2_v2(wtb->uniform_params.tria1_center, wtb->tria1.center); | copy_v2_v2(wtb->uniform_params.tria1_center, wtb->tria1.center); | ||||
| copy_v2_v2(wtb->uniform_params.tria2_center, wtb->tria2.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.params[g_widget_base_batch.count] = wtb->uniform_params; | ||||
| g_widget_base_batch.count++; | g_widget_base_batch.count++; | ||||
| if (g_widget_base_batch.count == MAX_WIDGET_BASE_BATCH) { | if (g_widget_base_batch.count == MAX_WIDGET_BASE_BATCH) { | ||||
| UI_widgetbase_draw_cache_flush(); | UI_widgetbase_draw_cache_flush(); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 4,110 Lines • Show Last 20 Lines | |||||
it's linux that should be here. not GPU_OS_MAC.
also it's amd gpu. see T78803