mesa: fix GL_INVALID_OPERATION in glEGLImageTargetTexStorageEXT

Using EGLImages from DMA-BUF as target storage should return
GL_INVALID_OPERATION if the target is not GL_TEXTURE_2D or
GL_TEXTURE_EXTERNAL_OES.

Fixes: 6a3f5c65 ("mesa: simplify st_egl_image binding process for texture storage")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18939

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18939>
This commit is contained in:
Simon Zeni
2022-10-03 14:25:22 -04:00
committed by Marge Bot
parent 66b9c05bb9
commit 998122d9c2

View File

@@ -3557,7 +3557,7 @@ egl_image_target_texture(struct gl_context *ctx,
* Otherwise, the error INVALID_OPERATION is generated.
*/
if (stimg.imported_dmabuf &&
(target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES)) {
!(target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(texture is imported from dmabuf)", caller);
return;