[Mesa-dev] [PATCH v2 3/3] drirc: Add allow_glsl_builtin_variable_redeclaration for Dying Light and Dead Island Definitive Edition

John Brooks john at fastquake.com
Sat May 20 20:50:04 UTC 2017


On Sat, May 20, 2017 at 10:46:00PM +0200, Kai Wasserbäch wrote:
> Hey,
> John Brooks wrote on 15.05.2017 07:47:
> > This fixes the long-standing problem with Dying Light where the game would
> > produce a black screen when running under Mesa. This happened because the
> > game's vertex shaders redeclare gl_VertexID, which is a GLSL builtin.
> > Mesa's GLSL compiler is a little more strict than others, and would not
> > compile them:
> > 
> >     error: `gl_VertexID' redeclared
> > 
> > The allow_glsl_builtin_variable_redeclaration directive allows the shaders
> > to compile and the game to render. The game also requires OpenGL 4.4+ (GLSL
> > 440), but does not request it explicitly. It must be forced with an
> > override, such as MESA_GL_VERSION_OVERRIDE=4.5 and
> > MESA_GLSL_VERSION_OVERRIDE=450. A compatibility context is *not* required
> > and forcing one with 4.5COMPAT or allow_higher_compat_version results in
> > graphical artifacts.
> > 
> > [...]
> > +
> > +        <application name="Dying Light" executable="DyingLightGame">
> > +            <option name="allow_glsl_builtin_variable_redeclaration" value="true" />
> 
> 
> I know this has already landed and maybe I'm missing something, but why didn't
> you at least put the GLSL version requirements in the drirc as well? It should be
>   <option name="force_glsl_version" value="450" />
> 
> AFAIK there's no drirc option for the OpenGL level itself, though maybe that
> should just be added as well.
> 
> Cheers,
> Kai
> 

I didn't put it in because it wouldn't be useful without another option to set
the OpenGL version. I do think that would be a good thing to add though,
because this isn't the only game that needs these overrides. And it'd be better
to put them in the drirc for games that are known to need it, than make the
user set the override environment variables.

John



More information about the mesa-dev mailing list