Mesa (master): i965/vs: Add support for copying user edge flags.

Eric Anholt anholt at kemper.freedesktop.org
Thu Aug 9 16:08:32 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jul 27 12:57:56 2012 -0700

i965/vs: Add support for copying user edge flags.

Fixes the glsl skinning demo regression since changing to the new GLSL
compiler, and is part of fixing piglit gl-2.0-edgeflag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50079
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 8f697c4..61b10e9 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2270,6 +2270,17 @@ vec4_visitor::emit_urb_slot(int mrf, int vert_result)
          emit_clip_distances(hw_reg, (vert_result - VERT_RESULT_CLIP_DIST0) * 4);
       }
       break;
+   case VERT_RESULT_EDGE:
+      /* This is present when doing unfilled polygons.  We're supposed to copy
+       * the edge flag from the user-provided vertex array
+       * (glEdgeFlagPointer), or otherwise we'll copy from the current value
+       * of that attribute (starts as 1.0f).  This is then used in clipping to
+       * determine which edges should be drawn as wireframe.
+       */
+      current_annotation = "edge flag";
+      emit(MOV(reg, src_reg(dst_reg(ATTR, VERT_ATTRIB_EDGEFLAG,
+                                    glsl_type::float_type, WRITEMASK_XYZW))));
+      break;
    case BRW_VERT_RESULT_PAD:
       /* No need to write to this slot */
       break;
@@ -2326,8 +2337,6 @@ vec4_visitor::emit_urb_writes()
     */
    assert ((max_usable_mrf - base_mrf) % 2 == 0);
 
-   /* FINISHME: edgeflag */
-
    /* First mrf is the g0-based message header containing URB handles and such,
     * which is implied in VS_OPCODE_URB_WRITE.
     */




More information about the mesa-commit mailing list