From: Rob Clark Date: Thu, 16 Nov 2017 13:37:59 +0000 (-0500) Subject: freedreno: also mark images used by draw/grid X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff018a3f555238efc060ff4dc9cf27c1a0830522;p=mesa.git freedreno: also mark images used by draw/grid Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c index cd3647b9e76..3f70c89ce08 100644 --- a/src/gallium/drivers/freedreno/freedreno_draw.c +++ b/src/gallium/drivers/freedreno/freedreno_draw.c @@ -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);