i965: Create a BRW_NEW_META_IN_PROGRESS state flag.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 18 May 2013 04:17:56 +0000 (21:17 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 20 May 2013 20:03:18 +0000 (13:03 -0700)
This will allow us to disable statistics during meta operations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_state_upload.c

index 4b438781762ebbc1c800ad8c00ae88d83aff2a65..fbff10b2e4497457668339c4edf788a5cbb2572b 100644 (file)
@@ -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];
index cdc26574910584cea39135b62d604a151d01e971..5549f595e445a2ad917992fc4527cda0262b9cba 100644 (file)
@@ -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;