mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
gallium/util: Support POLYGON in u_stream_outputs_for_vertices
u_decomposed_prims_for_vertices cannot support POLYGON, but POLYGON is trivial to support as a special case directly (since we have the number of vertices directly). Fixes aborts in Panfrost in apps using GL_POLYGON. Fixes:e881aa8c12("gallium/util: Add u_stream_outputs_for_vertices helper") Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Revewied-by: Eric Anholt <eric@anholt.net> (cherry picked from commita37822f5f7)
This commit is contained in:
parent
af0d38bfde
commit
47c8b41f8f
1 changed files with 8 additions and 1 deletions
|
|
@ -338,7 +338,14 @@ u_stream_outputs_for_vertices(enum pipe_prim_type primitive, unsigned nr)
|
||||||
/* Extraneous vertices don't contribute to stream outputs */
|
/* Extraneous vertices don't contribute to stream outputs */
|
||||||
u_trim_pipe_prim(primitive, &nr);
|
u_trim_pipe_prim(primitive, &nr);
|
||||||
|
|
||||||
/* Consider how many primitives are actually generated */
|
/* Polygons are special, since they are a single primitive with many
|
||||||
|
* vertices. In this case, we just have an output for each vertex (after
|
||||||
|
* trimming) */
|
||||||
|
|
||||||
|
if (primitive == PIPE_PRIM_POLYGON)
|
||||||
|
return nr;
|
||||||
|
|
||||||
|
/* Normally, consider how many primitives are actually generated */
|
||||||
unsigned prims = u_decomposed_prims_for_vertices(primitive, nr);
|
unsigned prims = u_decomposed_prims_for_vertices(primitive, nr);
|
||||||
|
|
||||||
/* One output per vertex after decomposition */
|
/* One output per vertex after decomposition */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue