draw: Allocate the output buffer for output primitives
authorZack Rusin <zackr@vmware.com>
Tue, 26 Mar 2013 19:32:30 +0000 (12:32 -0700)
committerZack Rusin <zackr@vmware.com>
Wed, 27 Mar 2013 10:53:02 +0000 (03:53 -0700)
We were allocating the output buffer but using the input
primitives. We need to allocate that buffer using the
maximum number of output, not input, primitives.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_gs.c

index c8ed95ae7d39b2eb1fd6f00f26948253c1c54eed..0115d4716a1c7d87b77f3d5bdf6889f66ceb955c 100644 (file)
@@ -506,10 +506,9 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader,
    output_verts->stride = output_verts->vertex_size;
    output_verts->verts =
       (struct vertex_header *)MALLOC(output_verts->vertex_size *
-                                     num_in_primitives *
+                                     max_out_prims *
                                      shader->max_output_vertices);
 
-
 #if 0
    debug_printf("%s count = %d (in prims # = %d)\n",
                 __FUNCTION__, num_input_verts, num_in_primitives);