<div dir="ltr">On 29 July 2013 11:09, Zack Rusin <span dir="ltr"><<a href="mailto:zackr@vmware.com" target="_blank">zackr@vmware.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That looks wrong to me. We already account for the "other fields" in the vertex_size.<br></blockquote><div><br></div><div>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?<br>
<br></div><div>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.<br></div><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
----- Original Message -----<br>
> From: Bryan Cain <<a href="mailto:bryancain3@gmail.com">bryancain3@gmail.com</a>><br>
><br>
> Before, it accounted for the size of the vertices but not the other fields<br>
> in the vertex_header struct, which caused memory corruption.<br>
> ---<br>
> src/gallium/auxiliary/draw/draw_gs.c | 3 ++-<br>
> 1 file changed, 2 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/gallium/auxiliary/draw/draw_gs.c<br>
> b/src/gallium/auxiliary/draw/draw_gs.c<br>
> index cd63e2b..78727c6 100644<br>
> --- a/src/gallium/auxiliary/draw/draw_gs.c<br>
> +++ b/src/gallium/auxiliary/draw/draw_gs.c<br>
> @@ -560,7 +560,8 @@ int draw_geometry_shader_run(struct draw_geometry_shader<br>
> *shader,<br>
> /* we allocate exactly one extra vertex per primitive to allow the GS to<br>
> emit<br>
> * overflown vertices into some area where they won't harm anyone */<br>
> output_verts->verts =<br>
> - (struct vertex_header *)MALLOC(output_verts->vertex_size *<br>
> + (struct vertex_header *)MALLOC(sizeof(struct vertex_header) +<br>
> + output_verts->vertex_size *<br>
> max_out_prims *<br>
> shader->primitive_boundary);<br>
><br>
> --<br>
> 1.8.3.4<br>
><br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><br>
</blockquote></div><br></div></div>