Mesa (master): mesa: remove/replace FLUSH_VERTICES when it doesn't do anything

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 30 21:52:58 UTC 2021


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Dec 19 01:41:04 2020 -0500

mesa: remove/replace FLUSH_VERTICES when it doesn't do anything

In _mesa_PopAttrib, we call FLUSH_VERTICES at the beginning, so we don't
need to do it again.

In the MultiMode functions, we call standard Draw functions
using the dispatch, which do the flushing by themselves.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

---

 src/mesa/main/attrib.c | 2 +-
 src/mesa/main/draw.c   | 6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index b1180ac6741..0002be808f6 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -924,7 +924,7 @@ _mesa_PopAttrib(void)
                            (GLfloat) attr->Light.Model.ColorControl);
       } else {
          /* Fast path for other drivers. */
-         FLUSH_VERTICES(ctx, _NEW_LIGHT);
+         ctx->NewState |= _NEW_LIGHT;
 
          memcpy(ctx->Light.LightSource, attr->Light.LightSource,
                 sizeof(attr->Light.LightSource));
diff --git a/src/mesa/main/draw.c b/src/mesa/main/draw.c
index 343b8439dc7..7a0cec6307e 100644
--- a/src/mesa/main/draw.c
+++ b/src/mesa/main/draw.c
@@ -2184,8 +2184,6 @@ _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
    GET_CURRENT_CONTEXT(ctx);
    GLint i;
 
-   FLUSH_VERTICES(ctx, 0);
-
    for ( i = 0 ; i < primcount ; i++ ) {
       if ( count[i] > 0 ) {
          GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));
@@ -2204,10 +2202,6 @@ _mesa_MultiModeDrawElementsIBM( const GLenum * mode, const GLsizei * count,
    GET_CURRENT_CONTEXT(ctx);
    GLint i;
 
-   FLUSH_VERTICES(ctx, 0);
-
-   /* XXX not sure about ARB_vertex_buffer_object handling here */
-
    for ( i = 0 ; i < primcount ; i++ ) {
       if ( count[i] > 0 ) {
          GLenum m = *((GLenum *) ((GLubyte *) mode + i * modestride));



More information about the mesa-commit mailing list