summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-02-06 15:22:45 -0800
committerIan Romanick <[email protected]>2013-02-17 14:20:27 -0800
commitbb4b1494e32b85dc5caa777c391b30b3dda5c785 (patch)
tree650554a601d0d55d43d1bc668675cce09fda6aa7 /src
parent321abaaa8d6afe56c5de69d32e914a893259e0bc (diff)
i965: Re-enable the -RHW workaround for original gen4 chips.
Fixes broken clipping in supertuxkart and presumably many other applications. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51471 NOTE: Candidate for the stable branches. Reviewed-by: Kenneth Graunke <[email protected]> (cherry picked from commit cb4616d32dc85e60dba08d86581dbb0d6d1b7ffa)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 1863fe504eb..ae4cf7d423b 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2420,18 +2420,14 @@ vec4_visitor::emit_psiz_and_flags(struct brw_reg reg)
* clipped against all fixed planes.
*/
if (brw->has_negative_rhw_bug) {
-#if 0
- /* FINISHME */
- brw_CMP(p,
- vec8(brw_null_reg()),
- BRW_CONDITIONAL_L,
- brw_swizzle1(output_reg[BRW_VERT_RESULT_NDC], 3),
- brw_imm_f(0));
-
- brw_OR(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(1<<6));
- brw_MOV(p, output_reg[BRW_VERT_RESULT_NDC], brw_imm_f(0));
- brw_set_predicate_control(p, BRW_PREDICATE_NONE);
-#endif
+ src_reg ndc_w = src_reg(output_reg[BRW_VERT_RESULT_NDC]);
+ ndc_w.swizzle = BRW_SWIZZLE_WWWW;
+ emit(CMP(dst_null_f(), ndc_w, src_reg(0.0f), BRW_CONDITIONAL_L));
+ vec4_instruction *inst;
+ inst = emit(OR(header1_w, src_reg(header1_w), src_reg(1u << 6)));
+ inst->predicate = BRW_PREDICATE_NORMAL;
+ inst = emit(MOV(output_reg[BRW_VERT_RESULT_NDC], src_reg(0.0f)));
+ inst->predicate = BRW_PREDICATE_NORMAL;
}
emit(MOV(retype(reg, BRW_REGISTER_TYPE_UD), src_reg(header1)));