[Mesa-dev] [PATCH] Mesa: Return GL error INVALID_OPERATION in case invalid format/type
Randy Xu
randy.xu at intel.com
Thu Dec 15 01:10:31 UTC 2016
From: "Xu,Randy" <randy.xu at intel.com>
Refer to GLES3.2 spec in 8.5
Textures with a base internal format of DEPTH_COMPONENT, DEPTH_-
STENCIL or STENCIL_INDEX are supported by texture image specification
commands only if target is TEXTURE_2D, TEXTURE_2D_MULTISAMPLE,
TEXTURE_2D_ARRAY, TEXTURE_2D_MULTISAMPLE_ARRAY, TEXTURE_CUBE_-
MAP or TEXTURE_CUBE_MAP_ARRAY. Using these formats in conjunction with
any other target will result in an INVALID_OPERATION error.
This patch can fix dEQP-GLES3.functional.negative_api.texture.teximage3d
failure.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99076
Signed-off-by: Xu,Randy <randy.xu at 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;
--
2.7.4
More information about the mesa-dev
mailing list