summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <[email protected]>2011-02-20 15:36:52 +0000
committerChris Wilson <[email protected]>2011-02-21 12:59:37 +0000
commit8ea6e98c7be6483514769b03ffa6c6f4f7b2e0be (patch)
treed90f19ea29be2424e975c112a18c6df3181b4838 /src
parent50ade6ea697953bb17e3ca7210515fbd0411cd1e (diff)
i965: Micro-optimise check_state
Replace the intermediate tests due to the logical or with the bitwise or. Signed-off-by: Chris Wilson <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 8bb92fed5d1..2d6fb37355d 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -181,11 +181,11 @@ void brw_destroy_state( struct brw_context *brw )
/***********************************************************************
*/
-static GLboolean check_state( const struct brw_state_flags *a,
- const struct brw_state_flags *b )
+static GLuint check_state( const struct brw_state_flags *a,
+ const struct brw_state_flags *b )
{
- return ((a->mesa & b->mesa) ||
- (a->brw & b->brw) ||
+ return ((a->mesa & b->mesa) |
+ (a->brw & b->brw) |
(a->cache & b->cache));
}
@@ -377,9 +377,7 @@ void brw_validate_state( struct brw_context *brw )
brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM;
}
- if (state->mesa == 0 &&
- state->cache == 0 &&
- state->brw == 0)
+ if ((state->mesa | state->cache | state->brw) == 0)
return;
brw->intel.Fallback = GL_FALSE; /* boolean, not bitfield */