From 72f1566f90c434c7752d8405193eec68d6743246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Fr=C3=B6hlich?= Date: Sun, 14 Aug 2016 14:03:58 +0200 Subject: mesa: Move check for vbo mapping into api_validate.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of checking for mapped buffers in vbo_bind_arrays do this check in api_validate.c. This additionally enables printing the draw calls name into the error string. Signed-off-by: Mathias Fröhlich Reviewed-by: Brian Paul Reviewed-by: Eric Anholt --- src/mesa/main/api_validate.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa/main/api_validate.c') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index ec3cc1b..ae3e118 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -25,6 +25,7 @@ #include #include "glheader.h" #include "api_validate.h" +#include "arrayobj.h" #include "bufferobj.h" #include "context.h" #include "imports.h" @@ -119,6 +120,12 @@ check_valid_to_render(struct gl_context *ctx, const char *function) unreachable("Invalid API value in check_valid_to_render()"); } + if (!_mesa_all_buffers_are_unmapped(ctx->Array.VAO)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(vertex buffers are mapped)", function); + return false; + } + return true; } -- cgit v1.1