From 237c7636ca4c429d4dbfce95b6e3281a8309eac7 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 10 Mar 2019 21:30:28 -0700 Subject: [PATCH] iris: Only resolve for image levels/layers which are actually in use. There's no need to resolve everything. --- src/gallium/drivers/iris/iris_resolve.c | 26 +++++++++++------------- src/gallium/drivers/iris/iris_resource.h | 3 --- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index f2255e8f5fb..30aa87d7f6e 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -127,15 +127,24 @@ resolve_image_views(struct iris_context *ice, while (views) { const int i = u_bit_scan(&views); - struct iris_resource *res = (void *) shs->image[i].base.resource; + struct pipe_image_view *pview = &shs->image[i].base; + struct iris_resource *res = (void *) pview->resource; if (res->base.target != PIPE_BUFFER) { if (consider_framebuffer) { disable_rb_aux_buffer(ice, draw_aux_buffer_disabled, - res, 0, ~0, "as a shader image"); + res, pview->u.tex.level, 1, + "as a shader image"); } - iris_resource_prepare_image(ice, batch, res); + unsigned num_layers = + pview->u.tex.last_layer - pview->u.tex.first_layer + 1; + + /* The data port doesn't understand any compression */ + iris_resource_prepare_access(ice, batch, res, + pview->u.tex.level, 1, + pview->u.tex.first_layer, num_layers, + ISL_AUX_USAGE_NONE, false); } iris_cache_flush_for_read(batch, res->bo); @@ -1398,17 +1407,6 @@ iris_resource_prepare_texture(struct iris_context *ice, aux_usage, clear_supported); } -void -iris_resource_prepare_image(struct iris_context *ice, - struct iris_batch *batch, - struct iris_resource *res) -{ - /* The data port doesn't understand any compression */ - iris_resource_prepare_access(ice, batch, res, 0, INTEL_REMAINING_LEVELS, - 0, INTEL_REMAINING_LAYERS, - ISL_AUX_USAGE_NONE, false); -} - enum isl_aux_usage iris_resource_render_aux_usage(struct iris_context *ice, struct iris_resource *res, diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h index 826c959eb46..806fe34d631 100644 --- a/src/gallium/drivers/iris/iris_resource.h +++ b/src/gallium/drivers/iris/iris_resource.h @@ -421,9 +421,6 @@ void iris_resource_prepare_texture(struct iris_context *ice, uint32_t start_level, uint32_t num_levels, uint32_t start_layer, uint32_t num_layers, enum gen9_astc5x5_wa_tex_type); -void iris_resource_prepare_image(struct iris_context *ice, - struct iris_batch *batch, - struct iris_resource *res); static inline bool iris_resource_unfinished_aux_import(struct iris_resource *res) -- 2.30.2