[Mesa-dev] [PATCH 6/6] draw: Do a full state change flush on opt and prim changes

Jose Fonseca jfonseca at vmware.com
Tue Jan 24 04:39:50 PST 2012


IIUC, patch 3-6 should be squashed, otherwise regressions will happen when checking out the tree at commits of patch 3, 4 or 5.

The comments of these patches (e.g., why it's necessary a full flush when prim changes, future improvements, etc) should be next to the code itself for future reference.

Otherwise the series looks ok to me.

Jose

----- Original Message -----
> From: Jakob Bornecrantz <wallbraker at gmail.com>
> 
> In certain conditions when going from different primitive requires
> us to flush and validate the different stages. Like smoth lines being
> active but first drawing with triangles and then drawing lines.
> 
> Reviewed-by: Stéphane Marchesin <marcheu at chromium.org>
> Tested-by: Stéphane Marchesin <marcheu at chromium.org>
> ---
>  src/gallium/auxiliary/draw/draw_pt.c |   15 +++++++++------
>  1 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/src/gallium/auxiliary/draw/draw_pt.c
> b/src/gallium/auxiliary/draw/draw_pt.c
> index d2e2126..403c0f4 100644
> --- a/src/gallium/auxiliary/draw/draw_pt.c
> +++ b/src/gallium/auxiliary/draw/draw_pt.c
> @@ -108,12 +108,15 @@ draw_pt_arrays(struct draw_context *draw,
>  
>     frontend = draw->pt.frontend;
>  
> -   if (frontend && (draw->pt.prim != prim ||
> -                    draw->pt.opt != opt ||
> -                    draw->pt.eltSize != draw->pt.user.eltSize)) {
> -      /* XXX: flush only the frontend if eltSize changed */
> -      frontend->flush( frontend, DRAW_FLUSH_STATE_CHANGE );
> -      frontend = NULL;
> +   if (frontend ) {
> +      if (draw->pt.prim != prim || draw->pt.opt != opt) {
> +         draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
> +         frontend = NULL;
> +      } else if (draw->pt.eltSize != draw->pt.user.eltSize) {
> +         /* XXX: flush only the frontend if eltSize changed */
> +         frontend->flush( frontend, DRAW_FLUSH_STATE_CHANGE );
> +         frontend = NULL;
> +      }
>     }
>  
>     if (!frontend) {
> --
> 1.7.6.5
> 
> _______________________________________________
> 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