Mesa (staging/21.0): vbo: Only mark merged line strips as lines when actually converting them

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 20 19:19:49 UTC 2021


Module: Mesa
Branch: staging/21.0
Commit: e8c31e03677f121dfca7c31ce0237be23a530434
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e8c31e03677f121dfca7c31ce0237be23a530434

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Thu Jan 14 17:29:14 2021 -0800

vbo: Only mark merged line strips as lines when actually converting them

We only convert line strips to lines in certain cases, but were flagging
node->merged.prim as GL_LINES even if we simply copied a GL_LINE_STRIP
prim[0] over without modifying it.

Fixes Piglit's lineloop test (which triggers loop -> strip conversion
earlier in this path, then was incorrectly triggering strip -> list
mode modification with no changes to the underlying data).

Fixes: 310991415ee ("vbo/dlist: implement primitive merging")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8522>
(cherry picked from commit 14ae5069da896cc93953e935051a76884800cac9)

---

 .pick_status.json           | 2 +-
 src/mesa/vbo/vbo_save_api.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index ecf35651fc4..878c46c14a0 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -274,7 +274,7 @@
         "description": "vbo: Only mark merged line strips as lines when actually converting them",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "310991415ee1f5bcdd91460f00205190e8e0c2d9"
     },
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index b258e6ac117..b5d7d670f91 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -688,7 +688,7 @@ compile_vertex_list(struct gl_context *ctx)
             continue;
          }
 
-         /* Line strips get converted to lines */
+         /* Line strips may get converted to lines */
          if (mode == GL_LINE_STRIP)
             mode = GL_LINES;
 
@@ -739,6 +739,9 @@ compile_vertex_list(struct gl_context *ctx)
                }
             }
          } else {
+            /* We didn't convert to LINES, so restore the original mode */
+            mode = original_prims[i].mode;
+
             for (unsigned j = 0; j < vertex_count; j++) {
                indices[idx++] = original_prims[i].start + j;
             }



More information about the mesa-commit mailing list