Mesa (master): mesa: In core profile, refuse to draw unless a VAO is bound.
Kenneth Graunke
kwg at kemper.freedesktop.org
Tue Mar 25 22:16:09 UTC 2014
Module: Mesa
Branch: master
Commit: 1afe3359258a9e89b62c8638761f52d78f6d1cbc
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1afe3359258a9e89b62c8638761f52d78f6d1cbc
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Thu Mar 20 11:53:16 2014 -0700
mesa: In core profile, refuse to draw unless a VAO is bound.
Core profile requires a non-default VAO to be bound. Currently, calls
to glVertexAttribPointer raise INVALID_OPERATION unless a VAO is bound,
and we never actually get any vertex data set. Trying to draw without
any vertex data can only cause problems. In i965, it causes a crash.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76400
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: mesa-stable at lists.freedesktop.org
---
src/mesa/main/api_validate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index efc3a2b..8f0b199 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -125,8 +125,11 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
return GL_FALSE;
break;
- case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
+ if (ctx->Array.VAO == ctx->Array.DefaultVAO)
+ return GL_FALSE;
+ /* fallthrough */
+ case API_OPENGL_COMPAT:
{
const struct gl_shader_program *vsProg =
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
More information about the mesa-commit
mailing list