[Mesa-dev] [PATCH] st/mesa: fix trimming of GL_QUAD_STRIP

Brian Paul brianp at vmware.com
Tue Feb 19 11:31:25 PST 2013


We sometimes convert GL_QUAD_STRIP prims into GL_TRIANGLE_STRIP, but
that changes the results of the u_trim_pipe_prim() call.  We need to
pass the original primitive type to the trim function.

Note that OpenGL's GL_x prim type values match Gallium's PIPE_PRIM_x values.

Fixes a failure in the new piglit degenerate-prims test.

Note: This is a candidate for the stable branches.
---
 src/mesa/state_tracker/st_draw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index de62264..bff8d9b 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -283,7 +283,7 @@ st_draw_vbo(struct gl_context *ctx,
          /* don't trim, restarts might be inside index list */
          cso_draw_vbo(st->cso_context, &info);
       }
-      else if (u_trim_pipe_prim(info.mode, &info.count))
+      else if (u_trim_pipe_prim(prims[i].mode, &info.count))
          cso_draw_vbo(st->cso_context, &info);
    }
 
-- 
1.7.3.4



More information about the mesa-dev mailing list