freedreno: also mark images used by draw/grid
authorRob Clark <robdclark@gmail.com>
Thu, 16 Nov 2017 13:37:59 +0000 (08:37 -0500)
committerRob Clark <robdclark@gmail.com>
Thu, 16 Nov 2017 13:44:19 +0000 (08:44 -0500)
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_draw.c

index cd3647b9e76b40145ff09accd719e8f700630674..3f70c89ce08340a4ba83b66f7fb913570dc2164a 100644 (file)
@@ -165,6 +165,15 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
        foreach_bit(i, ctx->shaderbuf[PIPE_SHADER_FRAGMENT].enabled_mask)
                resource_written(batch, ctx->shaderbuf[PIPE_SHADER_FRAGMENT].sb[i].buffer);
 
+       foreach_bit(i, ctx->shaderimg[PIPE_SHADER_FRAGMENT].enabled_mask) {
+               struct pipe_image_view *img =
+                       &ctx->shaderimg[PIPE_SHADER_FRAGMENT].si[i];
+               if (img->access & PIPE_IMAGE_ACCESS_WRITE)
+                       resource_written(batch, img->resource);
+               else
+                       resource_read(batch, img->resource);
+       }
+
        foreach_bit(i, ctx->constbuf[PIPE_SHADER_VERTEX].enabled_mask)
                resource_read(batch, ctx->constbuf[PIPE_SHADER_VERTEX].cb[i].buffer);
        foreach_bit(i, ctx->constbuf[PIPE_SHADER_FRAGMENT].enabled_mask)
@@ -440,6 +449,15 @@ fd_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
        foreach_bit(i, ctx->shaderbuf[PIPE_SHADER_COMPUTE].enabled_mask)
                resource_read(batch, ctx->shaderbuf[PIPE_SHADER_COMPUTE].sb[i].buffer);
 
+       foreach_bit(i, ctx->shaderimg[PIPE_SHADER_COMPUTE].enabled_mask) {
+               struct pipe_image_view *img =
+                       &ctx->shaderimg[PIPE_SHADER_COMPUTE].si[i];
+               if (img->access & PIPE_IMAGE_ACCESS_WRITE)
+                       resource_written(batch, img->resource);
+               else
+                       resource_read(batch, img->resource);
+       }
+
        /* UBO's are read */
        foreach_bit(i, ctx->constbuf[PIPE_SHADER_COMPUTE].enabled_mask)
                resource_read(batch, ctx->constbuf[PIPE_SHADER_COMPUTE].cb[i].buffer);