[Mesa-dev] [PATCH 4/8] draw/gs: fix segfault in glsl-1.50-gs-mismatch-prim-type triangles_adjacency

Roland Scheidegger sroland at vmware.com
Tue Jun 10 06:59:32 PDT 2014


Am 10.06.2014 07:57, schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
> 
> This crashes on softpipe due to a lack of output memory allocated,
> 
> it appears we allocate memory for enough primtives, but not vertices
> so convert to number of vertices.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/gallium/auxiliary/draw/draw_gs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
> index fc4f697..0a9bf81 100644
> --- a/src/gallium/auxiliary/draw/draw_gs.c
> +++ b/src/gallium/auxiliary/draw/draw_gs.c
> @@ -555,7 +555,7 @@ 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 */
>     unsigned total_verts_per_buffer = shader->primitive_boundary *
> -      num_in_primitives;
> +      max_out_prims * u_vertices_per_prim(shader->output_primitive);
>  
>     //Assume at least one primitive
>     max_out_prims = MAX2(max_out_prims, 1);
> 

Zack would probably know better but looks alright to me.

Roland


More information about the mesa-dev mailing list