[Mesa-dev] [PATCH] Mesa: Fix error code for glTexImage3D in GLES
Xu, Randy
randy.xu at intel.com
Wed Dec 21 02:38:55 UTC 2016
Hi, Kenneth
The patch https://android-review.googlesource.com/#/c/291429/ for GLES3.1 has been merged to dEQP master branch, so expect the GLES3 change should be merged also.
In this case, we don't need this change in Mesa.
Thanks,
Randy
-----Original Message-----
From: Kenneth Graunke [mailto:kenneth at whitecape.org]
Sent: Wednesday, December 21, 2016 10:00 AM
To: mesa-dev at lists.freedesktop.org
Cc: Xu, Randy <randy.xu at intel.com>; mesa-stable at lists.freedesktop.org
Subject: Re: [Mesa-dev] [PATCH] Mesa: Fix error code for glTexImage3D in GLES
On Wednesday, December 21, 2016 9:05:27 AM PST Randy Xu wrote:
> From the OGLES 3.2 spec, Section 8.5 Texture Image Specification, page 158:
> "An INVALID_OPERATION error is generated if a combination of
> values for format, type, and internalformat is specified that is
> not listed as a valid combination in tables 8.2 or 8.3."
> It means 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 also used by glReadPixels 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: Randy Xu <randy.xu at intel.com>
> ---
> src/mesa/main/glformats.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index a95909c..3070db9 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -2087,6 +2087,13 @@ _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;
> + //From the OpenGL ES 3.2 spec, Section 8.5 Texture Image
> + // Specification, page 158:
> + // An INVALID_OPERATION error is generated if a combination of
> + // values for format, type, and internalformat is specified that
> + // is not listed as a valid combination in tables 8.2 or 8.3.
> + else if (!_mesa_is_desktop_gl(ctx))
> + return GL_INVALID_OPERATION;
> else
> return GL_INVALID_ENUM;
>
>
There is a bug in dEQP related to this test:
https://android-review.googlesource.com/#/c/316475/
We already landed the equivalent fix for dEQP-GLES31 version, but apparently the test exists in dEQP-GLES3 as well.
After applying that patch, the test passes, with no change to Mesa.
--Ken
More information about the mesa-dev
mailing list