Ultimaker / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
5.97k stars 2.05k forks source link

EGL/GLES Compatibility bug in grid.shader #2991

Open jwalt opened 6 years ago

jwalt commented 6 years ago

Hi!

Using ARM Mali drivers, Cura's gid.shader does not compile. There are two issues with it.

A shader preamble like this works perfectly:

fragment =
    #extension GL_OES_standard_derivatives : enable
    #ifdef GL_ES
        #ifdef GL_FRAGMENT_PRECISION_HIGH
            precision highp float;
        #else
            precision mediump float;
        #endif // GL_FRAGMENT_PRECISION_HIGH
    #endif // GL_ES
thopiekar commented 6 years ago

Could you provide a PR for the second point?

Thanks!

Ghostkeeper commented 6 years ago

I'd rather put that extra line inside the #ifdef GL_ES, since you say that the disabled fwidth is only a problem in EGL/GLESv2. Maybe you could check if this still works?

fragment =
    #ifdef GL_ES
        #extension GL_OES_standard_derivatives : enable
        #ifdef GL_FRAGMENT_PRECISION_HIGH
            precision highp float;
        #else
            precision mediump float;
        #endif // GL_FRAGMENT_PRECISION_HIGH
    #endif // GL_ES
jwalt commented 6 years ago

@Ghostkeeper , yes that works. My PR contains that version.