iris: use the images_used mask in resolve pass
authorTapani Pälli <tapani.palli@intel.com>
Wed, 19 Feb 2020 06:34:51 +0000 (08:34 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 16 Mar 2020 10:34:21 +0000 (10:34 +0000)
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4080>

src/gallium/drivers/iris/iris_resolve.c

index 2208226e6073cc7009f9e22bb269b7b6111204dc..a46d7bf45b33aaddb416a67e8fd5eb5111de1e3c 100644 (file)
@@ -116,11 +116,11 @@ static void
 resolve_image_views(struct iris_context *ice,
                     struct iris_batch *batch,
                     struct iris_shader_state *shs,
+                    const struct shader_info *info,
                     bool *draw_aux_buffer_disabled,
                     bool consider_framebuffer)
 {
-   /* TODO: Consider images used by program */
-   uint32_t views = shs->bound_image_views;
+   uint32_t views = info ? (shs->bound_image_views & info->images_used) : 0;
 
    while (views) {
       const int i = u_bit_scan(&views);
@@ -171,7 +171,7 @@ iris_predraw_resolve_inputs(struct iris_context *ice,
    if (ice->state.dirty & dirty) {
       resolve_sampler_views(ice, batch, shs, info, draw_aux_buffer_disabled,
                             consider_framebuffer);
-      resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled,
+      resolve_image_views(ice, batch, shs, info, draw_aux_buffer_disabled,
                           consider_framebuffer);
    }
 }