[Mesa-dev] [PATCH 1/3] glx: Relax validate_renderType_against_config for EXT_no_config_context

Ian Romanick idr at freedesktop.org
Mon Nov 13 17:47:10 UTC 2017


On 11/07/2017 10:36 AM, Adam Jackson wrote:
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  src/glx/glxcmds.c | 30 +++++++++++++++++-------------
>  1 file changed, 17 insertions(+), 13 deletions(-)
> 
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index 10c7c2c3eb..c707d0cedf 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -235,19 +235,23 @@ Bool
>  validate_renderType_against_config(const struct glx_config *config,
>                                     int renderType)
>  {
> -    switch (renderType) {
> -    case GLX_RGBA_TYPE:
> -        return (config->renderType & GLX_RGBA_BIT) != 0;
> -    case GLX_COLOR_INDEX_TYPE:
> -        return (config->renderType & GLX_COLOR_INDEX_BIT) != 0;
> -    case GLX_RGBA_FLOAT_TYPE_ARB:
> -        return (config->renderType & GLX_RGBA_FLOAT_BIT_ARB) != 0;
> -    case GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT:
> -        return (config->renderType & GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT) != 0;
> -    default:
> -        break;
> -    }
> -    return 0;
> +   /* GLX_EXT_no_config_context supports any render type */
> +   if (!config)
> +      return True;
> +
> +   switch (renderType) {
> +      case GLX_RGBA_TYPE:

For future reference... the case should be indented at the same level as
the switch in Mesa.

> +         return (config->renderType & GLX_RGBA_BIT) != 0;
> +      case GLX_COLOR_INDEX_TYPE:
> +         return (config->renderType & GLX_COLOR_INDEX_BIT) != 0;
> +      case GLX_RGBA_FLOAT_TYPE_ARB:
> +         return (config->renderType & GLX_RGBA_FLOAT_BIT_ARB) != 0;
> +      case GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT:
> +         return (config->renderType & GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT) != 0;
> +      default:
> +         break;
> +   }
> +   return 0;
>  }
>  
>  _X_HIDDEN Bool
> 



More information about the mesa-dev mailing list