Reviewed-by: Edward O'Callaghan <funfunc...@folklore1984.net>

On 12/16/2016 12:56 PM, Randy Xu wrote:
> From: "Xu,Randy" <randy...@intel.com>
> 
> The ES specification says that TexImage3D should return GL_INVALID_OPERATION
> if the internal format is DEPTH_COMPONENT, DEPTH_-STENCIL or STENCIL_INDEX.
> The current code returns INVALID_ENUM as _mesa_error_check_format_and_type is
> used by glReadPixels also and the GL specification defines "INVALID_ENUM is
> generated if format is DEPTH_STENCIL and type is not UNSIGNED_INT_24_8 or
> FLOAT_32_UNSIGNED_INT_24_8_- REV".
> 
> This patch only impacts GLES, which can generate GL_INVALID_OPERATION because
> glReadPixels cannot be used to read depth or stencil buffer.
> Fixes dEQP-GLES3.functional.negative_api.texture.teximage3d.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99076
> 
> Signed-off-by: Xu,Randy <randy...@intel.com>
> ---
>  src/mesa/main/glformats.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index a95909c..eeee66b 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -2087,6 +2087,8 @@ _mesa_error_check_format_and_type(const struct 
> gl_context *ctx,
>           else if (ctx->Extensions.ARB_depth_buffer_float &&
>               type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV)
>              return GL_NO_ERROR;
> +         else if (!_mesa_is_desktop_gl(ctx))
> +            return GL_INVALID_OPERATION;
>           else
>              return GL_INVALID_ENUM;
>  
> 

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to