freedreno: also mark draw-indirect buffer as read
authorRob Clark <robdclark@gmail.com>
Wed, 29 Nov 2017 14:04:08 +0000 (09:04 -0500)
committerRob Clark <robdclark@gmail.com>
Sun, 3 Dec 2017 19:17:41 +0000 (14:17 -0500)
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_draw.c

index bcd21a232d24cfecb82000b4c94bd130067839cb..60a1180f24d5b17dc02a4348c0b628788d7f057e 100644 (file)
@@ -197,6 +197,10 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
        /* Mark index buffer as being read */
        resource_read(batch, indexbuf);
 
+       /* Mark indirect draw buffer as being read */
+       if (info->indirect)
+               resource_read(batch, info->indirect->buffer);
+
        /* Mark textures as being read */
        foreach_bit(i, ctx->tex[PIPE_SHADER_VERTEX].valid_textures)
                resource_read(batch, ctx->tex[PIPE_SHADER_VERTEX].textures[i]->texture);
@@ -475,6 +479,9 @@ fd_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
        foreach_bit(i, ctx->tex[PIPE_SHADER_COMPUTE].valid_textures)
                resource_read(batch, ctx->tex[PIPE_SHADER_COMPUTE].textures[i]->texture);
 
+       if (info->indirect)
+               resource_read(batch, info->indirect);
+
        mtx_unlock(&ctx->screen->lock);
 
        ctx->launch_grid(ctx, info);