/* Add buffer sizes for memory checking in need_cs_space. */
r600_context_add_resource_size(ctx, &program->shader.bo->b.b);
- if (info->indirect)
- r600_context_add_resource_size(ctx, info->indirect);
/* TODO: add the scratch buffer */
+ if (info->indirect) {
+ r600_context_add_resource_size(ctx, info->indirect);
+
+ /* The hw doesn't read the indirect buffer via TC L2. */
+ if (r600_resource(info->indirect)->TC_L2_dirty) {
+ sctx->b.flags |= SI_CONTEXT_INV_GLOBAL_L2;
+ r600_resource(info->indirect)->TC_L2_dirty = false;
+ }
+ }
+
si_need_cs_space(sctx);
if (!sctx->cs_shader_state.initialized)