<p dir="ltr">Hi,</p>
<p dir="ltr">to switch to the macro would mean to check also the version. I'd prefer to keep the original behaviour but, if it's necessary I'll change it..</p>
<p dir="ltr">Francesco</p>
<div class="gmail_extra"><br><div class="gmail_quote">Il 31 ago 2016 01:39, "Ilia Mirkin" <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> ha scritto:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">On Mon, Aug 29, 2016 at 1:25 AM, Francesco Ansanelli<br>
<<a href="mailto:francians@gmail.com">francians@gmail.com</a>> wrote:<br>
> V2:use the same tokens of the desktop version<br>
>   (Ilia Mirkin, Chris Forbes)<br>
><br>
> Signed-off-by: Francesco Ansanelli <<a href="mailto:francians@gmail.com">francians@gmail.com</a>><br>
> ---<br>
>  src/mesa/main/context.h  |    7 +++++++<br>
>  src/mesa/main/texparam.c |   22 ++++++++++------------<br>
>  2 files changed, 17 insertions(+), 12 deletions(-)<br>
><br>
> diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h<br>
> index 4cd149d..bdf4414 100644<br>
> --- a/src/mesa/main/context.h<br>
> +++ b/src/mesa/main/context.h<br>
> @@ -358,6 +358,13 @@ _mesa_has_texture_cube_map_<wbr>array(const struct gl_context *ctx)<br>
>            _mesa_has_OES_texture_cube_<wbr>map_array(ctx);<br>
>  }<br>
><br>
> +static inline bool<br>
> +_mesa_has_texture_view(const struct gl_context *ctx)<br>
> +{<br>
> +   return _mesa_has_OES_texture_view(<wbr>ctx) ||<br>
> +          (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_<wbr>view);<br>
<br>
</div>I think you just want || _mesa_has_ARB_texture_view(<wbr>ctx).<br>
<div class="elided-text"><br>
> +}<br>
> +<br>
>  #ifdef __cplusplus<br>
>  }<br>
>  #endif<br>
> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c<br>
> index bdd3fcb..2c99804 100644<br>
> --- a/src/mesa/main/texparam.c<br>
> +++ b/src/mesa/main/texparam.c<br>
> @@ -1929,33 +1929,32 @@ get_tex_parameterfv(struct gl_context *ctx,<br>
>           break;<br>
><br>
>        case GL_TEXTURE_IMMUTABLE_LEVELS:<br>
> -         if (_mesa_is_gles3(ctx) ||<br>
> -             (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_<wbr>view))<br>
> +         if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx))<br>
>              *params = (GLfloat) obj->ImmutableLevels;<br>
>           else<br>
>              goto invalid_pname;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_MIN_LEVEL:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLfloat) obj->MinLevel;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_NUM_LEVELS:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLfloat) obj->NumLevels;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_MIN_LAYER:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLfloat) obj->MinLayer;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_NUM_LAYERS:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLfloat) obj->NumLayers;<br>
>           break;<br>
> @@ -2161,33 +2160,32 @@ get_tex_parameteriv(struct gl_context *ctx,<br>
>           break;<br>
><br>
>        case GL_TEXTURE_IMMUTABLE_LEVELS:<br>
> -         if (_mesa_is_gles3(ctx) ||<br>
> -             (_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_texture_<wbr>view))<br>
> +         if (_mesa_is_gles3(ctx) || _mesa_has_texture_view(ctx))<br>
>              *params = obj->ImmutableLevels;<br>
>           else<br>
>              goto invalid_pname;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_MIN_LEVEL:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLint) obj->MinLevel;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_NUM_LEVELS:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLint) obj->NumLevels;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_MIN_LAYER:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLint) obj->MinLayer;<br>
>           break;<br>
><br>
>        case GL_TEXTURE_VIEW_NUM_LAYERS:<br>
> -         if (!ctx->Extensions.ARB_texture_<wbr>view)<br>
> +         if (!_mesa_has_texture_view(ctx))<br>
>              goto invalid_pname;<br>
>           *params = (GLint) obj->NumLayers;<br>
>           break;<br>
> --<br>
> 1.7.9.5<br>
><br>
</div>> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div>