From b0da78084bd73fd1bec25570da12515f127f1fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 4 Jul 2020 01:27:12 +0200 Subject: UI: Attempt to fix OSX widget shader issue Some OSX GL driver implementation needs a dummy vbo read. This fixed issues with the Hair shaders in the past. Related to T78307 --- source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl') diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl index 2fd5effccce..7309549062c 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl @@ -43,6 +43,10 @@ flat out float lineWidth; noperspective out float butCo; flat out float discardFac; +#ifdef OS_MAC +in float dummy; +#endif + vec2 do_widget(void) { lineWidth = abs(rect.x - recti.x); @@ -175,4 +179,10 @@ void main() vec2 pos = (is_tria) ? do_tria() : do_widget(); gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0); + +#ifdef OS_MAC + /* Generate a dummy read to avoid the driver bug with shaders having no + * vertex reads on macOS (T78307) */ + gl_Position.x += dummy * 0.0; +#endif } -- cgit v1.2.3