summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2020-02-06 22:21:28 -0800
committerFrancisco Jerez <currojerez@riseup.net>2020-02-06 22:21:55 -0800
commit46f552d58a8dd096248b9c921a0d8ab669a3422c (patch)
treef7d84e9ae7b95e0ca1fc042efe008c17edcff2ba
parent73e11f350a31cf4f9bfe5395e801bc01f60aacf2 (diff)
WIP: iris: Insert buffer-local memory barriers for SSBO reads and writes.
-rw-r--r--src/gallium/drivers/iris/iris_resolve.c15
-rw-r--r--src/gallium/drivers/iris/iris_state.c4
2 files changed, 18 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c
index 28db88d9a13..b2dd9fdadf4 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -162,6 +162,20 @@ flush_ubos(struct iris_batch *batch,
}
}
+static void
+flush_ssbos(struct iris_batch *batch,
+ struct iris_shader_state *shs)
+{
+ uint32_t ssbos = shs->bound_ssbos;
+
+ while (ssbos) {
+ const int i = u_bit_scan(&ssbos);
+ struct pipe_shader_buffer *ssbo = &shs->ssbo[i];
+ struct iris_resource *res = (void *)ssbo->buffer;
+ iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_DATA_WRITE);
+ }
+}
+
/**
* \brief Resolve buffers before drawing.
*
@@ -186,6 +200,7 @@ iris_predraw_resolve_inputs(struct iris_context *ice,
consider_framebuffer);
resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled,
consider_framebuffer);
+ flush_ssbos(batch, shs);
}
if (ice->state.dirty & (IRIS_DIRTY_CONSTANTS_VS << stage))
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 21686f00545..3fbf540d114 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -3305,7 +3305,9 @@ iris_set_shader_buffers(struct pipe_context *ctx,
}
}
- ice->state.dirty |= IRIS_DIRTY_BINDINGS_VS << stage;
+ ice->state.dirty |= (IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES |
+ IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES |
+ IRIS_DIRTY_BINDINGS_VS << stage);
}
static void