summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_clip_util.c
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2011-08-31 15:34:01 -0700
committerPaul Berry <stereotype441@gmail.com>2011-09-06 11:05:28 -0700
commit2ef1fa6b3c8d52e059bf6ccf519c45604962b27c (patch)
treed7953273ffc6397609d05101f25fe90a9955c10c /src/mesa/drivers/dri/i965/brw_clip_util.c
parent54a62f8806df29d79f1e630bae6d1f45fb15c69f (diff)
i965: clip: Convert computations to ..._to_offset() for clarity.
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(). Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clip_util.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip_util.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c
index cfbb497f9d..8c9f0e4957 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_util.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_util.c
@@ -152,7 +152,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,
/* Iterate over each attribute (could be done in pairs?)
*/
for (slot = 2*c->header_regs; slot < c->vue_map.num_slots; slot++) {
- GLuint delta = ATTR_SIZE * slot;
+ GLuint delta = brw_vue_slot_to_offset(slot);
if (c->vue_map.slot_to_vert_result[slot] == VERT_RESULT_EDGE) {
if (force_edgeflag)
@@ -183,7 +183,7 @@ void brw_clip_interp_vertex( struct brw_clip_compile *c,
}
if (c->vue_map.num_slots % 2) {
- GLuint delta = c->vue_map.num_slots * ATTR_SIZE;
+ GLuint delta = brw_vue_slot_to_offset(c->vue_map.num_slots);
brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(0));
}
@@ -292,23 +292,39 @@ void brw_clip_copy_colors( struct brw_clip_compile *c,
if (brw_clip_have_vert_result(c, VERT_RESULT_COL0))
brw_MOV(p,
- byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL0]),
- byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL0]));
+ byte_offset(c->reg.vertex[to],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_COL0)),
+ byte_offset(c->reg.vertex[from],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_COL0)));
if (brw_clip_have_vert_result(c, VERT_RESULT_COL1))
brw_MOV(p,
- byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_COL1]),
- byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_COL1]));
+ byte_offset(c->reg.vertex[to],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_COL1)),
+ byte_offset(c->reg.vertex[from],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_COL1)));
if (brw_clip_have_vert_result(c, VERT_RESULT_BFC0))
brw_MOV(p,
- byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC0]),
- byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC0]));
+ byte_offset(c->reg.vertex[to],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_BFC0)),
+ byte_offset(c->reg.vertex[from],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_BFC0)));
if (brw_clip_have_vert_result(c, VERT_RESULT_BFC1))
brw_MOV(p,
- byte_offset(c->reg.vertex[to], c->offset[VERT_RESULT_BFC1]),
- byte_offset(c->reg.vertex[from], c->offset[VERT_RESULT_BFC1]));
+ byte_offset(c->reg.vertex[to],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_BFC1)),
+ byte_offset(c->reg.vertex[from],
+ brw_vert_result_to_offset(&c->vue_map,
+ VERT_RESULT_BFC1)));
}