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
This commit is contained in:
Clément Foucault 2020-07-04 01:27:12 +02:00
parent cad98923d0
commit b0da78084b
1 changed files with 10 additions and 0 deletions

View File

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