[Mesa-dev] [PATCH 3/5] mesa: Move check for vbo mapping into api_validate.c.

Mathias.Froehlich at gmx.net Mathias.Froehlich at gmx.net
Sun Aug 14 18:12:38 UTC 2016


From: Mathias Fröhlich <mathias.froehlich at web.de>

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 <Mathias.Froehlich at web.de>
---
 src/mesa/main/api_validate.c  | 7 +++++++
 src/mesa/vbo/vbo_exec_array.c | 8 +-------
 2 files changed, 8 insertions(+), 7 deletions(-)

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 <stdbool.h>
 #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;
 }
 
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index e1aa3ac..bfa9cd6 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -396,13 +396,7 @@ vbo_bind_arrays(struct gl_context *ctx)
       }
    }
 
-   if (!_mesa_all_buffers_are_unmapped(ctx->Array.VAO)) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "draw call (vertex buffers are mapped)");
-      return false;
-   } else {
-      return true;
-   }
+   return true;
 }
 
 /**
-- 
2.7.4



More information about the mesa-dev mailing list