[Mesa-dev] [PATCH 3/4] mesa: set correct error for non-renderable multisample textures

Anuj Phogat anuj.phogat at gmail.com
Fri Aug 14 10:34:13 PDT 2015


On Mon, Aug 10, 2015 at 1:06 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/mesa/main/teximage.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 3ea7b2a..c6fd0be 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -5639,9 +5639,18 @@ _mesa_texture_image_multisample(struct gl_context *ctx, GLuint dims,
>     }
>
>     if (!is_renderable_texture_format(ctx, internalformat)) {
> -      _mesa_error(ctx, GL_INVALID_OPERATION,
> -            "%s(internalformat=%s)",
> -            func, _mesa_enum_to_string(internalformat));
> +      /* Page 172 of OpenGL ES 3.1 spec says:
> +       *   "An INVALID_ENUM error is generated if sizedinternalformat is not
> +       *   color-renderable, depth-renderable, or stencil-renderable (as
> +       *   defined in section 9.4).
> +       */
> +      if (_mesa_is_gles31(ctx)) {
> +         _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalformat=%s)", func,
> +                     _mesa_enum_to_string(internalformat));
> +      } else {
> +         _mesa_error(ctx, GL_INVALID_OPERATION, "%s(internalformat=%s)", func,
> +                     _mesa_enum_to_string(internalformat));
> +      }
>        return;
>     }
>
> --
> 2.1.0
>

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the mesa-dev mailing list