summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2020-02-05 19:06:20 -0800
committerFrancisco Jerez <currojerez@riseup.net>2020-02-06 22:21:55 -0800
commit2fb272f34fb5b0e78ab38161772a7c3b7b60c82e (patch)
tree6612b5028bb44889c44c7bc095310543a8eab8f2
parent46f552d58a8dd096248b9c921a0d8ab669a3422c (diff)
WIP: iris: Make sure a bound resource is flushed after iris_dirty_for_history.
-rw-r--r--src/gallium/drivers/iris/iris_context.h1
-rw-r--r--src/gallium/drivers/iris/iris_resource.c21
2 files changed, 19 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 9328ef071eb..919c8c6b492 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -120,6 +120,7 @@ enum {
#define IRIS_DIRTY_CONSTANTS_CS (1ull << 40)
#define IRIS_DIRTY_DEPTH_BUFFER (1ull << 41)
#define IRIS_DIRTY_WM (1ull << 42)
+#define IRIS_SHIFT_FOR_DIRTY_BINDINGS 43
#define IRIS_DIRTY_BINDINGS_VS (1ull << 43)
#define IRIS_DIRTY_BINDINGS_TCS (1ull << 44)
#define IRIS_DIRTY_BINDINGS_TES (1ull << 45)
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 0e02f68e023..5215f6e82e6 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1967,16 +1967,31 @@ iris_transfer_unmap(struct pipe_context *ctx, struct pipe_transfer *xfer)
/**
* Mark state dirty that needs to be re-emitted when a resource is written.
+ *
+ * XXX - Verify that dirty flags below acts as memory barriers scoped to
+ * objects already bound to the pipeline with one of those types.
*/
void
iris_dirty_for_history(struct iris_context *ice,
struct iris_resource *res)
{
+ const uint64_t stages = res->bind_stages;
uint64_t dirty = 0ull;
- if (res->bind_history & PIPE_BIND_CONSTANT_BUFFER) {
- dirty |= ((uint64_t)res->bind_stages) << IRIS_SHIFT_FOR_DIRTY_CONSTANTS;
- }
+ if (res->bind_history & PIPE_BIND_CONSTANT_BUFFER)
+ dirty |= IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES |
+ IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES |
+ (stages << IRIS_SHIFT_FOR_DIRTY_CONSTANTS);
+
+ if (res->bind_history & (PIPE_BIND_SAMPLER_VIEW |
+ PIPE_BIND_SHADER_IMAGE |
+ PIPE_BIND_SHADER_BUFFER))
+ dirty |= IRIS_DIRTY_RENDER_RESOLVES_AND_FLUSHES |
+ IRIS_DIRTY_COMPUTE_RESOLVES_AND_FLUSHES |
+ (stages << IRIS_SHIFT_FOR_DIRTY_BINDINGS);
+
+ if (res->bind_history & PIPE_BIND_VERTEX_BUFFER)
+ dirty |= IRIS_DIRTY_VERTEX_BUFFERS;
ice->state.dirty |= dirty;
}