summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_prim_assembler.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-12-01 23:40:31 +0100
committerRoland Scheidegger <sroland@vmware.com>2014-12-06 18:03:05 +0100
commitfe86415beb8edfe3a6a4300ca537fae1bbad64a7 (patch)
tree0bd4e19efb3c6e9293e43bc29b4bce3740bab5a3 /src/gallium/auxiliary/draw/draw_prim_assembler.c
parent3fdbad1142224f4cae9f97b75b94afba353ab392 (diff)
downloadexternal_mesa3d-fe86415beb8edfe3a6a4300ca537fae1bbad64a7.zip
external_mesa3d-fe86415beb8edfe3a6a4300ca537fae1bbad64a7.tar.gz
external_mesa3d-fe86415beb8edfe3a6a4300ca537fae1bbad64a7.tar.bz2
draw: use correct output prim for non-adjacent topologies in prim assembler.
The decomposition done in the prim assembler will turn tri fans into tris, but this wasn't reflected in the output prim type. Meaning with a tri fan with 6 verts input, the output was a tri fan with 12 vertices instead of a tri list with 12 vertices (not as bad as it sounds, since the additional tris created would all be degenerate since they'd all have two times vertex zero but still bogus). This is because the prim assembler is used if either the input topology is something with adjacency, or if prim id needs to be injected, and for the latter case topologies without adjacency can be converted to basic ones. Unfortunately decomposition here for inserting prim ids is necessary, at least for the indexed case where we can't just insert the prim id at the right place depending on provoking vertex. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_prim_assembler.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_prim_assembler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/draw/draw_prim_assembler.c b/src/gallium/auxiliary/draw/draw_prim_assembler.c
index c609a77..5cb19f5 100644
--- a/src/gallium/auxiliary/draw/draw_prim_assembler.c
+++ b/src/gallium/auxiliary/draw/draw_prim_assembler.c
@@ -113,8 +113,8 @@ copy_verts(struct draw_assembler *asmblr,
static void
inject_primid(struct draw_assembler *asmblr,
- unsigned idx,
- unsigned primid)
+ unsigned idx,
+ unsigned primid)
{
int slot = asmblr->primid_slot;
char *input = (char*)asmblr->input_verts->verts;
@@ -246,7 +246,7 @@ draw_prim_assembler_run(struct draw_context *draw,
{
struct draw_assembler *asmblr = draw->ia;
unsigned start, i;
- unsigned assembled_prim = u_assembled_prim(input_prims->prim);
+ unsigned assembled_prim = u_reduced_prim(input_prims->prim);
unsigned max_primitives = u_decomposed_prims_for_vertices(
input_prims->prim, input_prims->count);
unsigned max_verts = u_vertices_per_prim(assembled_prim) * max_primitives;
@@ -268,7 +268,7 @@ draw_prim_assembler_run(struct draw_context *draw,
output_prims->linear = TRUE;
output_prims->elts = NULL;
output_prims->start = 0;
- output_prims->prim = u_assembled_prim(input_prims->prim);
+ output_prims->prim = assembled_prim;
output_prims->flags = 0x0;
output_prims->primitive_lengths = MALLOC(sizeof(unsigned));
output_prims->primitive_lengths[0] = 0;