path: root/src/mesa/drivers/dri/i965/brw_clip_util.c
diff options
authorPaul Berry <>2011-08-24 20:03:35 -0700
committerPaul Berry <>2011-09-06 11:05:11 -0700
commit62b0c8561e2d259e4dc1f27346bf2f36c3b098c8 (patch)
treea082d1eabf98676434cdcb427e605b88bd3394af /src/mesa/drivers/dri/i965/brw_clip_util.c
parenteae5b5c44e58ad2937600991a5569518d3023f68 (diff)
i965: clip: Move hpos_offest and ndc_offset into local functions.
The offsets within the VUE of HPOS and NDC are needed only in a few auxiliary clipping functions. This patch moves computation of those offsets into the functions that need them, and does the computation using the VUE map. Reviewed-by: Eric Anholt <>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clip_util.c')
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c
index 7e2998366b..8cbb2ff886 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_util.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_util.c
@@ -109,13 +109,17 @@ static void brw_clip_project_vertex( struct brw_clip_compile *c,
struct brw_compile *p = &c->func;
struct brw_reg tmp = get_tmp(c);
+ GLuint hpos_offset = brw_vert_result_to_offset(&c->vue_map,
+ GLuint ndc_offset = brw_vert_result_to_offset(&c->vue_map,
/* Fixup position. Extract from the original vertex and re-project
* to screen space:
- brw_MOV(p, tmp, deref_4f(vert_addr, c->offset[VERT_RESULT_HPOS]));
+ brw_MOV(p, tmp, deref_4f(vert_addr, hpos_offset));
brw_clip_project_position(c, tmp);
- brw_MOV(p, deref_4f(vert_addr, c->ndc_offset), tmp);
+ brw_MOV(p, deref_4f(vert_addr, ndc_offset), tmp);
release_tmp(c, tmp);