diff options
author | Samuel Pitoiset <[email protected]> | 2017-02-14 16:18:24 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-02-15 16:15:32 +0100 |
commit | 9d16f3903e2caddb7f674ca7ab7b1e96cfffbb2b (patch) | |
tree | d04f78fb450fa43802ae5c137f6cd7f6f6095951 /src/mesa/main | |
parent | d1fae627fa63cf7749d4fb2ebb57ae5b13a7d5ef (diff) |
driconf: add allow_higher_compat_version option
Mesa currently doesn't allow to create 3.1+ compatibility profiles
mainly because various features are unimplemented and bugs can
happen.
However, some buggy apps request a compat profile without using
any old features unimplemented in mesa, and they fail to start.
This option should help some games to run but it's not enough
for all (eg. Dying Light).
v2: - s/force_compat_profile/allow_higher_compat_version
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Edmondo Tommasina <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/mtypes.h | 7 | ||||
-rw-r--r-- | src/mesa/main/version.c | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index a845a394c8f..08bd929255c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3501,6 +3501,13 @@ struct gl_constants GLboolean AllowGLSLExtensionDirectiveMidShader; /** + * Allow creating a higher compat profile (version 3.1+) for apps that + * request it. Be careful when adding that driconf option because some + * features are unimplemented and might not work correctly. + */ + GLboolean AllowHigherCompatVersion; + + /** * Force uninitialized variables to default to zero. */ GLboolean GLSLZeroInit; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 85ec9de6122..3d54d21a042 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -566,8 +566,10 @@ _mesa_get_version(const struct gl_extensions *extensions, case API_OPENGL_COMPAT: /* Disable GLSL 1.40 and later for legacy contexts. * This disallows creation of the GL 3.1 compatibility context. */ - if (consts->GLSLVersion > 130) { - consts->GLSLVersion = 130; + if (!consts->AllowHigherCompatVersion) { + if (consts->GLSLVersion > 130) { + consts->GLSLVersion = 130; + } } /* fall through */ case API_OPENGL_CORE: |