aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-08-17 17:12:12 -0700
committerIan Romanick <[email protected]>2012-08-29 15:09:37 -0700
commit792214e8d45675b756e02a5e39bfe2ab32f7383d (patch)
tree100bb2cf291ceb3b4bdfa100c3f0101cf74f1876 /src/mesa/main
parent29512df6355706cc678d3994185c20c4d66b57c4 (diff)
mesa: Disallow VertexAttribPointer without a VAO in a core context
Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/varray.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 8a123337154..bb185aee9b9 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -133,6 +133,23 @@ update_array(struct gl_context *ctx,
GLsizei elementSize;
GLenum format = GL_RGBA;
+ /* Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says:
+ *
+ * "Client vertex arrays - all vertex array attribute pointers must
+ * refer to buffer objects (section 2.9.2). The default vertex array
+ * object (the name zero) is also deprecated. Calling
+ * VertexAttribPointer when no buffer object or no vertex array object
+ * is bound will generate an INVALID_OPERATION error..."
+ *
+ * The check for VBOs is handled below.
+ */
+ if (ctx->API == API_OPENGL_CORE
+ && (ctx->Array.ArrayObj == ctx->Array.DefaultArrayObj)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "%s(no array object bound)",
+ func);
+ return;
+ }
+
if (_mesa_is_gles(ctx)) {
/* Once Mesa gets support for GL_OES_vertex_half_float this mask will
* change. Adding support for this extension isn't quite as trivial as