From: Paul Berry Date: Fri, 26 Aug 2011 19:17:56 +0000 (-0700) Subject: i965: clip: Remove assumption about VUE header from brw_clip_interp_vertex() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4efb32c642507228d5bfebbd6d403dd9944f9b7c;p=mesa.git i965: clip: Remove assumption about VUE header from brw_clip_interp_vertex() Previously, brw_clip_interp_vertex() iterated only through the "non-header" elements of the VUE when performing interpolation (because header elements don't need interpolation). This code now refers exclusively to the VUE map to figure out which elements need interpolation, so that brw_clip_interp_vertex() doesn't need to know the header size. Reviewed-by: Eric Anholt --- diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c index 8c9f0e49575..a12dab6b350 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_util.c +++ b/src/mesa/drivers/dri/i965/brw_clip_util.c @@ -151,17 +151,20 @@ 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++) { + for (slot = 0; slot < c->vue_map.num_slots; slot++) { + int vert_result = c->vue_map.slot_to_vert_result[slot]; GLuint delta = brw_vue_slot_to_offset(slot); - if (c->vue_map.slot_to_vert_result[slot] == VERT_RESULT_EDGE) { + if (vert_result == VERT_RESULT_EDGE) { if (force_edgeflag) brw_MOV(p, deref_4f(dest_ptr, delta), brw_imm_f(1)); else brw_MOV(p, deref_4f(dest_ptr, delta), deref_4f(v0_ptr, delta)); - } - else { - /* Interpolate: + } else if (vert_result == VERT_RESULT_PSIZ) { + /* PSIZ doesn't need interpolation */ + } else if (vert_result < VERT_RESULT_MAX) { + /* This is a true vertex result (and not a special value for the VUE + * header), so interpolate: * * New = attr0 + t*attr1 - t*attr0 */