summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-05-17 21:17:56 -0700
committerKenneth Graunke <[email protected]>2013-05-20 13:03:18 -0700
commitb96f93c4536674d6cce99ffa191d49f0df238f9b (patch)
treef30cccd53ea6728e40dfb1edc3fac257efab1116
parentbbf86712f8e01d35f765c553bf3a8bfffbd47453 (diff)
i965: Create a BRW_NEW_META_IN_PROGRESS state flag.
This will allow us to disable statistics during meta operations. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h7
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c6
2 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 4b438781762..fbff10b2e44 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -153,7 +153,8 @@ enum brw_state_id {
BRW_STATE_TRANSFORM_FEEDBACK,
BRW_STATE_RASTERIZER_DISCARD,
BRW_STATE_STATS_WM,
- BRW_STATE_UNIFORM_BUFFER
+ BRW_STATE_UNIFORM_BUFFER,
+ BRW_STATE_META_IN_PROGRESS,
};
#define BRW_NEW_URB_FENCE (1 << BRW_STATE_URB_FENCE)
@@ -186,6 +187,7 @@ enum brw_state_id {
#define BRW_NEW_RASTERIZER_DISCARD (1 << BRW_STATE_RASTERIZER_DISCARD)
#define BRW_NEW_STATS_WM (1 << BRW_STATE_STATS_WM)
#define BRW_NEW_UNIFORM_BUFFER (1 << BRW_STATE_UNIFORM_BUFFER)
+#define BRW_NEW_META_IN_PROGRESS (1 << BRW_STATE_META_IN_PROGRESS)
struct brw_state_flags {
/** State update flags signalled by mesa internals */
@@ -795,6 +797,9 @@ struct brw_context
struct brw_cache cache;
struct brw_cached_batch_item *cached_batch_items;
+ /* Whether a meta-operation is in progress. */
+ bool meta_in_progress;
+
struct {
struct brw_vertex_element inputs[VERT_ATTRIB_MAX];
struct brw_vertex_buffer buffers[VERT_ATTRIB_MAX];
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index cdc26574910..5549f595e44 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -373,6 +373,7 @@ static struct dirty_bit_map brw_bits[] = {
DEFINE_BIT(BRW_NEW_TRANSFORM_FEEDBACK),
DEFINE_BIT(BRW_NEW_RASTERIZER_DISCARD),
DEFINE_BIT(BRW_NEW_UNIFORM_BUFFER),
+ DEFINE_BIT(BRW_NEW_META_IN_PROGRESS),
{0, 0, 0}
};
@@ -460,6 +461,11 @@ void brw_upload_state(struct brw_context *brw)
brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM;
}
+ if (brw->meta_in_progress != _mesa_meta_in_progress(ctx)) {
+ brw->meta_in_progress = _mesa_meta_in_progress(ctx);
+ brw->state.dirty.brw |= BRW_NEW_META_IN_PROGRESS;
+ }
+
if ((state->mesa | state->cache | state->brw) == 0)
return;