[Mesa-dev] [PATCH] st/mesa: respect higher GLSL levels.

Brian Paul brianp at vmware.com
Mon Oct 21 00:00:40 CEST 2013


On 10/20/2013 01:07 PM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> If a driver wants to expose higher glsl levels have the state tracker
> respect them.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>   src/mesa/state_tracker/st_extensions.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
> index 97dd732..ceb6f31 100644
> --- a/src/mesa/state_tracker/st_extensions.c
> +++ b/src/mesa/state_tracker/st_extensions.c
> @@ -591,7 +591,11 @@ void st_init_extensions(struct st_context *st)
>      /* Figure out GLSL support. */
>      glsl_feature_level = screen->get_param(screen, PIPE_CAP_GLSL_FEATURE_LEVEL);
>
> -   if (glsl_feature_level >= 140) {
> +   if (glsl_feature_level >= 330) {
> +      ctx->Const.GLSLVersion = 330;
> +   } else if (glsl_feature_level >= 150) {
> +      ctx->Const.GLSLVersion = 150;
> +   } else if (glsl_feature_level >= 140) {
>         ctx->Const.GLSLVersion = 140;
>      } else if (glsl_feature_level >= 130) {
>         ctx->Const.GLSLVersion = 130;
>

Can't this code be simplified to read

ctx->Const.GLSLVersion = screen->get_param(screen, 
PIPE_CAP_GLSL_FEATURE_LEVEL);

-Brian



More information about the mesa-dev mailing list