[Mesa-dev] [PATCH] mesa: add better GLSL override support for compat profile
Iago Toral
itoral at igalia.com
Mon Jun 18 09:38:20 UTC 2018
On Mon, 2018-06-18 at 12:51 +1000, Timothy Arceri wrote:
> ---
> src/mesa/main/version.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
> index 1bdccf4a1df..0d2597a61f4 100644
> --- a/src/mesa/main/version.c
> +++ b/src/mesa/main/version.c
> @@ -228,6 +228,7 @@ _mesa_override_glsl_version(struct gl_constants
> *consts)
> }
>
> n = sscanf(version, "%u", &consts->GLSLVersion);
> + consts->GLSLVersionCompat = consts->GLSLVersion;
> if (n != 1) {
> fprintf(stderr, "error: invalid value for %s: %s\n", env_var,
> version);
> return;
> @@ -624,16 +625,21 @@ _mesa_compute_version(struct gl_context *ctx)
> switch (ctx->Version) {
> case 30:
> ctx->Const.GLSLVersion = 130;
> + ctx->Const.GLSLVersionCompat = 130;
> break;
> case 31:
> ctx->Const.GLSLVersion = 140;
> + ctx->Const.GLSLVersionCompat = 140;
> break;
> case 32:
> ctx->Const.GLSLVersion = 150;
> + ctx->Const.GLSLVersionCompat = 150;
> break;
> default:
> - if (ctx->Version >= 33)
> + if (ctx->Version >= 33) {
> ctx->Const.GLSLVersion = ctx->Version * 10;
> + ctx->Const.GLSLVersionCompat = ctx->Version * 10;
> + }
> break;
Looks like we should be able to just do this after the switch right?:
ctx->Const.GLSLVersionCompat = ctx->Const.GLSLVersion;
I'd prefer this unless there is something I am missing.
With that:
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
> }
> }
More information about the mesa-dev
mailing list