X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgallium%2Fauxiliary%2Findices%2Fu_unfilled_indices.c;h=c353717d65644b7ff5f94b266cd32124e8b6e7d8;hb=70daad6a99c9815fd55ffa016d35684e4414f257;hp=26c5d4d4c72cad1fc664658973dab87a7f2a4563;hpb=f0c92d96568780d5a6c6b53845e9689893ce99e4;p=mesa.git diff --git a/src/gallium/auxiliary/indices/u_unfilled_indices.c b/src/gallium/auxiliary/indices/u_unfilled_indices.c index 26c5d4d4c72..c353717d656 100644 --- a/src/gallium/auxiliary/indices/u_unfilled_indices.c +++ b/src/gallium/auxiliary/indices/u_unfilled_indices.c @@ -71,6 +71,11 @@ static void generate_linear_uint( unsigned nr, } +/** + * Given a primitive type and number of vertices, return the number of vertices + * needed to draw the primitive with fill mode = PIPE_POLYGON_MODE_LINE using + * separate lines (PIPE_PRIM_LINES). + */ static unsigned nr_lines( unsigned prim, unsigned nr ) { @@ -86,7 +91,7 @@ static unsigned nr_lines( unsigned prim, case PIPE_PRIM_QUAD_STRIP: return (nr - 2) / 2 * 8; case PIPE_PRIM_POLYGON: - return (nr - 2) * 6; + return 2 * nr; /* a line (two verts) for each polygon edge */ default: assert(0); return 0;