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

Bryan Cain bryancain3 at gmail.com
Tue Jul 30 20:06:30 PDT 2013


On Tue, Jul 30, 2013 at 8:46 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> 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.

This patch is a year old, and I don't remember what it was supposed to
fix.  The Gallium geometry shader code has changed significantly in
the last year, and it should be safe to leave this patch unmerged.  If
any problems come up as a result, they can be addressed then.

>
>>
>>
>> ----- 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
>> >
>
>


More information about the mesa-dev mailing list