diff options
author | Ian Romanick <[email protected]> | 2014-11-11 10:53:37 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-12-02 12:16:28 -0800 |
commit | b93dcb0e718a0a177370f2c7851223350d3b7bc7 (patch) | |
tree | 4f15e5b7161f46f3484a18b0a133c08ea76490ec /src/mesa/main/api_validate.c | |
parent | 4e6244e80f7dd6dad526ff04f5103ed24d61d38a (diff) |
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r-- | src/mesa/main/api_validate.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index bf4fa3ea868..006fca45e14 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: { |