Mesa (master): i965: Avoid vs header computation for negative rhw on G4X.

Eric Anholt anholt at kemper.freedesktop.org
Mon Nov 3 02:56:41 UTC 2008


Module: Mesa
Branch: master
Commit: 9fd4c27ae3e189df804b86843a6aad0e70640533
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9fd4c27ae3e189df804b86843a6aad0e70640533

Author: Eric Anholt <eric at anholt.net>
Date:   Sun Nov  2 12:19:02 2008 -0800

i965: Avoid vs header computation for negative rhw on G4X.

This cuts one MOV out when setting a zero header.

---

 src/mesa/drivers/dri/i965/brw_vs_emit.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c
index 0b6c6b2..ed0e1d5 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c
@@ -829,12 +829,12 @@ static void emit_vertex_write( struct brw_vs_compile *c)
       ndc = pos;
    }
 
-   /* This includes the workaround for -ve rhw, so is no longer an
-    * optional step:
+   /* Update the header for point size, user clipping flags, and -ve rhw
+    * workaround.
     */
    if ((c->prog_data.outputs_written & (1<<VERT_RESULT_PSIZ)) ||
        c->key.nr_userclip ||
-       !c->key.know_w_is_one)
+       (!BRW_IS_G4X(p->brw) && !c->key.know_w_is_one))
    {
       struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD);
       GLuint i;




More information about the mesa-commit mailing list