On Fri,  2 Sep 2011 09:07:10 -0700, Paul Berry <stereotype...@gmail.com> wrote:
> Previously we would examine the offset[] array (since an offset of 0
> meant "not in use").  This paves the way for removing the offset[]
> array.
> ---
>  src/mesa/drivers/dri/i965/brw_clip.h          |    9 +++++++++
>  src/mesa/drivers/dri/i965/brw_clip_unfilled.c |   14 +++++++++-----
>  src/mesa/drivers/dri/i965/brw_clip_util.c     |    8 ++++----
>  3 files changed, 22 insertions(+), 9 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_clip.h 
> b/src/mesa/drivers/dri/i965/brw_clip.h
> index 0324fea..80d4412 100644
> --- a/src/mesa/drivers/dri/i965/brw_clip.h
> +++ b/src/mesa/drivers/dri/i965/brw_clip.h
> @@ -126,6 +126,15 @@ struct brw_clip_compile {
>  
>  #define ATTR_SIZE  (4*4)
>  
> +/**
> + * True if the given vert_result is one of the outputs of the vertex shader.
> + */
> +static inline GLboolean brw_clip_have_vert_result(struct brw_clip_compile *c,
> +                                                  GLuint vert_result)
> +{
> +   return (c->key.attrs & BITFIELD64_BIT(vert_result)) ? 1 : 0;
> +}

This helper function doesn't look like it's really saving typing, but if
you like it, please use "bool" instead of "GLboolean" except in GL API
implementation.

> +
>  /* Points are only culled, so no need for a clip routine, however it
>   * works out easier to have a dummy one.
>   */
> diff --git a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c 
> b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c
> index da58796..53345f1 100644
> --- a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c
> +++ b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c
> @@ -130,8 +130,10 @@ static void copy_bfc( struct brw_clip_compile *c )
>  
>     /* Do we have any colors to copy? 
>      */
> -   if (!(c->offset[VERT_RESULT_COL0] && c->offset[VERT_RESULT_BFC0]) &&
> -       !(c->offset[VERT_RESULT_COL1] && c->offset[VERT_RESULT_BFC1]))
> +   if (!(brw_clip_have_vert_result(c, VERT_RESULT_COL0) &&
> +         brw_clip_have_vert_result(c, VERT_RESULT_BFC0)) &&
> +       !(brw_clip_have_vert_result(c, VERT_RESULT_COL1) &&
> +         brw_clip_have_vert_result(c, VERT_RESULT_BFC1)))
>        return;

Attachment: pgpuYX64m3XoK.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to