[Mesa-dev] [PATCH 06/34] draw/gs: fix allocation of buffer for GS output vertices

Paul Berry stereotype441 at gmail.com
Tue Jul 30 19:46:48 PDT 2013


On 29 July 2013 11:09, Zack Rusin <zackr at vmware.com> wrote:

> That looks wrong to me. We already account for the "other fields" in the
> vertex_size.
>

This patch came from Bryan Cain's original geometry shader patch series--I
admit I'm not familiar enough with Gallium code to know how to fix it.
Anyone want to step in and address Zack's comment?  Or the Gallium-related
comments on patches 08 and 24?

If no one has time to work on Gallium geometry shaders right now, that's
ok.  I can pull the Gallium stuff out of this series and archive it in a
branch until someone has time to pick it up.


>
> ----- Original Message -----
> > From: Bryan Cain <bryancain3 at gmail.com>
> >
> > Before, it accounted for the size of the vertices but not the other
> fields
> > in the vertex_header struct, which caused memory corruption.
> > ---
> >  src/gallium/auxiliary/draw/draw_gs.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/gallium/auxiliary/draw/draw_gs.c
> > b/src/gallium/auxiliary/draw/draw_gs.c
> > index cd63e2b..78727c6 100644
> > --- a/src/gallium/auxiliary/draw/draw_gs.c
> > +++ b/src/gallium/auxiliary/draw/draw_gs.c
> > @@ -560,7 +560,8 @@ int draw_geometry_shader_run(struct
> draw_geometry_shader
> > *shader,
> >     /* we allocate exactly one extra vertex per primitive to allow the
> GS to
> >     emit
> >      * overflown vertices into some area where they won't harm anyone */
> >     output_verts->verts =
> > -      (struct vertex_header *)MALLOC(output_verts->vertex_size *
> > +      (struct vertex_header *)MALLOC(sizeof(struct vertex_header) +
> > +                                     output_verts->vertex_size *
> >                                       max_out_prims *
> >                                       shader->primitive_boundary);
> >
> > --
> > 1.8.3.4
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130730/eaf09aa7/attachment.html>


More information about the mesa-dev mailing list