[965] Fix inversion of SLT/SGE results in vertex programs.
authorEric Anholt <eric@anholt.net>
Wed, 16 Jan 2008 23:07:10 +0000 (15:07 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 16 Jan 2008 23:19:29 +0000 (15:19 -0800)
The WM code had this right, so copy its behavior.  This reverts a flipping
of the arguments to SLT in brw_vs_tnl which came in with the GLSL code that
probably occurred to work around the flipped results, and brings the code back
in line with t_vp_build.c.

src/mesa/drivers/dri/i965/brw_vs_emit.c
src/mesa/drivers/dri/i965/brw_vs_tnl.c

index 7322123fb464d4d0dd7bc3c65a8886ee82e4a754..447e1182b30b1be283e7a7a3d66b9baf8fa23ae5 100644 (file)
@@ -229,13 +229,10 @@ static void emit_sop( struct brw_compile *p,
                       struct brw_reg arg1, 
                      GLuint cond)
 {
-   brw_push_insn_state(p);
+   brw_MOV(p, dst, brw_imm_f(0.0f));
    brw_CMP(p, brw_null_reg(), cond, arg0, arg1);
-   brw_set_predicate_control(p, BRW_PREDICATE_NONE);
    brw_MOV(p, dst, brw_imm_f(1.0f));
-   brw_set_predicate_control(p, BRW_PREDICATE_NORMAL);
-   brw_MOV(p, dst, brw_imm_f(0.0f));
-   brw_pop_insn_state(p);
+   brw_set_predicate_control_flag_value(p, 0xff);
 }
 
 static void emit_seq( struct brw_compile *p,
index aecdd4bc31a31589ab38dbc8de4f19432b3611ec..27210d1a3741c44b5bcf8071c122b6177f69538e 100644 (file)
@@ -855,7 +855,7 @@ static struct ureg calculate_light_attenuation( struct tnl_program *p,
       struct ureg slt = get_temp(p);
 
       emit_op2(p, OPCODE_DP3, spot, 0, ureg_negate(VPpli), spot_dir_norm);
-      emit_op2(p, OPCODE_SLT, slt, 0, spot, swizzle1(spot_dir_norm,W));
+      emit_op2(p, OPCODE_SLT, slt, 0, swizzle1(spot_dir_norm,W), spot);
       emit_op2(p, OPCODE_POW, spot, 0, spot, swizzle1(attenuation, W));
       emit_op2(p, OPCODE_MUL, att, 0, slt, spot);