Mesa (master): drirc: Add allow_glsl_builtin_variable_redeclaration for Dying Light and Dead Island Definitive Edition
Samuel Pitoiset
hakzsam at kemper.freedesktop.org
Sat May 20 15:34:04 UTC 2017
Module: Mesa
Branch: master
Commit: 2b878cb8fdb99dd84602553c2e95ef47747f4529
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b878cb8fdb99dd84602553c2e95ef47747f4529
Author: John Brooks <john at fastquake.com>
Date: Mon May 15 01:47:39 2017 -0400
drirc: Add allow_glsl_builtin_variable_redeclaration for Dying Light and Dead Island Definitive Edition
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.
Dead Island Definitive Edition is another Techland port on the same engine
with the same problems, so we set the
allow_glsl_builtin_variable_redeclaration option for that game as well.
v2 (Samuel Pitoiset):
- Rename allow_glsl_builtin_redeclaration ->
allow_glsl_builtin_variable_redeclaration
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96449
Signed-off-by: John Brooks <john at fastquake.com>
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/mesa/drivers/dri/common/drirc | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/common/drirc b/src/mesa/drivers/dri/common/drirc
index 14d7713fdc..8093e8e42a 100644
--- a/src/mesa/drivers/dri/common/drirc
+++ b/src/mesa/drivers/dri/common/drirc
@@ -17,6 +17,10 @@ Application bugs worked around in this file:
an #extension directive in the middle of its shaders, which is illegal
in GLSL.
+* Dying Light and Dead Island Definitive Edition redeclare vertex shader
+ built-ins (specifically gl_VertexID), which causes the vertex shaders to fail
+ to compile.
+
TODO: document the other workarounds.
-->
@@ -81,8 +85,15 @@ TODO: document the other workarounds.
<option name="always_have_depth_buffer" value="true" />
</application>
- <application name="Dead Island" executable="DeadIslandGame">
+ <application name="Dead Island (incl. Definitive Edition)" executable="DeadIslandGame">
<option name="allow_glsl_extension_directive_midshader" value="true" />
+
+ <!-- For the Definitive Edition which shares the same executable name -->
+ <option name="allow_glsl_builtin_variable_redeclaration" value="true" />
+ </application>
+
+ <application name="Dying Light" executable="DyingLightGame">
+ <option name="allow_glsl_builtin_variable_redeclaration" value="true" />
</application>
<application name="Second Life" executable="do-not-directly-run-secondlife-bin">
More information about the mesa-commit
mailing list