[Mesa-dev] [PATCH 0/2] Allow redeclaration of GLSL builtins; fixes Dying Light and Dead Island Definitive Edition
John Brooks
john at fastquake.com
Fri May 12 14:11:02 UTC 2017
On Fri, May 12, 2017 at 03:56:26PM +0200, Samuel Pitoiset wrote:
>
>
> On 05/12/2017 03:39 PM, John Brooks wrote:
> >Since release, Dying Light and Dead Island Definitive Edition have been broken
> >on Mesa, producing at best only a black screen after loading. I found that the
> >root of the problem is that their vertex shaders redeclare the GLSL builtin
> >gl_VertexID, which Mesa's compiler considers to be an error:
> >
> > error: `gl_VertexID' redeclared
> >
> >These patches make the compiler more lenient so that the shaders compile.
> >Because such redeclarations are not explicitly valid in the spec, this
> >behaviour is selectively activated by the new allow_glsl_builtin_redeclaration
> >driconf option, which has been enabled for both games in the default drirc.
> >
> >With this change, both games work on Mesa and render correctly. Note that the
> >games require OpenGL 4.4+, and so it is necessary to launch them with
> >MESA_GL_VERSION_OVERRIDE and MESA_GLSL_VERSION_OVERRIDE set to OpenGL 4.4 (GLSL
> >440) or higher.
> >
> >Contrary to popular belief, this problem actually had nothing whatsoever to do
> >with compatibility profiles. Forcing Mesa to create a higher version
> >compatibility profile with MESA_GL_VERSION_OVERRIDE=4.5COMPAT or
> >allow_higher_compat_version results in graphical glitches, so don't use that.
>
> I wonder if there is multiple versions of Dying Light, but using
> MESA_GL_VERSION_OVERRIDE=4.4 and MESA_GLSL_VERSION_OVERRIDE=440 doesn't work
> for me (game crash at launching). Also it requests some unsupported GL
> functions (compat?).
>
> IIRC, Dying Light wants a GL 4.4 compat profile, I guess Timothy can
> confirm?
>
> What's your steam app ID?
>
> Btw, you probably don't need to override the GL/GLSL versions, it should be
> backward compatible.
>
Steam App ID 239140. The use of legacy functions (such as glBegin) in frame 0
is SDL's doing:
<https://github.com/spurious/SDL-mirror/blob/master/src/render/opengl/SDL_render_gl.c#L1334>
I don't know why your game would crash on launch. My first thought would be
steam runtime issues though. Make sure Steam runtime is enabled and remove
~/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6
The version override is necessary since the game will not render at all with a
3.0 compat profile, which is what it gets without an override.
--
John Brooks
Frogging101 on IRC and elsewhere
More information about the mesa-dev
mailing list