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);
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);