mesa: move FLUSH_VERTICES() call to meta
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 30 Mar 2017 10:24:13 +0000 (21:24 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 31 Mar 2017 02:43:38 +0000 (13:43 +1100)
There is no need for this to be in the common code.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/drivers/common/meta.c
src/mesa/main/varray.c
src/mesa/main/varray.h

index d8deaaf3713be4c5b257fbf917e6b245026d2f90..efbc93402e16b403ab2fab8fd85077b40b9d5901 100644 (file)
@@ -321,13 +321,14 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
                         GL_DYNAMIC_DRAW, __func__);
 
       /* setup vertex arrays */
+      FLUSH_VERTICES(ctx, 0);
       if (use_generic_attributes) {
          assert(color_size == 0);
 
          _mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_GENERIC(0),
                                    vertex_size, GL_FLOAT, GL_RGBA, GL_FALSE,
                                    GL_FALSE, GL_FALSE,
-                                   offsetof(struct vertex, x), true);
+                                   offsetof(struct vertex, x));
          _mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_GENERIC(0),
                                   *buf_obj, 0, sizeof(struct vertex));
          _mesa_enable_vertex_array_attrib(ctx, array_obj,
@@ -336,7 +337,7 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
             _mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_GENERIC(1),
                                       texcoord_size, GL_FLOAT, GL_RGBA,
                                       GL_FALSE, GL_FALSE, GL_FALSE,
-                                      offsetof(struct vertex, tex), false);
+                                      offsetof(struct vertex, tex));
             _mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_GENERIC(1),
                                      *buf_obj, 0, sizeof(struct vertex));
             _mesa_enable_vertex_array_attrib(ctx, array_obj,
@@ -346,7 +347,7 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
          _mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_POS,
                                    vertex_size, GL_FLOAT, GL_RGBA, GL_FALSE,
                                    GL_FALSE, GL_FALSE,
-                                   offsetof(struct vertex, x), true);
+                                   offsetof(struct vertex, x));
          _mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_POS,
                                   *buf_obj, 0, sizeof(struct vertex));
          _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_POS);
@@ -355,7 +356,7 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
             _mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_TEX(0),
                                       vertex_size, GL_FLOAT, GL_RGBA, GL_FALSE,
                                       GL_FALSE, GL_FALSE,
-                                      offsetof(struct vertex, tex), false);
+                                      offsetof(struct vertex, tex));
             _mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_TEX(0),
                                      *buf_obj, 0, sizeof(struct vertex));
             _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_TEX(0));
@@ -365,7 +366,7 @@ _mesa_meta_setup_vertex_objects(struct gl_context *ctx,
             _mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_COLOR0,
                                       vertex_size, GL_FLOAT, GL_RGBA, GL_FALSE,
                                       GL_FALSE, GL_FALSE,
-                                      offsetof(struct vertex, r), false);
+                                      offsetof(struct vertex, r));
             _mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_COLOR0,
                                      *buf_obj, 0, sizeof(struct vertex));
             _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_COLOR0);
@@ -3319,20 +3320,22 @@ _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
                         GL_DYNAMIC_DRAW, __func__);
 
       /* setup vertex arrays */
+      FLUSH_VERTICES(ctx, 0);
       _mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_POS,
                                 3, GL_FLOAT, GL_RGBA, GL_FALSE,
                                 GL_FALSE, GL_FALSE,
-                                offsetof(struct vertex, x), true);
+                                offsetof(struct vertex, x));
       _mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_POS,
                                drawtex->buf_obj, 0, sizeof(struct vertex));
       _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_POS);
 
 
       for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+         FLUSH_VERTICES(ctx, 0);
          _mesa_update_array_format(ctx, array_obj, VERT_ATTRIB_TEX(i),
                                    2, GL_FLOAT, GL_RGBA, GL_FALSE,
                                    GL_FALSE, GL_FALSE,
-                                   offsetof(struct vertex, st[i]), true);
+                                   offsetof(struct vertex, st[i]));
          _mesa_bind_vertex_buffer(ctx, array_obj, VERT_ATTRIB_TEX(i),
                                   drawtex->buf_obj, 0, sizeof(struct vertex));
          _mesa_enable_vertex_array_attrib(ctx, array_obj, VERT_ATTRIB_TEX(i));
index 92e3f4d1f8a9d426f2a57d06cf8930bdbc7ed198..af5abc8e83ca0ff4783ca3b87b85c3c68ad9ad47 100644 (file)
@@ -280,17 +280,13 @@ _mesa_update_array_format(struct gl_context *ctx,
                           GLuint attrib, GLint size, GLenum type,
                           GLenum format, GLboolean normalized,
                           GLboolean integer, GLboolean doubles,
-                          GLuint relativeOffset, bool flush_vertices)
+                          GLuint relativeOffset)
 {
    struct gl_array_attributes *const array = &vao->VertexAttrib[attrib];
    GLint elementSize;
 
    assert(size <= 4);
 
-   if (flush_vertices) {
-      FLUSH_VERTICES(ctx, 0);
-   }
-
    elementSize = _mesa_bytes_per_vertex_attrib(size, type);
    assert(elementSize != -1);
 
@@ -439,8 +435,7 @@ update_array_format(struct gl_context *ctx,
    }
 
    _mesa_update_array_format(ctx, vao, attrib, size, type, format,
-                             normalized, integer, doubles, relativeOffset,
-                             false);
+                             normalized, integer, doubles, relativeOffset);
 
    return true;
 }
index 8c30d16ea3a5df9ffa0f3c8c9abbba1cd52093a7..92165710d8ee05e9b357c27d4091df7bb420947c 100644 (file)
@@ -94,7 +94,7 @@ _mesa_update_array_format(struct gl_context *ctx,
                           GLuint attrib, GLint size, GLenum type,
                           GLenum format, GLboolean normalized,
                           GLboolean integer, GLboolean doubles,
-                          GLuint relativeOffset, bool flush_vertices);
+                          GLuint relativeOffset);
 
 extern void
 _mesa_enable_vertex_array_attrib(struct gl_context *ctx,