radeonsi: initialize the first CS like any other
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>
This commit is contained in:
parent
2b0a54d6ec
commit
9eb3b9dc2b
|
@ -74,6 +74,7 @@ struct r600_screen;
|
||||||
|
|
||||||
void si_get_backend_mask(struct r600_context *ctx);
|
void si_get_backend_mask(struct r600_context *ctx);
|
||||||
void si_context_flush(struct r600_context *ctx, unsigned flags);
|
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);
|
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 r600_context_query_destroy(struct r600_context *ctx, struct r600_query *query);
|
||||||
|
|
|
@ -179,15 +179,15 @@ void si_need_cs_space(struct r600_context *ctx, unsigned num_dw,
|
||||||
void si_context_flush(struct r600_context *ctx, unsigned flags)
|
void si_context_flush(struct r600_context *ctx, unsigned flags)
|
||||||
{
|
{
|
||||||
struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs;
|
struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs;
|
||||||
bool queries_suspended = false;
|
|
||||||
|
|
||||||
if (!cs->cdw)
|
if (!cs->cdw)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* suspend queries */
|
/* suspend queries */
|
||||||
|
ctx->nontimer_queries_suspended = false;
|
||||||
if (ctx->num_cs_dw_nontimer_queries_suspend) {
|
if (ctx->num_cs_dw_nontimer_queries_suspend) {
|
||||||
r600_context_queries_suspend(ctx);
|
r600_context_queries_suspend(ctx);
|
||||||
queries_suspended = true;
|
ctx->nontimer_queries_suspended = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->b.streamout.suspended = false;
|
ctx->b.streamout.suspended = false;
|
||||||
|
@ -245,6 +245,11 @@ void si_context_flush(struct r600_context *ctx, unsigned flags)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
si_begin_new_cs(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
void si_begin_new_cs(struct r600_context *ctx)
|
||||||
|
{
|
||||||
ctx->pm4_dirty_cdwords = 0;
|
ctx->pm4_dirty_cdwords = 0;
|
||||||
|
|
||||||
/* Flush read caches at the beginning of CS. */
|
/* Flush read caches at the beginning of CS. */
|
||||||
|
@ -267,7 +272,7 @@ void si_context_flush(struct r600_context *ctx, unsigned flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* resume queries */
|
/* resume queries */
|
||||||
if (queries_suspended) {
|
if (ctx->nontimer_queries_suspended) {
|
||||||
r600_context_queries_resume(ctx);
|
r600_context_queries_resume(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -279,14 +279,15 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
|
||||||
if (rctx->blitter == NULL)
|
if (rctx->blitter == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
si_get_backend_mask(rctx); /* this emits commands and must be last */
|
|
||||||
|
|
||||||
rctx->dummy_pixel_shader =
|
rctx->dummy_pixel_shader =
|
||||||
util_make_fragment_cloneinput_shader(&rctx->b.b, 0,
|
util_make_fragment_cloneinput_shader(&rctx->b.b, 0,
|
||||||
TGSI_SEMANTIC_GENERIC,
|
TGSI_SEMANTIC_GENERIC,
|
||||||
TGSI_INTERPOLATE_CONSTANT);
|
TGSI_INTERPOLATE_CONSTANT);
|
||||||
rctx->b.b.bind_fs_state(&rctx->b.b, rctx->dummy_pixel_shader);
|
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;
|
return &rctx->b.b;
|
||||||
fail:
|
fail:
|
||||||
r600_destroy_context(&rctx->b.b);
|
r600_destroy_context(&rctx->b.b);
|
||||||
|
|
|
@ -180,6 +180,8 @@ struct r600_context {
|
||||||
/* The list of active queries. Only one query of each type can be active. */
|
/* The list of active queries. Only one query of each type can be active. */
|
||||||
struct list_head active_nontimer_query_list;
|
struct list_head active_nontimer_query_list;
|
||||||
unsigned num_cs_dw_nontimer_queries_suspend;
|
unsigned num_cs_dw_nontimer_queries_suspend;
|
||||||
|
/* If queries have been suspended. */
|
||||||
|
bool nontimer_queries_suspended;
|
||||||
|
|
||||||
unsigned backend_mask;
|
unsigned backend_mask;
|
||||||
unsigned max_db; /* for OQ */
|
unsigned max_db; /* for OQ */
|
||||||
|
|
|
@ -242,6 +242,7 @@ void si_pm4_emit_dirty(struct r600_context *rctx)
|
||||||
if (!state || rctx->emitted.array[i] == state)
|
if (!state || rctx->emitted.array[i] == state)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
assert(state != rctx->queued.named.init);
|
||||||
si_pm4_emit(rctx, state);
|
si_pm4_emit(rctx, state);
|
||||||
rctx->emitted.array[i] = state;
|
rctx->emitted.array[i] = state;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue