gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times
[mesa.git] / src / gallium / drivers / freedreno / freedreno_draw.c
index d3bf3165276191a616883c6279f3bea63969a5ec..eb36a930751432a86827ad980c0e7bc2459c8255 100644 (file)
@@ -459,7 +459,7 @@ fd_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
        struct fd_batch *batch, *save_batch = NULL;
        unsigned i;
 
-       batch = fd_batch_create(ctx);
+       batch = fd_batch_create(ctx, true);
        fd_batch_reference(&save_batch, ctx->batch);
        fd_batch_reference(&ctx->batch, batch);
 
@@ -488,14 +488,21 @@ 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);
 
+       /* For global buffers, we don't really know if read or written, so assume
+        * the worst:
+        */
+       foreach_bit(i, ctx->global_bindings.enabled_mask)
+               resource_written(batch, ctx->global_bindings.buf[i]);
+
        if (info->indirect)
                resource_read(batch, info->indirect);
 
        mtx_unlock(&ctx->screen->lock);
 
+       batch->needs_flush = true;
        ctx->launch_grid(ctx, info);
 
-       fd_gmem_flush_compute(batch);
+       fd_batch_flush(batch, false, false);
 
        fd_batch_reference(&ctx->batch, save_batch);
        fd_batch_reference(&save_batch, NULL);