iris: Only resolve for image levels/layers which are actually in use.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 11 Mar 2019 04:30:28 +0000 (21:30 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 27 Sep 2019 05:49:10 +0000 (22:49 -0700)
There's no need to resolve everything.

src/gallium/drivers/iris/iris_resolve.c
src/gallium/drivers/iris/iris_resource.h

index f2255e8f5fb58876e70d78a7879f003f0aa0d350..30aa87d7f6e4d3ecfa3955521560b54cf32464ac 100644 (file)
@@ -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,
index 826c959eb46287b44c08c04b49f1b09d72bcafc9..806fe34d631113fc569f14d07ba25c4870d47bdf 100644 (file)
@@ -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)