summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_clip_line.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2014-05-25 01:08:49 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-05-27 13:46:01 -0700
commit09655bb81b2a3767e678280631c49851ba9c022d (patch)
treefc3f03b82c4b6d3f00233fdacb3f0ec6d47c4739 /src/mesa/drivers/dri/i965/brw_clip_line.c
parentb07c4b1d9d2da205d8d90249d997f9296e40a2d7 (diff)
downloadexternal_mesa3d-09655bb81b2a3767e678280631c49851ba9c022d.zip
external_mesa3d-09655bb81b2a3767e678280631c49851ba9c022d.tar.gz
external_mesa3d-09655bb81b2a3767e678280631c49851ba9c022d.tar.bz2
i965: Don't implicitly set predicate default state in brw_CMP.
Previously, brw_CMP with a null destination implicitly set the default state to make future instructions predicated. This is messy and confusing - emitting a CMP that populates the flag register and later using it to predicate instructions are logically separate. With the main compiler, we may even schedule instructions between the CMP and the user of the flag value. This patch simplifies brw_CMP to just emit a CMP instruction, and not mess with predication. It also updates all necessary callers. These mostly fell into two patterns: 1. brw_CMP followed by brw_IF. We don't need to do anything special here; brw_IF already sets up predication appropriately. 2. brw_CMP followed by a single predicated instruction. The old model was to call brw_CMP, emit the next (predicated) instruction, then disable predication for any instructions beyond that. Instead, just explicitly set predicate_control on the single instruction we want to predicate. It's no more code, and requires less cross-module knowledge. This drops setting flag_value to 0xff as well, which is a field only used by the SF compile. There is only one brw_CMP call in the SF code, which is in do_twoside_caller, and called at the start of brw_emit_tri_setup, where flag_value is already 0xff. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clip_line.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip_line.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clip_line.c b/src/mesa/drivers/dri/i965/brw_clip_line.c
index 17891c6..a8c2cac 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_line.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_line.c
@@ -130,6 +130,7 @@ static void clip_and_emit_line( struct brw_clip_compile *c )
{
struct brw_compile *p = &c->func;
struct brw_context *brw = p->brw;
+ struct brw_instruction *inst;
struct brw_indirect vtx0 = brw_indirect(0, 0);
struct brw_indirect vtx1 = brw_indirect(1, 0);
struct brw_indirect newvtx0 = brw_indirect(2, 0);
@@ -228,8 +229,8 @@ static void clip_and_emit_line( struct brw_clip_compile *c )
brw_MUL(p, c->reg.t, c->reg.t, c->reg.dp1);
brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t1 );
- brw_MOV(p, c->reg.t1, c->reg.t);
- brw_set_predicate_control(p, BRW_PREDICATE_NONE);
+ inst = brw_MOV(p, c->reg.t1, c->reg.t);
+ inst->header.predicate_control = BRW_PREDICATE_NORMAL;
}
brw_ELSE(p);
{
@@ -250,8 +251,8 @@ static void clip_and_emit_line( struct brw_clip_compile *c )
brw_MUL(p, c->reg.t, c->reg.t, c->reg.dp0);
brw_CMP(p, vec1(brw_null_reg()), BRW_CONDITIONAL_G, c->reg.t, c->reg.t0 );
- brw_MOV(p, c->reg.t0, c->reg.t);
- brw_set_predicate_control(p, BRW_PREDICATE_NONE);
+ inst = brw_MOV(p, c->reg.t0, c->reg.t);
+ inst->header.predicate_control = BRW_PREDICATE_NORMAL;
}
if (brw->has_negative_rhw_bug) {