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

Zack Rusin zackr at vmware.com
Tue Jun 10 07:02:33 PDT 2014


That looks wrong.  The total number of verts per buffer is the maximum number of verts that can be output per invocation (primitive_boundary) times number of invocations of geometry shader (num_in_primitives).

It's not maximum number of verts that can be output per invocation (primitive_boundary) times maximum number of primitives output by geometry shader (max_out_prims).

z

----- Original Message -----
> 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);
> --
> 1.9.3
> 
> _______________________________________________
> 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