[Mesa-dev] [PATCH 5/6] mesa: enable enums for OES_texture_storage_multisample_2d_array

Lofstedt, Marta marta.lofstedt at intel.com
Sun Aug 23 23:46:46 PDT 2015


Reviewed-by: Marta Lofstedt <marta.lofstedt at intel.com>


> -----Original Message-----
> From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On
> Behalf Of Tapani Pälli
> Sent: Friday, August 21, 2015 9:22 AM
> To: mesa-dev at lists.freedesktop.org
> Subject: [Mesa-dev] [PATCH 5/6] mesa: enable enums for
> OES_texture_storage_multisample_2d_array
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/mesa/main/get_hash_params.py | 6 +++---
>  src/mesa/main/texobj.c           | 6 ++++--
>  src/mesa/main/texparam.c         | 2 +-
>  3 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mesa/main/get_hash_params.py
> b/src/mesa/main/get_hash_params.py
> index 517c391..c06e9b1 100644
> --- a/src/mesa/main/get_hash_params.py
> +++ b/src/mesa/main/get_hash_params.py
> @@ -434,6 +434,9 @@ descriptor=[
>    [ "SAMPLE_MASK", "CONTEXT_BOOL(Multisample.SampleMask),
> extra_ARB_texture_multisample_es31" ],
>    [ "MAX_SAMPLE_MASK_WORDS", "CONST(1),
> extra_ARB_texture_multisample_es31" ],
> 
> +# GL_ARB_texture_multisample / ES 3.1 with
> +GL_OES_texture_storage_multisample_2d_array
> +  [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM,
> TYPE_INT,
> +TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX,
> extra_ARB_texture_multisample_es31"
> +],
> +
>  # GL_ARB_texture_gather / GLES 3.1
>    [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET",
> "CONTEXT_INT(Const.MinProgramTextureGatherOffset),
> extra_ARB_texture_gather_es31"],
>    [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET",
> "CONTEXT_INT(Const.MaxProgramTextureGatherOffset),
> extra_ARB_texture_gather_es31"], @@ -740,9 +743,6 @@ descriptor=[
>    [ "TEXTURE_BUFFER_FORMAT_ARB", "LOC_CUSTOM, TYPE_INT, 0,
> extra_texture_buffer_object" ],
>    [ "TEXTURE_BUFFER_ARB", "LOC_CUSTOM, TYPE_INT, 0,
> extra_texture_buffer_object" ],
> 
> -# GL_ARB_texture_multisample / GL 3.2
> -  [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM,
> TYPE_INT, TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX,
> extra_ARB_texture_multisample" ],
> -
>  # GL 3.0
>    [ "CONTEXT_FLAGS", "CONTEXT_INT(Const.ContextFlags),
> extra_version_30" ],
> 
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index
> 395e4d3..a3f44c9 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -217,7 +217,8 @@ _mesa_get_current_tex_object(struct gl_context
> *ctx, GLenum target)
>           return ctx->Extensions.ARB_texture_multisample
>              ? ctx->Texture.ProxyTex[TEXTURE_2D_MULTISAMPLE_INDEX] : NULL;
>        case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
> -         return ctx->Extensions.ARB_texture_multisample
> +         return (ctx->Extensions.ARB_texture_multisample ||
> +
> + ctx->Extensions.OES_texture_storage_multisample_2d_array)
>              ? texUnit->CurrentTex[TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX] :
> NULL;
>        case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
>           return ctx->Extensions.ARB_texture_multisample
> @@ -1612,7 +1613,8 @@ _mesa_tex_target_to_index(const struct
> gl_context *ctx, GLenum target)
>        return ((_mesa_is_desktop_gl(ctx) && ctx-
> >Extensions.ARB_texture_multisample) ||
>                _mesa_is_gles31(ctx)) ? TEXTURE_2D_MULTISAMPLE_INDEX: -1;
>     case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
> -      return _mesa_is_desktop_gl(ctx) && ctx-
> >Extensions.ARB_texture_multisample
> +      return ((_mesa_is_desktop_gl(ctx) && ctx-
> >Extensions.ARB_texture_multisample) ||
> +              ctx->Extensions.OES_texture_storage_multisample_2d_array)
>           ? TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX: -1;
>     default:
>        return -1;
> diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index
> 947a2a1..3b72417 100644
> --- a/src/mesa/main/texparam.c
> +++ b/src/mesa/main/texparam.c
> @@ -1223,6 +1223,7 @@ legal_get_tex_level_parameter_target(struct
> gl_context *ctx, GLenum target,
>     case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
>        return (_mesa_is_gles31(ctx) || ctx-
> >Extensions.ARB_texture_cube_map);
>     case GL_TEXTURE_2D_MULTISAMPLE:
> +   case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
>        return (_mesa_is_gles31(ctx) || ctx-
> >Extensions.ARB_texture_multisample);
>     }
> 
> @@ -1267,7 +1268,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_ARRAY:
>     case GL_PROXY_TEXTURE_2D_MULTISAMPLE:
>     case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:
>        return ctx->Extensions.ARB_texture_multisample;
> --
> 2.4.3
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list