On 2 September 2011 14:40, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net">eric@anholt.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, 2 Sep 2011 09:07:10 -0700, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>
> Previously we would examine the offset[] array (since an offset of 0<br>
> meant "not in use"). This paves the way for removing the offset[]<br>
> array.<br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_clip.h | 9 +++++++++<br>
> src/mesa/drivers/dri/i965/brw_clip_unfilled.c | 14 +++++++++-----<br>
> src/mesa/drivers/dri/i965/brw_clip_util.c | 8 ++++----<br>
> 3 files changed, 22 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_clip.h b/src/mesa/drivers/dri/i965/brw_clip.h<br>
> index 0324fea..80d4412 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_clip.h<br>
> +++ b/src/mesa/drivers/dri/i965/brw_clip.h<br>
> @@ -126,6 +126,15 @@ struct brw_clip_compile {<br>
><br>
> #define ATTR_SIZE (4*4)<br>
><br>
> +/**<br>
> + * True if the given vert_result is one of the outputs of the vertex shader.<br>
> + */<br>
> +static inline GLboolean brw_clip_have_vert_result(struct brw_clip_compile *c,<br>
> + GLuint vert_result)<br>
> +{<br>
> + return (c->key.attrs & BITFIELD64_BIT(vert_result)) ? 1 : 0;<br>
> +}<br>
<br>
</div>This helper function doesn't look like it's really saving typing, but if<br>
you like it, please use "bool" instead of "GLboolean" except in GL API<br>
implementation.<br></blockquote><div><br>Whoops, you're right.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
> +<br>
> /* Points are only culled, so no need for a clip routine, however it<br>
> * works out easier to have a dummy one.<br>
> */<br>
> diff --git a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c<br>
> index da58796..53345f1 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c<br>
> +++ b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c<br>
> @@ -130,8 +130,10 @@ static void copy_bfc( struct brw_clip_compile *c )<br>
><br>
> /* Do we have any colors to copy?<br>
> */<br>
> - if (!(c->offset[VERT_RESULT_COL0] && c->offset[VERT_RESULT_BFC0]) &&<br>
> - !(c->offset[VERT_RESULT_COL1] && c->offset[VERT_RESULT_BFC1]))<br>
> + if (!(brw_clip_have_vert_result(c, VERT_RESULT_COL0) &&<br>
> + brw_clip_have_vert_result(c, VERT_RESULT_BFC0)) &&<br>
> + !(brw_clip_have_vert_result(c, VERT_RESULT_COL1) &&<br>
> + brw_clip_have_vert_result(c, VERT_RESULT_BFC1)))<br>
> return;<br>
</div></div></blockquote></div><br>