[Mesa-dev] [PATCH 16/70] i965: Move the render_cache dirty set from the context to the batch
Chris Wilson
chris at chris-wilson.co.uk
Fri Aug 7 13:13:20 PDT 2015
To reduce churn later, move the brw->render_cache dirty set into the
batch (i.e. brw->batch.render_cache).
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
src/mesa/drivers/dri/i965/brw_batch.h | 7 +++++++
src/mesa/drivers/dri/i965/brw_context.h | 7 -------
src/mesa/drivers/dri/i965/intel_fbo.c | 12 ++++++------
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_batch.h b/src/mesa/drivers/dri/i965/brw_batch.h
index 1d0f0dd..3b8d354 100644
--- a/src/mesa/drivers/dri/i965/brw_batch.h
+++ b/src/mesa/drivers/dri/i965/brw_batch.h
@@ -64,6 +64,13 @@ typedef struct brw_batch {
uint32_t *map_next;
int reloc_count;
} saved;
+
+ /**
+ * Set of brw_bo* that have been rendered to within this batchbuffer
+ * and would need flushing before being used from another cache domain that
+ * isn't coherent with it (i.e. the sampler).
+ */
+ struct set *render_cache;
} brw_batch;
inline static brw_bo *brw_bo_get(brw_bo *bo)
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index cd8ea50..238d0eb 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1009,13 +1009,6 @@ struct brw_context
uint8_t pipe_controls_since_last_cs_stall;
/**
- * Set of brw_bo* that have been rendered to within this batchbuffer
- * and would need flushing before being used from another cache domain that
- * isn't coherent with it (i.e. the sampler).
- */
- struct set *render_cache;
-
- /**
* Number of resets observed in the system at context creation.
*
* This is tracked in the context so that we can determine that another
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index b22931e..fbccf7e 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -1050,15 +1050,15 @@ brw_render_cache_set_clear(struct brw_context *brw)
{
struct set_entry *entry;
- set_foreach(brw->render_cache, entry) {
- _mesa_set_remove(brw->render_cache, entry);
+ set_foreach(brw->batch.render_cache, entry) {
+ _mesa_set_remove(brw->batch.render_cache, entry);
}
}
void
brw_render_cache_set_add_bo(struct brw_context *brw, brw_bo *bo)
{
- _mesa_set_add(brw->render_cache, bo);
+ _mesa_set_add(brw->batch.render_cache, bo);
}
/**
@@ -1076,7 +1076,7 @@ brw_render_cache_set_add_bo(struct brw_context *brw, brw_bo *bo)
void
brw_render_cache_set_check_flush(struct brw_context *brw, brw_bo *bo)
{
- if (!_mesa_set_search(brw->render_cache, bo))
+ if (!_mesa_set_search(brw->batch.render_cache, bo))
return;
brw_emit_mi_flush(brw);
@@ -1103,6 +1103,6 @@ intel_fbo_init(struct brw_context *brw)
dd->EGLImageTargetRenderbufferStorage =
intel_image_target_renderbuffer_storage;
- brw->render_cache = _mesa_set_create(brw, _mesa_hash_pointer,
- _mesa_key_pointer_equal);
+ brw->batch.render_cache = _mesa_set_create(brw, _mesa_hash_pointer,
+ _mesa_key_pointer_equal);
}
--
2.5.0
More information about the mesa-dev
mailing list