Mesa (7.8): i965: Set the correct provoking vertex for clipped first-mode trifans.

Eric Anholt anholt at kemper.freedesktop.org
Tue Jun 15 15:55:57 PDT 2010


Module: Mesa
Branch: 7.8
Commit: 37a8fa74c3dcb23ff61663e806d1a540e8ab52f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=37a8fa74c3dcb23ff61663e806d1a540e8ab52f1

Author: Eric Anholt <eric at anholt.net>
Date:   Fri May 14 15:34:35 2010 -0700

i965: Set the correct provoking vertex for clipped first-mode trifans.

Bug #24470: glean clipFlat test.
(cherry picked from commit 4e84dc8729cac4c78e521436ae091638a490da76)

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c
index b27fe65..916a99e 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_tri.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c
@@ -177,7 +177,7 @@ void brw_clip_tri_init_vertices( struct brw_clip_compile *c )
 void brw_clip_tri_flat_shade( struct brw_clip_compile *c )
 {
    struct brw_compile *p = &c->func;
-   struct brw_instruction *is_poly;
+   struct brw_instruction *is_poly, *is_trifan;
    struct brw_reg tmp0 = c->reg.loopcount; /* handy temporary */
 
    brw_AND(p, tmp0, get_element_ud(c->reg.R0, 2), brw_imm_ud(PRIM_MASK)); 
@@ -195,8 +195,22 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c )
    is_poly = brw_ELSE(p, is_poly);
    {
       if (c->key.pv_first) {
-         brw_clip_copy_colors(c, 1, 0);
-         brw_clip_copy_colors(c, 2, 0);
+	 brw_CMP(p,
+		 vec1(brw_null_reg()),
+		 BRW_CONDITIONAL_EQ,
+		 tmp0,
+		 brw_imm_ud(_3DPRIM_TRIFAN));
+	 is_trifan = brw_IF(p, BRW_EXECUTE_1);
+	 {
+	    brw_clip_copy_colors(c, 0, 1);
+	    brw_clip_copy_colors(c, 2, 1);
+	 }
+	 is_trifan = brw_ELSE(p, is_trifan);
+	 {
+	    brw_clip_copy_colors(c, 1, 0);
+	    brw_clip_copy_colors(c, 2, 0);
+	 }
+	 brw_ENDIF(p, is_trifan);
       }
       else {
          brw_clip_copy_colors(c, 0, 2);



More information about the mesa-commit mailing list