i965: Add support for OPCODE_CMP in the VS to fix GLSL sqrt()
Bug #25628. Fixes piglit case glsl-vs-sqrt-zero.
This commit is contained in:
@@ -392,6 +392,17 @@ static void emit_sge( struct brw_vs_compile *c,
|
||||
emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_GE);
|
||||
}
|
||||
|
||||
static void emit_cmp( struct brw_compile *p,
|
||||
struct brw_reg dst,
|
||||
struct brw_reg arg0,
|
||||
struct brw_reg arg1,
|
||||
struct brw_reg arg2 )
|
||||
{
|
||||
brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, arg0, brw_imm_f(0));
|
||||
brw_SEL(p, dst, arg1, arg2);
|
||||
brw_set_predicate_control(p, BRW_PREDICATE_NONE);
|
||||
}
|
||||
|
||||
static void emit_max( struct brw_compile *p,
|
||||
struct brw_reg dst,
|
||||
struct brw_reg arg0,
|
||||
@@ -1485,6 +1496,9 @@ void brw_vs_emit(struct brw_vs_compile *c )
|
||||
brw_MOV(p, brw_acc_reg(), args[2]);
|
||||
brw_MAC(p, dst, args[0], args[1]);
|
||||
break;
|
||||
case OPCODE_CMP:
|
||||
emit_cmp(p, dst, args[0], args[1], args[2]);
|
||||
break;
|
||||
case OPCODE_MAX:
|
||||
emit_max(p, dst, args[0], args[1]);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user