summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2020-02-05 18:26:39 -0800
committerFrancisco Jerez <currojerez@riseup.net>2020-02-06 22:21:55 -0800
commit35108ba4511d77bcfe2f6ddc9643c94fa14b14c3 (patch)
tree331d272fa4a7b0fa912ac4e80698747153b99f80
parent7a8c8189b5d76949d57cd7ace2aef37fa0ca7085 (diff)
WIP: iris: Remove remaining history flushes.
-rw-r--r--src/gallium/drivers/iris/iris_resource.c49
-rw-r--r--src/gallium/drivers/iris/iris_resource.h2
-rw-r--r--src/gallium/drivers/iris/iris_state.c11
3 files changed, 3 insertions, 59 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 2e849c3512e..4539bf7ba49 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1911,29 +1911,8 @@ iris_transfer_flush_region(struct pipe_context *ctx,
if (map->staging)
iris_flush_staging_region(xfer, box);
- uint32_t history_flush = 0;
-
- if (res->base.target == PIPE_BUFFER) {
- if (map->staging)
- history_flush |= PIPE_CONTROL_RENDER_TARGET_FLUSH;
-
- if (map->dest_had_defined_contents)
- history_flush |= iris_flush_bits_for_history(res);
-
+ if (res->base.target == PIPE_BUFFER)
util_range_add(&res->base, &res->valid_buffer_range, box->x, box->x + box->width);
- }
-
- if (history_flush & ~PIPE_CONTROL_CS_STALL) {
- for (int i = 0; i < IRIS_BATCH_COUNT; i++) {
- struct iris_batch *batch = &ice->batches[i];
- if (batch->contains_draw || batch->cache.render->entries) {
- iris_batch_maybe_flush(batch, 24);
- iris_emit_pipe_control_flush(batch,
- "cache history: transfer flush",
- history_flush);
- }
- }
- }
/* Make sure we flag constants dirty even if there's no need to emit
* any PIPE_CONTROLs to a batch.
@@ -1996,32 +1975,6 @@ iris_dirty_for_history(struct iris_context *ice,
ice->state.dirty |= dirty;
}
-/**
- * Produce a set of PIPE_CONTROL bits which ensure data written to a
- * resource becomes visible, and any stale read cache data is invalidated.
- */
-uint32_t
-iris_flush_bits_for_history(struct iris_resource *res)
-{
- uint32_t flush = PIPE_CONTROL_CS_STALL;
-
- if (res->bind_history & PIPE_BIND_CONSTANT_BUFFER) {
- flush |= PIPE_CONTROL_CONST_CACHE_INVALIDATE |
- PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE;
- }
-
- if (res->bind_history & PIPE_BIND_SAMPLER_VIEW)
- flush |= PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE;
-
- if (res->bind_history & (PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_INDEX_BUFFER))
- flush |= PIPE_CONTROL_VF_CACHE_INVALIDATE;
-
- if (res->bind_history & (PIPE_BIND_SHADER_BUFFER | PIPE_BIND_SHADER_IMAGE))
- flush |= PIPE_CONTROL_DATA_CACHE_FLUSH;
-
- return flush;
-}
-
bool
iris_resource_set_clear_color(struct iris_context *ice,
struct iris_resource *res,
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index c77359dbb1a..90e03289b66 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -310,8 +310,6 @@ void iris_init_screen_resource_functions(struct pipe_screen *pscreen);
void iris_dirty_for_history(struct iris_context *ice,
struct iris_resource *res);
-uint32_t iris_flush_bits_for_history(struct iris_resource *res);
-
unsigned iris_get_num_logical_layers(const struct iris_resource *res,
unsigned level);
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 3fbf540d114..18bd03ede1b 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -3594,19 +3594,12 @@ iris_set_stream_output_targets(struct pipe_context *ctx,
if (active) {
ice->state.dirty |= IRIS_DIRTY_SO_DECL_LIST;
} else {
- uint32_t flush = 0;
for (int i = 0; i < PIPE_MAX_SO_BUFFERS; i++) {
struct iris_stream_output_target *tgt =
(void *) ice->state.so_target[i];
- if (tgt) {
- struct iris_resource *res = (void *) tgt->base.buffer;
-
- flush |= iris_flush_bits_for_history(res);
- iris_dirty_for_history(ice, res);
- }
+ if (tgt)
+ iris_dirty_for_history(ice, (void *)tgt->base.buffer);
}
- iris_emit_pipe_control_flush(&ice->batches[IRIS_BATCH_RENDER],
- "make streamout results visible", flush);
}
}