by reusing the CS initialization in r600_context_flush.
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
r600_init_atom(rctx, &rctx->sample_mask.atom, id++, cayman_emit_sample_mask, 4);
}
rctx->sample_mask.sample_mask = ~0;
- r600_atom_dirty(rctx, &rctx->sample_mask.atom);
r600_init_atom(rctx, &rctx->cb_misc_state.atom, id++, evergreen_emit_cb_misc_state, 0);
- r600_atom_dirty(rctx, &rctx->cb_misc_state.atom);
-
r600_init_atom(rctx, &rctx->alphatest_state.atom, id++, r600_emit_alphatest_state, 6);
- r600_atom_dirty(rctx, &rctx->alphatest_state.atom);
-
r600_init_atom(rctx, &rctx->db_misc_state.atom, id++, evergreen_emit_db_misc_state, 7);
- r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
rctx->context.create_blend_state = evergreen_create_blend_state;
rctx->context.create_depth_stencil_alpha_state = evergreen_create_dsa_state;
void r600_context_pipe_state_emit(struct r600_context *ctx, struct r600_pipe_state *state, unsigned pkt_flags);
void r600_context_pipe_state_set(struct r600_context *ctx, struct r600_pipe_state *state);
void r600_context_flush(struct r600_context *ctx, unsigned flags);
+void r600_begin_new_cs(struct r600_context *ctx);
void r600_context_emit_fence(struct r600_context *ctx, struct r600_resource *fence,
unsigned offset, unsigned value);
void r600_context_flush(struct r600_context *ctx, unsigned flags)
{
struct radeon_winsys_cs *cs = ctx->cs;
- struct r600_block *enable_block = NULL;
- bool timer_queries_suspended = false;
- bool nontimer_queries_suspended = false;
- bool streamout_suspended = false;
- unsigned shader;
if (cs->cdw == ctx->start_cs_cmd.atom.num_dw)
return;
+ ctx->timer_queries_suspended = false;
+ ctx->nontimer_queries_suspended = false;
+ ctx->streamout_suspended = false;
+
/* suspend queries */
if (ctx->num_cs_dw_timer_queries_suspend) {
r600_suspend_timer_queries(ctx);
- timer_queries_suspended = true;
+ ctx->timer_queries_suspended = true;
}
if (ctx->num_cs_dw_nontimer_queries_suspend) {
r600_suspend_nontimer_queries(ctx);
- nontimer_queries_suspended = true;
+ ctx->nontimer_queries_suspended = true;
}
if (ctx->num_cs_dw_streamout_end) {
r600_context_streamout_end(ctx);
- streamout_suspended = true;
+ ctx->streamout_suspended = true;
}
/* partial flush is needed to avoid lockups on some chips with user fences */
/* Flush the CS. */
ctx->ws->cs_flush(ctx->cs, flags);
+ r600_begin_new_cs(ctx);
+}
+
+void r600_begin_new_cs(struct r600_context *ctx)
+{
+ struct r600_block *enable_block = NULL;
+ unsigned shader;
+
ctx->pm4_dirty_cdwords = 0;
ctx->flags = 0;
r600_sampler_states_dirty(ctx, &samplers->states);
}
- if (streamout_suspended) {
+ if (ctx->streamout_suspended) {
ctx->streamout_start = TRUE;
ctx->streamout_append_bitmask = ~0;
}
/* resume queries */
- if (timer_queries_suspended) {
+ if (ctx->timer_queries_suspended) {
r600_resume_timer_queries(ctx);
}
- if (nontimer_queries_suspended) {
+ if (ctx->nontimer_queries_suspended) {
r600_resume_nontimer_queries(ctx);
}
rctx->cs = rctx->ws->cs_create(rctx->ws);
rctx->ws->cs_set_flush_callback(rctx->cs, r600_flush_from_winsys, rctx);
- r600_emit_atom(rctx, &rctx->start_cs_cmd.atom);
rctx->uploader = u_upload_create(&rctx->context, 1024 * 1024, 256,
PIPE_BIND_INDEX_BUFFER |
goto fail;
rctx->blitter->draw_rectangle = r600_draw_rectangle;
+ r600_begin_new_cs(rctx);
r600_get_backend_mask(rctx); /* this emits commands and must be last */
if (rctx->chip_class == R600)
struct list_head active_nontimer_queries;
unsigned num_cs_dw_nontimer_queries_suspend;
+ bool timer_queries_suspended;
+ bool nontimer_queries_suspended;
+ bool streamout_suspended;
+
unsigned num_cs_dw_streamout_end;
unsigned backend_mask;
r600_init_atom(rctx, &rctx->vertex_buffer_state.atom, id++, r600_emit_vertex_buffers, 0);
r600_init_atom(rctx, &rctx->seamless_cube_map.atom, id++, r600_emit_seamless_cube_map, 3);
- r600_atom_dirty(rctx, &rctx->seamless_cube_map.atom);
-
r600_init_atom(rctx, &rctx->sample_mask.atom, id++, r600_emit_sample_mask, 3);
rctx->sample_mask.sample_mask = ~0;
- r600_atom_dirty(rctx, &rctx->sample_mask.atom);
r600_init_atom(rctx, &rctx->cb_misc_state.atom, id++, r600_emit_cb_misc_state, 0);
- r600_atom_dirty(rctx, &rctx->cb_misc_state.atom);
-
r600_init_atom(rctx, &rctx->alphatest_state.atom, id++, r600_emit_alphatest_state, 6);
- r600_atom_dirty(rctx, &rctx->alphatest_state.atom);
-
r600_init_atom(rctx, &rctx->db_misc_state.atom, id++, r600_emit_db_misc_state, 4);
- r600_atom_dirty(rctx, &rctx->db_misc_state.atom);
rctx->context.create_blend_state = r600_create_blend_state;
rctx->context.create_depth_stencil_alpha_state = r600_create_dsa_state;