[Mesa-dev] [PATCH 32/36] i965: clip: Convert computations to ..._to_offset() for clarity.
Eric Anholt
eric at anholt.net
Fri Sep 2 14:42:20 PDT 2011
On Fri, 2 Sep 2011 09:07:11 -0700, Paul Berry <stereotype441 at gmail.com> wrote:
> This patch replaces some ad-hoc computations using ATTR_SIZE and the
> offset[] array to use the VUE map functions
> brw_vert_result_to_offset() and brw_vue_slot_to_offset().
> ---
> src/mesa/drivers/dri/i965/brw_clip_tri.c | 2 +-
> src/mesa/drivers/dri/i965/brw_clip_unfilled.c | 32 ++++++++++++++++-----
> src/mesa/drivers/dri/i965/brw_clip_util.c | 36 ++++++++++++++++++-------
> 3 files changed, 51 insertions(+), 19 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c
> index 359f76f..e0d500c 100644
> --- a/src/mesa/drivers/dri/i965/brw_clip_tri.c
> +++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c
> @@ -78,7 +78,7 @@ void brw_clip_tri_alloc_regs( struct brw_clip_compile *c,
> /* The VUE has an odd number of slots so the last register is only half
> * used. Fill the second half with zero. */
> for (j = 0; j < 3; j++) {
> - GLuint delta = c->vue_map.num_slots * ATTR_SIZE;
> + GLuint delta = brw_vue_slot_to_offset(c->vue_map.num_slots);
Ooh, I was going to complain about that computation before, then decided
it wasn't worth complaining about, and now it's fixed :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110902/0ba77115/attachment.pgp>
More information about the mesa-dev
mailing list