aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2011-08-23 10:26:15 -0700
committerPaul Berry <[email protected]>2011-09-06 11:04:09 -0700
commitf86d1976f81811aec0a555946e263295ed1403db (patch)
tree0929b14d4c62cd9ab8661c479f9196bc1480d9d6
parent34fbab2125555ba0afffa361e1c74fb3359ef3a7 (diff)
i965: new VS: move NDC computation (GEN4-5) to a separate function.
Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp10
2 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index dfe9c025e82..9b932960589 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -463,6 +463,7 @@ public:
void emit_math2_gen4(enum opcode opcode, dst_reg dst, src_reg src0, src_reg src1);
void emit_math(enum opcode opcode, dst_reg dst, src_reg src0, src_reg src1);
+ void emit_ndc_computation();
int emit_vue_header_gen6(int header_mrf);
int emit_vue_header_gen4(int header_mrf);
void emit_urb_writes(void);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 71d8b395d55..3335ea246fb 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -1698,8 +1698,8 @@ vec4_visitor::visit(ir_if *ir)
emit(BRW_OPCODE_ENDIF);
}
-int
-vec4_visitor::emit_vue_header_gen4(int header_mrf)
+void
+vec4_visitor::emit_ndc_computation()
{
/* Get the position */
src_reg pos = src_reg(output_reg[VERT_RESULT_HPOS]);
@@ -1719,6 +1719,12 @@ vec4_visitor::emit_vue_header_gen4(int header_mrf)
ndc_xyz.writemask = WRITEMASK_XYZ;
emit(MUL(ndc_xyz, pos, src_reg(ndc_w)));
+}
+
+int
+vec4_visitor::emit_vue_header_gen4(int header_mrf)
+{
+ emit_ndc_computation();
if ((c->prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_PSIZ)) ||
c->key.nr_userclip || brw->has_negative_rhw_bug) {