Mesa (master): mesa: Generate GL_INVALID_OPERATION when drawing w/ o a VAO in core profile

Ian Romanick idr at kemper.freedesktop.org
Tue Dec 2 22:56:44 UTC 2014


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Nov 11 10:53:37 2014 +0000

mesa: Generate GL_INVALID_OPERATION when drawing w/o a VAO in core profile

GL 3-ish versions of the spec are less clear that an error should be
generated here, so Ken (and I during review) just missed it in 1afe335.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/api_validate.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index bf4fa3e..006fca4 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -79,8 +79,16 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
       break;
 
    case API_OPENGL_CORE:
-      if (ctx->Array.VAO == ctx->Array.DefaultVAO)
+      /* Section 10.4 (Drawing Commands Using Vertex Arrays) of the OpenGL 4.5
+       * Core Profile spec says:
+       *
+       *     "An INVALID_OPERATION error is generated if no vertex array
+       *     object is bound (see section 10.3.1)."
+       */
+      if (ctx->Array.VAO == ctx->Array.DefaultVAO) {
+         _mesa_error(ctx, GL_INVALID_OPERATION, "%s(no VAO bound)", function);
          return GL_FALSE;
+      }
       /* fallthrough */
    case API_OPENGL_COMPAT:
       {




More information about the mesa-commit mailing list