diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/iris/iris_resource.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 48f348b643e..ca8832c5b34 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -824,6 +824,12 @@ iris_transfer_map(struct pipe_context *ctx, struct iris_resource *res = (struct iris_resource *)resource; struct isl_surf *surf = &res->surf; + /* If we can discard the whole resource, we can also discard the + * subrange being accessed. + */ + if (usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) + usage |= PIPE_TRANSFER_DISCARD_RANGE; + if (surf->tiling != ISL_TILING_LINEAR && (usage & PIPE_TRANSFER_MAP_DIRECTLY)) return NULL; @@ -841,9 +847,6 @@ iris_transfer_map(struct pipe_context *ctx, struct iris_transfer *map = slab_alloc(&ice->transfer_pool); struct pipe_transfer *xfer = &map->base; - // PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE - // PIPE_TRANSFER_DISCARD_RANGE - if (!map) return NULL; |