Mesa (master): vbo: Walk the VAO to see if all varyings are in vbos.

Mathias Fröhlich frohlich at kemper.freedesktop.org
Sun Jul 31 19:54:46 UTC 2016


Module: Mesa
Branch: master
Commit: 3f5e5696feb10ec9c779c30a84ce9b367db081fd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f5e5696feb10ec9c779c30a84ce9b367db081fd

Author: Mathias Fröhlich <mathias.froehlich at web.de>
Date:   Fri Jun 17 08:09:05 2016 +0200

vbo: Walk the VAO to see if all varyings are in vbos.

In vbo_draw_transform_feedback we currently look at
exec->array.inputs to determine if all varying
vertex attributes reside in vbos. But the vbo_bind_arrays
call only happens past the vbo_all_varyings_in_vbos
query. Thus we may work on a stale set of client arrays.
Using the current VAOs content for this query feels much
more logical to me.
Additionally with this change mesa makes more use of the
information already tracked in the VAO instead of looping
across VERT_ATTRIB_MAX vertex arrays.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/vbo/vbo_exec_array.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index 87ed7f7..b75c772 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -27,6 +27,7 @@
  **************************************************************************/
 
 #include <stdio.h>
+#include "main/arrayobj.h"
 #include "main/glheader.h"
 #include "main/context.h"
 #include "main/state.h"
@@ -1290,7 +1291,6 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
                             GLuint stream, GLuint numInstances)
 {
    struct vbo_context *vbo = vbo_context(ctx);
-   struct vbo_exec_context *exec = &vbo->exec;
    struct _mesa_prim prim[2];
 
    if (!_mesa_validate_DrawTransformFeedback(ctx, mode, obj, stream,
@@ -1300,7 +1300,7 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
 
    if (ctx->Driver.GetTransformFeedbackVertexCount &&
        (ctx->Const.AlwaysUseGetTransformFeedbackVertexCount ||
-        !vbo_all_varyings_in_vbos(exec->array.inputs))) {
+        !_mesa_all_varyings_in_vbos(ctx->Array.VAO))) {
       GLsizei n = ctx->Driver.GetTransformFeedbackVertexCount(ctx, obj, stream);
       vbo_draw_arrays(ctx, mode, 0, n, numInstances, 0);
       return;




More information about the mesa-commit mailing list