From: Eric Anholt Date: Fri, 5 Aug 2011 23:29:48 +0000 (-0700) Subject: i965/vs: Don't emit an extra copy of the vertex position. X-Git-Tag: mesa-8.0-rc1~2728^2~229 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0f334a3ed3c6645abd1812e39cd52f1dfa32fa1;p=platform%2Fupstream%2Fmesa.git i965/vs: Don't emit an extra copy of the vertex position. Fixes glsl-vs-abs-neg, glsl-vs-all-01, and probably many other tests. --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index 439969a..c4a3c8a 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -1550,7 +1550,7 @@ vec4_visitor::emit_vue_header_gen4(int header_mrf) * dword 8-11 (m3) of the vertex header is the 4D space position * dword 12-19 (m4,m5) of the vertex header is the user clip distance. * m6 is a pad so that the vertex element data is aligned - * m7 is the first vertex data we fill, which is the vertex position. + * m7 is the first vertex data we fill. */ current_annotation = "NDC"; emit(BRW_OPCODE_MOV, brw_message_reg(header_mrf++), src_reg(ndc)); @@ -1561,15 +1561,14 @@ vec4_visitor::emit_vue_header_gen4(int header_mrf) /* user clip distance. */ header_mrf += 2; - /* Pad so that vertex element data (starts with position) is aligned. */ + /* Pad so that vertex element data is aligned. */ header_mrf++; } else { /* There are 8 dwords in VUE header pre-Ironlake: * dword 0-3 (m1) is indices, point width, clip flags. * dword 4-7 (m2) is ndc position (set above) * - * dword 8-11 (m3) is the first vertex data, which we always have be the - * vertex position. + * dword 8-11 (m3) is the first vertex data. */ current_annotation = "NDC"; emit(BRW_OPCODE_MOV, brw_message_reg(header_mrf++), src_reg(ndc)); @@ -1592,8 +1591,7 @@ vec4_visitor::emit_vue_header_gen6(int header_mrf) * dword 8-15 (m4,m5) of the vertex header is the user clip distance if * enabled. * - * m4 or 6 is the first vertex element data we fill, which is - * the vertex position. + * m4 or 6 is the first vertex element data we fill. */ current_annotation = "indices, point width, clip flags"; @@ -1681,6 +1679,10 @@ vec4_visitor::emit_urb_writes() if (!(c->prog_data.outputs_written & BITFIELD64_BIT(attr))) continue; + /* This is set up in the VUE header. */ + if (attr == VERT_RESULT_HPOS) + continue; + /* This is loaded into the VUE header, and thus doesn't occupy * an attribute slot. */