[Mesa-dev] [PATCH 1/2] draw: fix vbuf caching of vertices with inject front face

Jose Fonseca jfonseca at vmware.com
Tue Dec 10 04:48:04 PST 2013


----- Original Message -----
> Caching in the vbuf module meant that once a vertex has been
> emitted it was cached, but it's possible for a vertex at the
> same location to be emitted again, but this time with a different
> front-face semantic. Caching was causing the first version of the
> vertex to be emitted, which resulted in the renderer getting
> incorrect front-face attributes. By reseting the vertex_id (which
> is used for caching) we make sure that once a front-face info
> has been injected the vertex will endup getting emitted.

Nice catch!

> Signed-off-by: Zack Rusin <zackr at vmware.com>
> ---
>  src/gallium/auxiliary/draw/draw_pipe_unfilled.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
> b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
> index 8cba07c..4f0326b 100644
> --- a/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
> +++ b/src/gallium/auxiliary/draw/draw_pipe_unfilled.c
> @@ -81,6 +81,7 @@ inject_front_face_info(struct draw_stage *stage,
>        v->data[slot][1] = is_front_face;
>        v->data[slot][2] = is_front_face;
>        v->data[slot][3] = is_front_face;

I think it's worth to echo the gist of commit comment here, just for future reference.

> +      v->vertex_id = UNDEFINED_VERTEX_ID;
>     }
>  }
>  
> --
> 1.8.3.2
> 

Patch 2/2 looks good too.

Jose


More information about the mesa-dev mailing list