Module: Mesa
Branch: main
Commit: ba9c917149e883b3e2b117de41e5a54dd6f9d0cc
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba9c917149e883b3e2b117de41e5a54dd6f9d0cc

Author: Erik Faye-Lund <[email protected]>
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 <[email protected]>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16211>

---

 src/mesa/main/shaderapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index abf2c458887..7172e41ab75 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -1705,7 +1705,7 @@ _mesa_DeleteObjectARB(GLhandleARB obj)
          delete_shader(ctx, obj);
       }
       else {
-         /* error? */
+         _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteObjectARB");
       }
    }
 }

Reply via email to