Mesa (staging/22.0): mesa: add missing error-path

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 2 17:43:45 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 18a17d7b8737bc5a034510985ddb0b2d954acfbe
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18a17d7b8737bc5a034510985ddb0b2d954acfbe

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Apr 28 11:47:37 2022 +0200

mesa: add missing error-path

The ARB_shader_objects spec says the following:

> The error INVALID_VALUE is generated by any command that takes one or
> more handles as input, and one or more of these handles are not an
> object handle generated by OpenGL.

And a long, long time ago, we used do to just that for
glDeleteObjectARB... Until 9ac9605de15, all the way back in February 2006,
where the error condition was removed without explanation.

Let's restore it, because it should really be there.

This was noticed by running the tests that are in the mesa-demos
repository, that actually tested this condition.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16211>
(cherry picked from commit ba9c917149e883b3e2b117de41e5a54dd6f9d0cc)

---

 .pick_status.json         | 2 +-
 src/mesa/main/shaderapi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index e635d5d49a9..41c8c4ed210 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -780,7 +780,7 @@
         "description": "mesa: add missing error-path",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": null
     },
     {
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index a3af026481e..b2d56494a91 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1688,7 +1688,7 @@ _mesa_DeleteObjectARB(GLhandleARB obj)
          delete_shader(ctx, obj);
       }
       else {
-         /* error? */
+         _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteObjectARB");
       }
    }
 }



More information about the mesa-commit mailing list