diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-04 02:27:12 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-04 02:27:59 +0300 |
commit | b0da78084bd73fd1bec25570da12515f127f1fd1 (patch) | |
tree | bac2069086eda2cddd9cd6c31e937cd00de07b22 /source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl | |
parent | cad98923d006e088a2f780e05e2aa1abe7b64b32 (diff) |
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
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl | 10 |
1 files changed, 10 insertions, 0 deletions
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 } |