[Bf-blender-cvs] [b0da78084bd] master: UI: Attempt to fix OSX widget shader issue

Clément Foucault noreply at git.blender.org
Sat Jul 4 01:28:07 CEST 2020


Commit: b0da78084bd73fd1bec25570da12515f127f1fd1
Author: Clément Foucault
Date:   Sat Jul 4 01:27:12 2020 +0200
Branches: master
https://developer.blender.org/rBb0da78084bd73fd1bec25570da12515f127f1fd1

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

===================================================================

M	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
 }



More information about the Bf-blender-cvs mailing list