So that the "init" state is always emitted first and not later in draw_vbo.
This fixes streamout where the "init" state, which disables streamout,
was emitted in draw_vbo after streamout was enabled.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
void si_get_backend_mask(struct r600_context *ctx);
void si_context_flush(struct r600_context *ctx, unsigned flags);
+void si_begin_new_cs(struct r600_context *ctx);
struct r600_query *r600_context_query_create(struct r600_context *ctx, unsigned query_type);
void r600_context_query_destroy(struct r600_context *ctx, struct r600_query *query);
void si_context_flush(struct r600_context *ctx, unsigned flags)
{
struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs;
- bool queries_suspended = false;
if (!cs->cdw)
return;
/* suspend queries */
+ ctx->nontimer_queries_suspended = false;
if (ctx->num_cs_dw_nontimer_queries_suspend) {
r600_context_queries_suspend(ctx);
- queries_suspended = true;
+ ctx->nontimer_queries_suspended = true;
}
ctx->b.streamout.suspended = false;
}
#endif
+ si_begin_new_cs(ctx);
+}
+
+void si_begin_new_cs(struct r600_context *ctx)
+{
ctx->pm4_dirty_cdwords = 0;
/* Flush read caches at the beginning of CS. */
}
/* resume queries */
- if (queries_suspended) {
+ if (ctx->nontimer_queries_suspended) {
r600_context_queries_resume(ctx);
}
if (rctx->blitter == NULL)
goto fail;
- si_get_backend_mask(rctx); /* this emits commands and must be last */
-
rctx->dummy_pixel_shader =
util_make_fragment_cloneinput_shader(&rctx->b.b, 0,
TGSI_SEMANTIC_GENERIC,
TGSI_INTERPOLATE_CONSTANT);
rctx->b.b.bind_fs_state(&rctx->b.b, rctx->dummy_pixel_shader);
+ /* these must be last */
+ si_begin_new_cs(rctx);
+ si_get_backend_mask(rctx);
return &rctx->b.b;
fail:
r600_destroy_context(&rctx->b.b);
/* The list of active queries. Only one query of each type can be active. */
struct list_head active_nontimer_query_list;
unsigned num_cs_dw_nontimer_queries_suspend;
+ /* If queries have been suspended. */
+ bool nontimer_queries_suspended;
unsigned backend_mask;
unsigned max_db; /* for OQ */
if (!state || rctx->emitted.array[i] == state)
continue;
+ assert(state != rctx->queued.named.init);
si_pm4_emit(rctx, state);
rctx->emitted.array[i] = state;
}