[Mesa-dev] [PATCH v2] mesa: GetTexLevelParameter{if}v changes for OpenGL ES 3.1

Ilia Mirkin imirkin at alum.mit.edu
Mon Aug 24 06:12:04 PDT 2015


Presumably something external will (continue to) prevent this from
getting called for ES < 3.1 right? Also, doesn't ES3.1 have texture
buffers? Perhaps they can't be used here though. Please double-check.
With all that verified, this patch is

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Mon, Aug 24, 2015 at 4:32 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> Patch refactors existing parameters check to first check common enums
> between desktop GL and GLES 3.1 and modifies get_tex_level_parameter_image
> to be compatible with enums specified in 3.1.
>
> v2: remove extra is_gles31() checks (suggested by Ilia)
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com> (v1)
> Reviewed-by: Marta Lofstedt <marta.lofstedt at intel.com> (v1)
> ---
>  src/mesa/main/texparam.c | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
> index 16739f1..72d3611 100644
> --- a/src/mesa/main/texparam.c
> +++ b/src/mesa/main/texparam.c
> @@ -1208,20 +1208,34 @@ static GLboolean
>  legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target,
>                                       bool dsa)
>  {
> +   /* Common targets for desktop GL and GLES 3.1. */
>     switch (target) {
> -   case GL_TEXTURE_1D:
> -   case GL_PROXY_TEXTURE_1D:
>     case GL_TEXTURE_2D:
> -   case GL_PROXY_TEXTURE_2D:
>     case GL_TEXTURE_3D:
> -   case GL_PROXY_TEXTURE_3D:
>        return GL_TRUE;
> +   case GL_TEXTURE_2D_ARRAY_EXT:
> +      return ctx->Extensions.EXT_texture_array;
>     case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
>     case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
>     case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
>     case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
>     case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
>     case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
> +      return ctx->Extensions.ARB_texture_cube_map;
> +   case GL_TEXTURE_2D_MULTISAMPLE:
> +      return ctx->Extensions.ARB_texture_multisample;
> +   }
> +
> +   if (!_mesa_is_desktop_gl(ctx))
> +      return GL_FALSE;
> +
> +   /* Rest of the desktop GL targets. */
> +   switch (target) {
> +   case GL_TEXTURE_1D:
> +   case GL_PROXY_TEXTURE_1D:
> +   case GL_PROXY_TEXTURE_2D:
> +   case GL_PROXY_TEXTURE_3D:
> +      return GL_TRUE;
>     case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
>        return ctx->Extensions.ARB_texture_cube_map;
>     case GL_TEXTURE_CUBE_MAP_ARRAY_ARB:
> @@ -1232,7 +1246,6 @@ legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target,
>        return ctx->Extensions.NV_texture_rectangle;
>     case GL_TEXTURE_1D_ARRAY_EXT:
>     case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
> -   case GL_TEXTURE_2D_ARRAY_EXT:
>     case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
>        return ctx->Extensions.EXT_texture_array;
>     case GL_TEXTURE_BUFFER:
> @@ -1254,7 +1267,6 @@ legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target,
>         * "target may also be TEXTURE_BUFFER, indicating the texture buffer."
>         */
>        return ctx->API == API_OPENGL_CORE && ctx->Version >= 31;
> -   case GL_TEXTURE_2D_MULTISAMPLE:
>     case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
>     case GL_PROXY_TEXTURE_2D_MULTISAMPLE:
>     case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
> --
> 2.4.3
>


More information about the mesa-dev mailing list