From 14ae5069da896cc93953e935051a76884800cac9 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 14 Jan 2021 17:29:14 -0800 Subject: [PATCH] vbo: Only mark merged line strips as lines when actually converting them MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Part-of: --- src/mesa/vbo/vbo_save_api.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index b258e6a..b5d7d67 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; } -- 2.7.4