summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-08 11:40:25 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:12 -0800
commitf8aa9aa353195c50bb9204387bb953c419e6fb37 (patch)
treeab91a001214965f2961c8c2b091b8d0b90f27106 /src/gallium/drivers/iris
parentc53a67d4693745e52127b9ea027ecbf9e87ae639 (diff)
iris: resolve before transfer maps
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c6
-rw-r--r--src/gallium/drivers/iris/iris_resource.h9
2 files changed, 12 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 349e4efe022..c40b3e6575c 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1061,6 +1061,12 @@ iris_transfer_map(struct pipe_context *ctx,
(usage & PIPE_TRANSFER_MAP_DIRECTLY))
return NULL;
+ if (resource->target != PIPE_BUFFER) {
+ iris_resource_access_raw(ice, &ice->batches[IRIS_BATCH_RENDER], res,
+ level, box->z, box->depth,
+ usage & PIPE_TRANSFER_WRITE);
+ }
+
if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED)) {
for (int i = 0; i < IRIS_BATCH_COUNT; i++) {
if (iris_batch_references(&ice->batches[i], res->bo))
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index c31f70ba058..8e57b861437 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -298,12 +298,15 @@ iris_resource_access_raw(struct iris_context *ice,
struct iris_batch *batch,
struct iris_resource *res,
uint32_t level, uint32_t layer,
+ uint32_t num_layers,
bool write)
{
- iris_resource_prepare_access(ice, batch, res, level, 1, layer, 1,
+ iris_resource_prepare_access(ice, batch, res, level, 1, layer, num_layers,
ISL_AUX_USAGE_NONE, false);
- if (write)
- iris_resource_finish_write(ice, res, level, layer, 1, ISL_AUX_USAGE_NONE);
+ if (write) {
+ iris_resource_finish_write(ice, res, level, layer, num_layers,
+ ISL_AUX_USAGE_NONE);
+ }
}
enum isl_aux_usage iris_resource_texture_aux_usage(struct iris_context *ice,