summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/iris/iris_resource.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/iris/iris_resource.c')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 989c112a3e3..5b1fde7aac6 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1746,6 +1746,10 @@ iris_transfer_map(struct pipe_context *ctx,
xfer->box = *box;
*ptransfer = xfer;
+ map->dest_had_defined_contents =
+ util_ranges_intersect(&res->valid_buffer_range, box->x,
+ box->x + box->width);
+
if (usage & PIPE_TRANSFER_WRITE)
util_range_add(&res->valid_buffer_range, box->x, box->x + box->width);
@@ -1826,8 +1830,13 @@ iris_transfer_flush_region(struct pipe_context *ctx,
uint32_t history_flush = 0;
if (res->base.target == PIPE_BUFFER) {
- history_flush |= iris_flush_bits_for_history(res) |
- (map->staging ? PIPE_CONTROL_RENDER_TARGET_FLUSH : 0);
+ if (map->staging)
+ history_flush |= PIPE_CONTROL_RENDER_TARGET_FLUSH;
+
+ if (map->dest_had_defined_contents)
+ history_flush |= iris_flush_bits_for_history(res);
+
+ util_range_add(&res->valid_buffer_range, box->x, box->x + box->width);
}
if (history_flush & ~PIPE_CONTROL_CS_STALL) {