mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
mesa: add GLSLVersionCompat constant
This allows drivers to define what version of GLSL they support in compat. This will be needed in order to support compat 3.2 without breaking drivers that wont support it. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
be3ee9d141
commit
4560aad780
5 changed files with 10 additions and 3 deletions
|
|
@ -78,6 +78,7 @@ intelInitExtensions(struct gl_context *ctx)
|
||||||
ctx->Extensions.OES_draw_texture = true;
|
ctx->Extensions.OES_draw_texture = true;
|
||||||
|
|
||||||
ctx->Const.GLSLVersion = 120;
|
ctx->Const.GLSLVersion = 120;
|
||||||
|
ctx->Const.GLSLVersionCompat = 120;
|
||||||
_mesa_override_glsl_version(&ctx->Const);
|
_mesa_override_glsl_version(&ctx->Const);
|
||||||
|
|
||||||
if (intel->gen >= 3) {
|
if (intel->gen >= 3) {
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,12 @@ intelInitExtensions(struct gl_context *ctx)
|
||||||
ctx->Const.GLSLVersion = 330;
|
ctx->Const.GLSLVersion = 330;
|
||||||
else
|
else
|
||||||
ctx->Const.GLSLVersion = 120;
|
ctx->Const.GLSLVersion = 120;
|
||||||
|
|
||||||
|
if (devinfo->gen >= 6)
|
||||||
|
ctx->Const.GLSLVersionCompat = 130;
|
||||||
|
else
|
||||||
|
ctx->Const.GLSLVersionCompat = 120;
|
||||||
|
|
||||||
_mesa_override_glsl_version(&ctx->Const);
|
_mesa_override_glsl_version(&ctx->Const);
|
||||||
|
|
||||||
ctx->Extensions.EXT_shader_integer_mix = ctx->Const.GLSLVersion >= 130;
|
ctx->Extensions.EXT_shader_integer_mix = ctx->Const.GLSLVersion >= 130;
|
||||||
|
|
|
||||||
|
|
@ -3649,6 +3649,7 @@ struct gl_constants
|
||||||
GLuint MaxGeometryTotalOutputComponents;
|
GLuint MaxGeometryTotalOutputComponents;
|
||||||
|
|
||||||
GLuint GLSLVersion; /**< Desktop GLSL version supported (ex: 120 = 1.20) */
|
GLuint GLSLVersion; /**< Desktop GLSL version supported (ex: 120 = 1.20) */
|
||||||
|
GLuint GLSLVersionCompat; /**< Desktop compat GLSL version supported */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes default GLSL extension behavior from "error" to "warn". It's out
|
* Changes default GLSL extension behavior from "error" to "warn". It's out
|
||||||
|
|
|
||||||
|
|
@ -588,9 +588,7 @@ _mesa_get_version(const struct gl_extensions *extensions,
|
||||||
/* Disable higher GLSL versions for legacy contexts.
|
/* Disable higher GLSL versions for legacy contexts.
|
||||||
* This disallows creation of higher compatibility contexts. */
|
* This disallows creation of higher compatibility contexts. */
|
||||||
if (!consts->AllowHigherCompatVersion) {
|
if (!consts->AllowHigherCompatVersion) {
|
||||||
if (consts->GLSLVersion > 140) {
|
consts->GLSLVersion = consts->GLSLVersionCompat;
|
||||||
consts->GLSLVersion = 140;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case API_OPENGL_CORE:
|
case API_OPENGL_CORE:
|
||||||
|
|
|
||||||
|
|
@ -936,6 +936,7 @@ void st_init_extensions(struct pipe_screen *screen,
|
||||||
|
|
||||||
/* Figure out GLSL support and set GLSLVersion to it. */
|
/* Figure out GLSL support and set GLSLVersion to it. */
|
||||||
consts->GLSLVersion = screen->get_param(screen, PIPE_CAP_GLSL_FEATURE_LEVEL);
|
consts->GLSLVersion = screen->get_param(screen, PIPE_CAP_GLSL_FEATURE_LEVEL);
|
||||||
|
consts->GLSLVersionCompat = 140;
|
||||||
|
|
||||||
_mesa_override_glsl_version(consts);
|
_mesa_override_glsl_version(consts);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue